首页 文章

将Google my-places Map 中的数据添加到自定义的Google Map 中

提问于
浏览
0

我用javascript制作了一个自定义的谷歌 Map :http://resortstudio.ch/kontakt/

我想直接从个人google-my-places-map添加(导入)许多标记 . 从类似于此示例的内容:http://goo.gl/maps/0uRg

换一种说法 . 我想将谷歌 Map 上保存的个人 Map 中的数据导入我的自定义样式 Map . 是否有一种简单的方法可以导入这些地方/标记,而无需将代码中的每个位置都写入我的自定义 Map ?

1 回答

  • 4

    您可以使用KmlLayer in the google maps API v3导入KML . 有一个KML version of that map available .

    Here is an example that displays the example you provided using the API v3

    您询问:

    有没有办法,直接链接到谷歌 Map 上的KML文件,而不是自己下载/把KML文件放在服务器上?

    • 上面的示例使用直接链接到存储在Google服务器上的kml文件 .

    当我加载KML图层时,它会忽略我定义的 Map “中心” . 在上面的示例中也是如此,其中“center”设置为Chicago,但被KML(NYC)覆盖 . 有没有办法覆盖KML中心设置?


    您可以从保存的 Map 中单击KML链接下载上述KML,请参见下图并注意最后一个链接(KML) .

    enter image description here

相关问题