How can I label polygon and polyline kmls?

4,030 views
Skip to first unread message

Ben Hallowell

unread,
Feb 27, 2008, 9:42:17 PM2/27/08
to KML Developer Support - Getting Started with KML
Does anyone have an easy way to label polygon or polyline kmls? I
have absolutely no knowledge\experience with writing codes of any
sort. An interactive solution would be great, aka pointing and
clicking with the mouse rather than adding lines of code to the kml.
For example I am trying to label a bunch of roads that I have in a
kml, I want to label them so that the labels appear as they do for the
road labels on the roads built into Google Earth.
Thanks for any help that anyone can provide!

ManoM

unread,
Feb 28, 2008, 3:54:24 PM2/28/08
to KML Developer Support - Getting Started with KML
Hi Ben,

There's no easy way to do this and no good way either. Those labels on
our roads are actually baked into the imagery, not loaded with KML.
This isn't an option for you in Google Earth, unless you want to start
putting in GroundOverlays with the images in them, or use Google Earth
Enterprise, a significantly higher end (and therefore cost) product.

One thing you could do is create LineString and a Point in a
<MultiGeometry>, and place the <Point> element along the line. You
would then give the IconStyle a scale of 0, so that it doesn't show
up. Here's an example:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<Style id="myStyle">
<IconStyle>
<scale>0</scale>
</IconStyle>
</Style>
<Placemark>
<name>My Path</name>
<styleUrl>#myStyle</styleUrl>
<MultiGeometry>
<LineString>
<tessellate>1</tessellate>
<coordinates>
-107.0303781250365,30.27056500199735,0
-106.6109752769761,30.27616399690955,0
-106.0800016002764,30.25957244616284,0 </coordinates>
</LineString>
<Point>
<coordinates>-106.6109752769761,30.27616399690955,0</coordinates>
</Point>
</MultiGeometry>
</Placemark>
</Document>
</kml>

ManoM

Ben Hallowell

unread,
Mar 3, 2008, 9:18:14 PM3/3/08
to KML Developer Support - Getting Started with KML
Rats, I was hoping there was an easy way. Thanks for getting back to
me though!

Prst J

unread,
May 30, 2013, 5:53:41 AM5/30/13
to kml-support-g...@googlegroups.com
How do you do this programatically ? I have like a thousands polygon to be given a label...

thanks
Reply all
Reply to author
Forward
0 new messages