I’m quite new to programming Google Earth with KML but I’ve been asked to look into showing subtitles on top of a Google Earth fly-through. I see that there are several types of overlays, but they all seem to assume an image. ScreenOverlay looks like the best bet, as the imagine is displayed relative to the screen, not the globe, but that would still require me to convert each segment of text into an image – possible, but not pretty. Is there a better alternative?
Share
One simple way to solve this is to use some kind of text-to-image cgi script.
For example, rather than referencing an image url you pass the script url along with a text argument. e.g.
The script would then dynamically generate the image and serve it up. If you employ some caching on the server you can make sure that an image is only generated once so that any further calls with the same argument simply serve the pre generated image.
There are plenty of ways to do this – google even provides an API for it!
http://groups.google.com/group/google-chart-api/web/chart-type-for-text-with-outline
For example:
http://chart.apis.google.com/chart?chst=d_text_outline&chld=FFBBBB|16|h|BB0000|b|Hello%20Word