Text Overlay in Google Earth KML

末鹿安然 提交于 2020-01-11 06:24:13

问题


I would like to add a date/time that the KML file was last updated to be displayed as an overaly in Google Earth, is there anyway this could be done?

I would be looking at updating text in a KML file and then this being displayed in google earth.

Many Thanks.


回答1:


One trick is using the Google Chart API to dynamically create images from text and using that as a screen overlay image in Google Earth.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <ScreenOverlay>
        <Icon>
            <href><![CDATA[http://chart.apis.google.com/chart?chst=d_text_outline&chld=FFBBBB|16|h|BB0000|b|Hello%20Word]]></href>
        </Icon>
        <overlayXY x="0.8" xunits="fraction" y="0.8" yunits="fraction"/>
        <screenXY x="0.8" xunits="fraction" y="0.8" yunits="fraction"/>
    </ScreenOverlay>
</kml>

A screen overlay with embedded images is used in the Paleoglobe KML: http://www.geology.sdsu.edu/kmlgeology/kmz/paleoglobe/paleogeography.kmz

There are many websites that create images out of text for labels which you embed in a KMZ file and refer to from you KML.

Also, if you want text to appear as a label on the ground at a fixed location then you can use same trick with a GroundOverlay or simply create a Placemark with a name (which is shown on map at that location) and a Style suppressing the icon.



来源:https://stackoverflow.com/questions/20844076/text-overlay-in-google-earth-kml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!