Creating Compelling Google Earth Description Balloons

Posted on May 22, 2008. Filed under: Google Earth, KML |

In this post I’m going to cover the topic of creating compelling Google Earth description balloons for your placemarks. These descriptive balloons are a fantastic way of communicating information to your users, and can include HTML, text, images, videos, hyperlinks, and pretty much anything else that you would like to portray to users. Because of the diversity of content that can be included in a description balloon, they tend to make excellent teaching tools, and have been used as such by National Geographic, Greenpeace, Global Heritage Fund, Earthwatch, and many others.

KML for Balloons
We’ll start with some basic information about how these balloons are created in KML. Descriptive balloons are attached to Placemarks in Google Earth, and are displayed when clicked. The creation of a description balloon for a placemark is accomplished with the use of the <BalloonStyle> KML element. A <BalloonStyle> is a ‘type of’ or child of the <Style> element so it is common practice to define a balloon style within the context of a <Style>. Therefore, you could have something like this:


Notice that we are assigning an id of ‘sn_ywl-blank’ to the <Style> element. This is just a descriptive name that we’ll user later to refer back to this content. Inside <Style> we have our <BalloonStyle> element which contains the details of our balloon. For simplicity, we are only using the <text> element in this case. Now let’s cover the details of what can be included inside <BalloonStyle>.

The <BalloonStyle> element has a number of child elements that are used to control the content and display characteristics of the items including in our descriptive balloon. The background color <bgColor>, text color <textColor>, text <text>, and display mode <displayMode> can be used within <BalloonStyle>. The background color and text color elements are self explanatory, but the <text> element in particular deserves more attention.

The <text> element contains the content that will be displayed in the balloon. In the event that you do not specify any text, Google Earth will draw a default balloon with the feature name, feature description, links for driving directions, a white background, and a tail that is attached to the point coordinates of the feature. But we’re really not interested in the default behavior since we are pursuing the creation of informative, compelling description balloons.

Inside the <text> element you can embed HTML along with various entities that are used refer to a child element of the placemark. These entities include $[name], $[description], $[address], $[id], $[Snippet], and $[geDirections]. An example is in order here to more clearly explain this. In the code example below you’ll notice that the <text> element contains a $[description] entity.

What this means is that the description contained within the <description> element of a placemark will be substituted in this place and thus allowing for unique content associated with each placemark. This description can contain HTML, hyperlinks, images, and videos.

For example, in the image below I’ve right clicked on a placemark and selected Properties. The Description tab displays the content of the <description> tag inside a placemark. Click here to see the actual file. What you’re looking for is the <description> tag inside the <Placemark> element. You should also look for the <styleUrl> element toward the bottom of the file. This element contains the text ‘#sn_ylw-blank’ which is used to point back to the <Style> element that we defined earlier.

As I mentioned above, there are a number of other entities that you can add to the <text> element. The same concept applies for these entities. Each of these entities can be used to obtain the information stored in the corresponding element found on the placemark.

One other point should be made here. When embedding HTML inside the <text> element you can use a CDATA section to ensure that the parser will ignore your markup characters. Between the start and end of a CDATA section, all character data is passed directly to the application without interpretation as you can see in the example below.

Templates
At this point we’ve covered the basic elements that you’ll use to create descriptive balloons. However, if you’re like me and have little to no graphic design skills you’re probably wondering how to go about creating attractive content for your balloons. Fortunately, Google has provided a number of templates that we can use as a starting point. You can make copies from these templates and then add in your own text, images, and other content.

You can’t update the content of your description balloons in Google Earth so you’ll need to use a text editor or an HTML editor such as Dreamweaver or NVU. You can copy the HTML from the templates into your favorite editor, edit the content as necessary, and then replace the existing template code.

Other Cool Stuff – Adding YouTube Videos
In addition to being able to customize your description balloons by adding text, images, and hyperlinks you can also embed a YouTube video into your balloon. This Google Outreach tutorial will walk you through the process of adding YouTube videos to your descriptive placemark balloons.

Examples
The Global Awareness folder inside the Layer panel contains many examples of compelling placemark balloons that you can use as a guide when you begin developing your own content.

More Information
For detailed information about KML, Google Earth, or Google Maps please see the following e-learning courses provided by GeoSpatial Training Services.

Mastering KML in Google Earth
Dynamic Google Earth Applications
Introduction to the Google Maps API
Integrating ArcGIS Desktop and Google Earth

About these ads

Make a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

Follow

Get every new post delivered to your Inbox.

Join 47 other followers

%d bloggers like this: