Monday, December 04, 2006

Fancy Placemarks

If you have spent enough time in Google Earth, you have seen them. When you click on certain placemarks, balloons appear that feature stylized text, hyperlinks and even pictures. So how is this done?

Each placemark (or set of placemarks) is described in a KML file. Within the description of each placemark in the KML file, you can use HTML much in the same way you would if you were creating a web page. Background colors, tables, etc.

According to the KML tutorial:
The most important thing you need to know about authoring your own HTML in placemarks is the use of the tag. If you want to write standard HTML inside a tag, you really should put it inside a CDATA element. If you don't, the angle brackets will need to be written as entity references to prevent the Google Earth from parsing the HTML incorrectly. (This is a standard feature of XML applications and not unique to Google Earth.)
Read more about using descriptive HTML. Or you can see how others have done this by looking at the KML used in other placemarks (see my posting on 10/19). And of course, you can change the icon used by the placemark in the 3D viewer (learn more here).

7 comments:

Greg said...

Hi.

Have you ever tried to embed video into a google earth placemark? I want the video to play in the actual placemakr bubble (not launch a separate web browser). I tried to embed code from blip.tv and youtube, but no luck. I have not tried google videos yet...

I have had great success embedding videos in Google Maps, (cruzonby.com)but so far, none in Google Earth.

Any suggestions?

John said...

Hi Greg. At this time, embedded videos are not supported in Google Earth. However, this is certainly something we are considering.

What sort of videos would you like to display in the placemark balloons?

Greg said...

Hi John.

Well, I would like to have the ability to cut and paste the code from such places as blip.tv revver.com, youtube.com, google videos and the bunch into the Google Earth placmark.

The videos from these sites are .flv videos mostly, so .flv videos would be great!

The closest I have gotten to embedding videos is quicktime movies from blip.tv. They have a "display in popup window" code that launchs a new browser. It works, as a new browser is launched, but I would rather have the movie displayed in the bubble placemark.

John said...

A fellow Googler reminds me that a better guide to the description tag can be found here:

http://tinyurl.com/y9zj9x

Fröken Anna said...

Hi John,
I´m wondering how I can set a "timetag" to a kml/kmz. I was looking at "the London Timeline" (http://bbs.keyhole.com/ubb/showflat.php?Number=623256) for GE and they must have some sort of information in the kml which tells GE when the house was built/demolished. I would like to add timetags to previously made maps and houseplans so that they appear in GE in the right era depending on where the timeslider lever is positioned.
Anna

Tinus le Roux said...
This comment has been removed by the author.
Tinus le Roux said...
This comment has been removed by the author.