Using the snippet tag

1,613 views
Skip to first unread message

mcshea98

unread,
Jul 17, 2005, 12:25:00 AM7/17/05
to KML Discussions
I have been unable to see any change when using the snippet tag. Is this specific to the Enterprise Client (like the time function)? or am I not smart enough to get it to work (or realize that it is working)?

Can someone post an example where the snippet tag works?

Thanks.

p.s. The KML documentation didn't help me.

Quote:

<snippet>
A simple tag that causes a short description to be displayed in the GUI.
Values:
User defined.
Parents:
Contained by:
<Placemark>
Children:
None.




Here is my attempt:
Code:
 <?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<description>Snippet</description>
<name>Snippet</name>
<visibility>1</visibility>
<Placemark>
<snippet>This is supposed to appear where?</snippet>
<name>Placemark</name>
<visibility>1</visibility>
<Point>
<coordinates>-122.0856545755255,37.42243077405461,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

PenguinOpus

unread,
Jul 18, 2005, 9:36:33 AM7/18/05
to KML Discussions
We're investigating right now. There may be a recent regression in this area.

oneiros

unread,
Jul 19, 2005, 4:47:45 AM7/19/05
to KML Discussions
What is the <snippet> tag supposed to do? Should it replace a verbose <description> with a terse form in the Places tree? Actually, that would be really useful...

Hulk

unread,
Jul 21, 2005, 9:06:04 AM7/21/05
to KML Discussions
Personally I hope they add a way to disable the displaying of extra text in the places tree, wastes precious space.

PenguinOpus

unread,
Jul 21, 2005, 10:14:46 AM7/21/05
to KML Discussions
McShea,

Sorry to take so long on this, but... we've decided the documentation is currently wrong. Try "Snippet" instead of "snippet", it should work fine. We will fix the docs as soon as we can.

oneiros

unread,
Jul 21, 2005, 11:07:40 AM7/21/05
to KML Discussions
Yeah; <Snippet> seems to work, thanks.

However, as far as I understand the element naming convention used in KML, it should still be <snippet> with a lowercase 's' as it can't contain other elements. (Or can it?) Therefore it's not the documentation that's at fault but the GE client...

PenguinOpus

unread,
Jul 21, 2005, 11:15:15 AM7/21/05
to KML Discussions

You are basically correct, but since Snippet can have attribute "children", it was debated back-n-forth. If this were pre-beta, we'd probably change it, but given the installed based and a couple of transition problems, we're deciding to leave it as is.

mcshea98

unread,
Jul 22, 2005, 2:55:58 PM7/22/05
to KML Discussions
PenguinOpus,

Thanks for the update. This works better than I thought. Basically, If the <Snippet> tag is contained in a Placemark, Folder, or Document then the default first couple of lines of the <description> tags are no longer displayed in the "Tree" view (on the left hand side). The contents of the <Snippet> tag are displayed in its place; however, the <description> tag still populates the Balloon when the Placemark/ Folder/ Doc is selected.

Hulk,
If you want to get rid of all the description fields in your "Places" folder add an empty <Snippet> tag to all your Placemarks.
Code:
 <Snippet maxLines="0">empty</Snippet> 


The easy way to do this is with Find and replace in WordPad.
Find: <Placemark>
Replace with: <Placemark><Snippet maxLines="0">empty</Snippet>

mcshea98

unread,
Jul 23, 2005, 3:01:36 PM7/23/05
to KML Discussions
PenguinOpus (or Ink_Polaroid),

I have two questions:
1. What are the authorized Children of the <Snippet> tag?
2. Is the following the expected functionality (or is it a bug)?

In my previous post I stated that placing an empty <Snippet> tag inside a placemark would hide the description in the tree yet still properly display the balloon. However, if you insert '<Snippet></Snippet>' into your placemark, it basically renders the description tag useless. I believe this to be a bug, but maybe not.

Attached are a few examples.

p.s. If you look at the file, you will see the workaround.
50025-test.kml

mcshea98

unread,
Jul 23, 2005, 3:23:24 PM7/23/05
to KML Discussions
<Snippet>
A simple tag. Supplies a short description that appears only in the tree view. This replaces the normal tree display of the first two lines of the <description> tag; however, does not change the function of the balloon with respect to the <description> tag.

The <Snippet> element supports plain text as well as HTML formatting. See the <Description> tag for more information on CDATA features.


Values:
User-defined.

Parents:
Can be contained by:
<Document>
<Folder>
<NetworkLink>
<GroundOverlay>
<ScreenOverlay>
<Placemark>

Children:
None.

Other:
You can customize the verticle size of the <Snippet> tag by adding the "maxLines" property.
Ex.
<Snippet maxLines="5">This is your data ..... </Snippet>

jrohlf

unread,
Aug 13, 2005, 12:43:45 AM8/13/05
to KML Discussions
This is a bug. Thanks for the test case.

mcshea98

unread,
Aug 31, 2005, 7:44:45 PM8/31/05
to KML Discussions
Google Earth Team,

Thanks for fixing the Snippet tag. I see that you can use Code:
 <Snippet/> 


to completely surpress the short description in the tree view (left hand side). Is there any other new functionality?

Again, Thanks.

ZachMatthews

unread,
Feb 20, 2007, 8:36:39 AM2/20/07
to KML Discussions
Has this bug returned in the Mac version of Google Earth? I can get absolutely no Snippet functionality. My KML file starts with a linked img src tag, and I'm seeing the code in the Places description. Not desirable, but the <Snippet> tag does nothing.

Here's the code on the KML, which is for private sharing amongst friends:

<Snippet/>
<a href="http://www.itinerantangler.com"><img src="http://www.itinerantangler.com/earth/googleearthlogo.jpg"></img></a>
<br>
<br>
<img src="http://www.itinerantangler.com/earth/nancecarp.jpg"></img>
<br><small><strong>A Nance's Ferry Bonefish can provide hours of angling entertainment.</strong></small><br><br>
<strong>Nance's Ferry</strong> on the Holston River in East Tennessee is an erstwhile trout fishery, but it truly excels in summertime, when the "poor man's bonefish" go nosing up the shoals in droves. Bring an eight weight rod and a handful of bonefish flies and expect to feel some pullin'! From the public access, begin your hike up the trail to your left, through the woods. It will soon reach the shoal.
<br>
<br>
<small><strong>Interested? Want more information? Check out <a href="http://www.itinerantangler.com/cgi-bin/yabb2/YaBB.pl">The Itinerant Angler Board</a>.
<br>
<br>
<small><small>Photos copyright Zach and Lauren Matthews. All rights reserved.</small></small>

Thanks,
Zach

ManoM

unread,
Feb 20, 2007, 1:55:27 PM2/20/07
to KML Discussions
Hi Zach,

Is that exactly copied from your code? This:
Code:

<Snippet/>


opens and closes the Snippet in the same tag, leaving the rest of your code orphaned and ignored by GE. Your Snippet should read like this:

Code:


<Snippet>

<a href="http://www.itinerantangler.com"><img src="http://www.itinerantangler.com/earth/googleearthlogo.jpg"></img></a>
<br>
<br>
<img src="http://www.itinerantangler.com/earth/nancecarp.jpg"></img>
<br><small><strong>A Nance's Ferry Bonefish can provide hours of angling entertainment.</strong></small><br><br>
<strong>Nance's Ferry</strong> on the Holston River in East Tennessee is an erstwhile trout fishery, but it truly excels in summertime, when the "poor man's bonefish" go nosing up the shoals in droves. Bring an eight weight rod and a handful of bonefish flies and expect to feel some pullin'! From the public access, begin your hike up the trail to your left, through the woods. It will soon reach the shoal.
<br>
<br>
<small><strong>Interested? Want more information? Check out <a href="http://www.itinerantangler.com/cgi-bin/yabb2/YaBB.pl">The Itinerant Angler Board</a>.
<br>
<br>
<small><small>Photos copyright Zach and Lauren Matthews. All rights reserved.</small></small>
</Snippet>



ManoM
Reply all
Reply to author
Forward
0 new messages