您可以從一個標鏈接到在一個引用其他說明另一個使用特殊的聯繫。該機制在KML標準中被稱爲特徵錨點。
請注意,巴黎地標中的網址爲#marseille;balloonFlyto
,其中目標地標的「id」屬性爲「marseille」,點擊時的目標動作爲「balloonFlyto」。
這裏是完整KML具有一個標鏈接到另一個:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>feature anchor</name>
<description>Feature anchor using ; to delimit action.</description>
<Placemark id="paris">
<name>Paris</name>
<description>
<![CDATA[
let's move to <a href="#marseille;balloonFlyto">Marseille</a>
]]>
</description>
<Point>
<coordinates>2.3508,48.8567</coordinates>
</Point>
</Placemark>
<Placemark id="marseille">
<name>Marseille</name>
<description>
<![CDATA[
Welcome to Marseille.
Return to <a href="#paris;balloonFlyto">Paris</a>
]]>
</description>
<Point>
<coordinates>5.37,43.2964</coordinates>
</Point>
</Placemark>
</Document>
</kml>
在彈出描述氣球目標HREF可以是片段的URL(即,以#符號接着是KML標識符的URL )。您還可以附加到URL的行動,以分號(;)和這些限定詞之一:
- 一個FlyTo(默認) - 飛到該地圖
- 氣球 - 打開特徵的氣球,但不飛到該地圖
- balloonFlyto - 打開特徵的氣球和KML reference飛到該地圖上面
摘錄。
這是谷歌地圖嗎?或僅在Google地球中使用?或兩者? – geocodezip
KML可用於兩者。 –
是的,但Google地圖僅支持KML的一個子集,具體目標將決定您的選項。 – geocodezip