Text Overlay in Google Earth KML

耗尽温柔 提交于 2019-12-01 09:03:59

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.

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