在 KML 描述中添加 FlyTo 链接
我试图指定地标的描述以具有指向另一个地球位置的超链接,但不具有指向另一个地标的超链接。当点击链接时,我只想飞到地球上的那个位置。我不知道该怎么做。我尝试了以下 KML 标签的变体,但没有成功。该链接出现在气球描述中,但不会更改视图或执行飞达操作。这可以做到吗?下面的示例包括 MGRS 位置,Google 地球的搜索栏可以识别该位置。
<Placemark>
<name>Untitled Placemark</name>
<description><![CDATA[<a href="18S UH 27103 98673;flyto">Click Me</a>]]></description>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Point>
<altitudeMode>clampToGround</altitudeMode>
<gx:altitudeMode>clampToSeaFloor</gx:altitudeMode>
<coordinates>-76.99418723939422,48.82106388888889,0</coordinates>
</Point>
</Placemark>
I'm trying to specify a Placemark's description to have a hyperlink to another earth location, but not to another placemark. When the link is clicked, I simply want to fly to that location on the earth. I'm not sure how to do this. I've tried variations on the following KML tag below, but to no avail. The link appears in the balloon description, but doesn't change the view or do a flyto. Can this be done? Example below includes an MGRS position, which Google Earth's search bar understands.
<Placemark>
<name>Untitled Placemark</name>
<description><![CDATA[<a href="18S UH 27103 98673;flyto">Click Me</a>]]></description>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Point>
<altitudeMode>clampToGround</altitudeMode>
<gx:altitudeMode>clampToSeaFloor</gx:altitudeMode>
<coordinates>-76.99418723939422,48.82106388888889,0</coordinates>
</Point>
</Placemark>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要另一个包含该位置的 Kml 文件,如下所示的内容应该可以工作。创建以下文件。
将该文件保存到公共服务器(例如“http://yourserver.com/your.kml”),然后只需链接到该文件并指定 Flyto 行为即可。
如果您使用 ID 将其他 LookAt 元素添加到文件中,则可以使用片段标识符指定要引用的外观。 IE
You would need another Kml file that contains the location, something like the following should work. Create the following file.
Save that file to a public server (e.g "http://yourserver.com/your.kml") then simply link to that file and specify the Flyto behaviour.
If you add additional LookAt elements to the file with IDs then you can specify which look at to reference using the fragment identifier. i.e.