styles replacing

1 view
Skip to first unread message

Vad

unread,
Dec 1, 2009, 12:39:07 AM12/1/09
to KML Developer Support - Getting Started with KML
Hi,
Just a simple question:
This is my kml file:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://
www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>_saved.kml</name>
<Style id="sm_Polygon_Style">
<PolyStyle>
<fill>0</fill>
</PolyStyle>
</Style>
<Placemark>
<name>name</name>
<description>desc</description>
<styleUrl>#sm_Polygon_Style</styleUrl>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
41.99069023132341,45.02331056301949,0
42.01446533203141,45.01190407514222,0
42.04939842224137,45.02221855083926,0
42.02596664428727,45.03629177860115,0
42.05248832702653,45.04387290222881,0
42.00493812561052,45.05230193214075,0
41.99069023132341,45.02331056301949,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>


It's OK, but after that I load, edit polygon in Google Earth and save
it, I get the next:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://
www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>_saved_GE.kml</name>
<Style id="sn_ylw-pushpin">
<PolyStyle>
<fill>0</fill>
</PolyStyle>
</Style>
<Placemark>
<name>name</name>
<description>desc</description>
<styleUrl>#sn_ylw-pushpin</styleUrl>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
41.99069023132341,45.02331056301949,0
42.01446533203141,45.01190407514222,0
42.04939842224137,45.02221855083926,0
42.02596664428727,45.03629177860115,0
42.05248832702653,45.04387290222881,0
42.00551020015333,45.03500403154767,0
41.99069023132341,45.02331056301949,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>

WHY is my style changing from "sm_Polygon_Style" to "sn_ylw-
pushpin"???
How to avoid that?
Please, help!

Thanks,
Vad

Maarten L

unread,
Dec 1, 2009, 4:26:07 PM12/1/09
to KML Developer Support - Getting Started with KML
If you edit a kml file in Google Earth, GE will change the names of
your style and add more styles to it. To avoid this, just edit your
kml in a text editor.

On Dec 1, 6:39 am, Vad wrote:
> Hi,
> Just a simple question:
> This is my kml file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"
> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"

Jason M

unread,
Dec 3, 2009, 2:25:00 PM12/3/09
to KML Developer Support - Getting Started with KML
Note there's an implicit StyleMap being used under the covers with
"sn_" prefix for normal styles and "sh_" for a highlighted style.

--j
Reply all
Reply to author
Forward
0 new messages