views:

17

answers:

1

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?

A: 

Hi,

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.

http://yoursite.com/image.php?text=subtitle-text

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

Fraser
So I guess the answer is no. Thanks for the link to the Chart API example.
pr1001
No worries, the Chart Api at least allows you to solve the issue programmatically - another approach could be to use KmlBalloons that are not connected to any particular KmlFeature, these can be positioned and then any content displayed in them...again maybe not ideal but certainly an option....
Fraser