display polygon labels without icons

2,444 views
Skip to first unread message

Bryan Keith

unread,
Apr 18, 2007, 10:26:01 AM4/18/07
to KML Support - Getting Started
I have searched around, and I sure can't figure out how to get text
labels on my polygons without displaying an icon as well. Displaying
a label and icon is easy. Google Earth has separate names layers,
e.g. 1st Level Admin Borders (the polygons) and 1st Level Admin Names
(the text labels). I want to do that.

Below I've pasted part of the kml that I'm working with.

Bryan

<Style id="uwc">
<LineStyle>
<color>ff000000</color>
<width>2</width>
</LineStyle>
<PolyStyle>
<color>7d37d9f0</color>
<fill>0</fill>
</PolyStyle>
<LabelStyle>
<color>ff0000cc</color>
<colorMode>random</colorMode>
<scale>1.5</scale>
</LabelStyle>
</Style> <Folder><name>uwc_prop5</name>
<!--<Placemark>
<name>Granite Peak</name>
<Point><coordinates>-112.811550053637,38.3648831059691,0</
coordinates>
</Point>
</Placemark> -->
<Placemark>
<name>Granite Peak</name>
<styleUrl>#uwc</styleUrl>
<Point><coordinates>-112.811550053637,38.3648831059691,0</
coordinates>
</Point>
<description><![CDATA[
<b>name:</b> <i>Granite Peak</i><br />
<b>region:</b> <i>Great Basin</i><br />
<b>cluster:</b> <i>Granite Peak</i><br />
<b>uwc_prop:</b> <i>1</i><br />
<b>polygonid:</b> <i>978</i><br />
]]></description>

<Polygon><outerBoundaryIs><LinearRing><coordinates>-112.79530573055591,38.300175290995092
-112.79550125830539,38.300189182578286 ... so many coordinates....

barryhunter

unread,
Apr 19, 2007, 10:40:35 AM4/19/07
to KML Support - Getting Started
In your Style tag, just add a IconStyle:

<IconStyle>
<scale>0</scale>
</IconStyle>


That what you looking for?

Bryan Keith

unread,
Apr 20, 2007, 12:40:52 PM4/20/07
to KML Support - Getting Started
barryhunter,

Yes, that helps me out. Thank you. At first I wanted to include the
polygon and label in the same placemark, but now I think it might be
better to have them in separate folders and separate placemarks so the
user can turn off the labels only if desired (just GE does with the
1st Level Admin Borders).

Bryan

snowgecko

unread,
Apr 24, 2007, 5:47:12 PM4/24/07
to KML Support - Getting Started
Can you just take out the IconStyle tag altogether? is it still
trying to draw an icon?

barryhunter

unread,
Apr 25, 2007, 5:55:43 AM4/25/07
to KML Support - Getting Started
If you take out the IconStyle altogether (in fact likes Bryans first
example) then it defaults to showing an icon. So specifiying nothing
is the same as

<IconStyle>
<scale>1</scale>
</IconStyle>

Reply all
Reply to author
Forward
0 new messages