您可以从一个标链接到在一个引用其他说明另一个使用特殊的联系。该机制在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