在浏览器中显示的谷歌地图上叠加多个KML文件

发布于 2024-10-31 12:15:18 字数 108 浏览 2 评论 0原文

需要了解在浏览器中显示的单个 Google 地图上叠加多个 KML 文件的过程。用于此目的的 KML 文件可以指向不同的位置。例如:KML1 代表北美和北美适用于亚洲的 KML2。谁能帮我解决这个问题。

Need to know the procedure for overlaying multiple KML files on a single Google Map that is displayed in the browser. The KML files intended for this can point to different locations. Ex:KML1 for North America & KML2 for Asia. Could anyone help me out in this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

断桥再见 2024-11-07 12:15:18

我认为您正在寻找以下内容:

http://code.google.com /apis/kml/documentation/kml_tut.html#network_links

示例:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Folder>
    <name>Network Links</name>
    <visibility>0</visibility>
    <open>0</open>
    <description>Network link example 1</description>
    <NetworkLink>
      <name>Random Placemark</name>
      <visibility>0</visibility>
      <open>0</open>
      <description>A simple server-side script that generates a new random
        placemark on each call</description>
      <refreshVisibility>0</refreshVisibility>
      <flyToView>0</flyToView>
      <Link>
        <href>http://yourserver.com/map1.kml</href>
      </Link>
    </NetworkLink>

    <NetworkLink>
      <name>Random Placemark</name>
      <visibility>0</visibility>
      <open>0</open>
      <description>A simple server-side script that generates a new random
        placemark on each call</description>
      <refreshVisibility>0</refreshVisibility>
      <flyToView>0</flyToView>
      <Link>
        <href>http://yourserver.com/map2.kml</href>
      </Link>
    </NetworkLink>
  </Folder>
</kml>

I think you are looking for this:

http://code.google.com/apis/kml/documentation/kml_tut.html#network_links

example:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Folder>
    <name>Network Links</name>
    <visibility>0</visibility>
    <open>0</open>
    <description>Network link example 1</description>
    <NetworkLink>
      <name>Random Placemark</name>
      <visibility>0</visibility>
      <open>0</open>
      <description>A simple server-side script that generates a new random
        placemark on each call</description>
      <refreshVisibility>0</refreshVisibility>
      <flyToView>0</flyToView>
      <Link>
        <href>http://yourserver.com/map1.kml</href>
      </Link>
    </NetworkLink>

    <NetworkLink>
      <name>Random Placemark</name>
      <visibility>0</visibility>
      <open>0</open>
      <description>A simple server-side script that generates a new random
        placemark on each call</description>
      <refreshVisibility>0</refreshVisibility>
      <flyToView>0</flyToView>
      <Link>
        <href>http://yourserver.com/map2.kml</href>
      </Link>
    </NetworkLink>
  </Folder>
</kml>
暖树树初阳… 2024-11-07 12:15:18

您可以使用 Google Maps JS API 来完成此操作。您需要使用 google.maps.KmlLayer 为每个 KML 文件创建叠加层。

请参阅以下示例:http://code.google.com /apis/maps/documentation/javascript/examples/layer-kml.html

API 文档:
http://code.google.com/apis/maps/documentation /javascript/overlays.html#KMLLayers

You can do it with Google Maps JS API. You need to create overlays with google.maps.KmlLayer for each KML files.

See this example: http://code.google.com/apis/maps/documentation/javascript/examples/layer-kml.html

API Documentation:
http://code.google.com/apis/maps/documentation/javascript/overlays.html#KMLLayers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文