Place Label inside county boudries.

158 views
Skip to first unread message

NP

unread,
Feb 11, 2009, 3:20:16 PM2/11/09
to KML Developer Support - Getting Started with KML
Hi,

I have kml file which show county boudry with blue color inside google
map.

Now I want to show name of that county on that block.
Rightnow you have to click on block and then you will see county name
in popup window. Instead of this I want to show lable on county block
instead of click action or mouse hover action.

Can it be possible?

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Placemark id="1">
<name>Cook
</name>
<description><![CDATA[
<br>
]]></description>
<Style>
<PolyStyle>
<color>7FFF0000</color>
<fill>1</fill>
<outline>1</outline>
</PolyStyle>
<LineStyle>
<color>FFFFFFFF</color>
<width>1</width>
</LineStyle>
</Style>
<Polygon>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>.......</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</kml>

Matt Fox

unread,
Feb 11, 2009, 11:37:22 PM2/11/09
to KML Developer Support - Getting Started with KML
Check out

http://blog.geoblogspot.com/

and

http://applications.geoblogspot.com/

There are some applications there that might do what you are trying to
do.

Also, check posts by Valery35 at the GE BBS under the Dynamic Layers
forum. Seems like I remember several months ago a tool that would
essentially take text and automatically turn it into an overlay to
display on the surface in Google Earth. The BBS is down at the
moment, so not sure of exact post.

Matt

fooswolf

unread,
Feb 12, 2009, 4:31:09 PM2/12/09
to KML Developer Support - Getting Started with KML
I had a similar problem when using the Google Export from Mapinfo.
The only way I could get the labels for the counties
is to put a text label in the Cosmetic layer for each county formated
and placed where I wanted them and then export to kml.
This is useful to get the county names and the proper coordinates.
Note the names are just pushpins with no icon displayed.
In MapInfo I exported the county borders to KML and combined into a
single file. For the two counties in northern California
I show an example below. First I created two icon styles (no icon,
yellow pushpin), then I create to placemarks to create the
County names. The final folder (incomplete as shown) is where you
would place the geometric coordinate data describing the
County borders. Also make sure the default Borders/2nd Level Admen
Regions (Counties) that comes with Google Earth
does not meet your needs.
______________________________________________________________________________________________________
?xml version="1.0" encoding="Windows-1252"?>
<kml xmlns="http://earth.google.com/kml/2.1">

<Document>
<name>California Counties with Names.KML</name>
<Style id="sn_noicon"><IconStyle><Icon></Icon></
IconStyle><LabelStyle><color>ffff0000</color><scale>0.7</scale></
LabelStyle><ListStyle></ListStyle></Style>
<Style id="sn_ylw-pushpin">
<IconStyle><scale>.7</scale><Icon><href>http://maps.google.com/
mapfiles/kml/pushpin/ylw-pushpin.png</href></Icon></IconStyle>
<LabelStyle><color>ffff0000</color><scale>0.7</scale></LabelStyle>
<LineStyle><color>ff00ffff</color></LineStyle>
</Style>

<Folder>
<name>California County Names.KML</name>
<open>1</open>
<description>California County Names></description>
<Style><ListStyle><listItemType>check</
listItemType><bgColor>00ffffff</bgColor><maxSnippetLines>2</
maxSnippetLines></ListStyle></Style>

<Placemark>
<name><![CDATA[Del Norte]]></name>
<description><![CDATA[<br><br><br><table border="1"
padding="0"><tr><td>Id</td><td>0</td></tr>]]></description>
<styleUrl>#sn_noicon</styleUrl>
<Point><extrude>1</
extrude><altitudeMode>relativeToGround</
altitudeMode><coordinates>-123.921199,41.818806,0</coordinates></
Point>
</Placemark>
<Placemark>
<name><![CDATA[Siskiyou]]></name>
<description><![CDATA[<br><br><br><table border="1"
padding="0"><tr><td>Id</td><td>0</td></tr>]]></description>
<styleUrl>#sn_ylw-pushpin</styleUrl>
<Point><extrude>1</
extrude><altitudeMode>relativeToGround</
altitudeMode><coordinates>-122.642833,41.738708,0</coordinates></
Point>
</Placemark>
</Folder>

<! IF YOU WANT TO TEST THE CODE ABOVE DELETE THE FOLDER BELOW WHICH IS
WHERE YOU WOULD PLACE THE DATA FOR THE COUNTY BORDERS>
<Folder>
<name>California County Borders</name>
<description>California County Borders></description>
<Placemark>
<name><![CDATA[Del Norte County]]></name>
....blah blah coordinates blah blah ....
</Placemark>

<Placemark>
<name><![CDATA[Siskiyou County]]></name>
....blah blah coordinates blah blah ....
</Placemark>
</Folder>

</Document>
</kml>

Dan

American Indian Resource Program

unread,
Apr 6, 2009, 2:47:56 PM4/6/09
to KML Developer Support - Getting Started with KML
I am working on a resource guide map for California. I would like to
break it down by counties, yet I have not been able to find the KML or
layer for counties. I would like to use this with Google Maps. Would
it be possible to use your California Counties KML polygon
coordinates? If possible, please feel free to let me know, I would be
sure to give you credit for your work. Take care...

//Nikishna

fooswolf

unread,
Apr 6, 2009, 5:10:51 PM4/6/09
to KML Developer Support - Getting Started with KML
I uploaded a file named "California Counties.kmz" to the web page
below.
http://groups.google.com/group/kml-support/files
After downloading the file it should open in Google Earth and you can
edit
and create county labels or delete the few current ones. Hope that
helps.

Dan
Reply all
Reply to author
Forward
0 new messages