Tuesday, November 27, 2007

Hiding Text Descriptions

From a fellow Googler: you can hide the text description of a placemark in the Places pane in Google Earth by using the <Snippet> element of KML. Read more in the KML documentation.

This <Snippet> element allows you to control how many lines of the text in a placemark description box is displayed in the Places pane. The default value is two lines. You can increase this by using this syntax:

<Snippet maxLines="X">

or you can hide all the text by using this syntax:

<Snippet></Snippet>

Note this tag must be inserted inside the element of your KML file:

<Placemark>
<name>Moby Arena</name>
<Snippet></Snippet>
<description>Moby Arena

http://csurams.cstv.com/facilities/csu-facilities.html</description>

3 comments:

Michael said...

KML is CASE SENSITIVE.

Placemark has a big "P"
Snippet has a big "S"
maxLines has a big "L"

Ch@rlie T@i said...
This comment has been removed by a blog administrator.
Unknown said...

To be clear, you have to add the Snippet element with a text editor, which means you have to export the placemark as .kml, edit it to add the Snippet element, then you can open it again in GE.

It's a good idea to create a template placemark (call it noDescription), and then in GE you can copy/paste it as needed. (there's a few other steps to do this copy/paste easily/effectively).