Labelling Lines on Google Earth

6,535 views
Skip to first unread message

maehhheeyy

unread,
Apr 15, 2008, 5:25:26 PM4/15/08
to KML Developer Support - Getting Started with KML
How do I label my lines on Google Earth? I already have my lines
showing but I don't know how I can label it. Also how do I label it at
a specific spot without being placed at a random location?
Thanks.

barryhunter [KML Guru]

unread,
Apr 15, 2008, 5:35:36 PM4/15/08
to KML Developer Support - Getting Started with KML
You can use <MultiGeometry> to add a <Point> to your line, then an
Icon and/or Label will be displayed at that point (you can suppress
either with <Style>) - they label will be 'right way up' not written
along the line like the inbuilt road layers.

maehhheeyy

unread,
Apr 15, 2008, 6:31:37 PM4/15/08
to KML Developer Support - Getting Started with KML
Is there a specific code I can use?
> > Thanks.- Hide quoted text -
>
> - Show quoted text -

mwill

unread,
Apr 15, 2008, 8:40:22 PM4/15/08
to KML Developer Support - Getting Started with KML


Just an example I threw together using samples from the KML
documentation:

<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>SF Marina Harbor Master</name>
<visibility>0</visibility>
<Style id="style1">
<IconStyle>
<Icon></Icon>
</IconStyle>
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
<LineStyle>
<color>7f0000ff</color>
<width>4</width>
</LineStyle>
</Style>
<Placemark>
<name>This is the Name of the Line</name>
<styleUrl>#style1</styleUrl>
<MultiGeometry>
<Point>
<coordinates>-122.442712,37.806649,0</coordinates>
</Point>
<LineString>
<!-- north wall -->
<coordinates>-122.4425587930444,37.80666418607323,0
-122.4428379594768,37.80663578323093,0</coordinates>
</LineString>
<LineString>
<!-- south wall -->
<coordinates>-122.4425509770566,37.80662588061205,0
-122.4428340530617,37.8065999493009,0</coordinates>
</LineString>
</MultiGeometry>
</Placemark>
</Document>
</kml>

ManoM

unread,
Apr 15, 2008, 10:24:18 PM4/15/08
to KML Developer Support - Getting Started with KML
There's a great tool that might be helpful, allowing you to create
text based images on the ground:
http://ec.geoblogspot.com/GELab/ecLabel.htm

The GroundOverlay created will be an image that keeps it's position.
Labels on points move around based on your camera position.

Mano

maehhheeyy

unread,
Apr 29, 2008, 5:18:27 PM4/29/08
to KML Developer Support - Getting Started with KML
I just realized that I want the text label to rotate and move because
my lines would be moving and I want it to have it move along with it
and not lose its place. Is there a more easier way?
> > </kml>- Hide quoted text -

ManoM

unread,
Apr 29, 2008, 6:35:46 PM4/29/08
to KML Developer Support - Getting Started with KML
Hi maehhheeyy,

You can't really do that with KML. You could try to do a NetworkLink
with a view based refresh, but I suspect the performance would not be
what you wanted.

You could try using Regions to create new labels close to where you
want them to be when the view port moves. It's a lot of work though:

http://code.google.com/apis/kml/documentation/regions.html

Mano

EagleEye

unread,
Aug 10, 2012, 10:18:55 AM8/10/12
to kml-support-g...@googlegroups.com
Line Lable

The first is a change to the way line labels are displayed. Labels are now turned off by default in Google Earth 6.1, but you can add them at the midpoint of regular lines by using the new <gx:labelVisibility> in a <LineStyle>. Here's an example KML,
Or use following link for detail document http://www.gearthblog.com/blog/archives/2011/09/

Thanks,
Reply all
Reply to author
Forward
0 new messages