需要了解在浏览器中显示的单个Google Map上覆盖多个KML文件的过程。用于此目的的KML文件可以指向不同的位置。例如:北美的KML1 &KML2为亚洲。有谁能帮我一下吗?
我想你在找这个:
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>
你可以用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