Hi there, sort of a 2 part question here.
Regarding KML data imports, i haven't been able to get Placemark <PolyStyle> elements to work. It's seems <styleUrl>'s work but manual <style> tags to not. Take for example:
<Style id="defaultStyle"> |
<LineStyle> |
<color>ffffffff</color> |
<width>2</width> |
</LineStyle> |
<PolyStyle> |
<color>99ff6600</color> |
<outline>1</outline> |
<fill>1</fill> |
</PolyStyle> |
</Style> |
<Placemark> |
<Style> |
<LineStyle> |
<color>ffffffff</color> |
<width>3</width> |
</LineStyle> |
<PolyStyle> |
<color>99ff6600</color> |
<outline>1</outline> |
<fill>1</fill> |
</PolyStyle> |
</Style> |
<name>Name</name> |
<description>Desc</description> |
<Polygon> |
<altitudeMode>clampToGround</altitudeMode> |
<outerBoundaryIs> |
<LinearRing> |
<coordinates> |
(Some coordinates defining a region) |
</coordinates> |
</LinearRing> |
</outerBoundaryIs> |
</Polygon> |
</Placemark> |
<Placemark> |
<styleUrl>#defaultStyle</styleUrl> |
<name>Name</name> |
<description>Desc</description> |
<Polygon> |
<altitudeMode>clampToGround</altitudeMode> |
<outerBoundaryIs> |
<LinearRing> |
<coordinates> |
(some other coordinates) |
</coordinates> |
</LinearRing> |
</outerBoundaryIs> |
</Polygon> |
</Placemark> |
Only the 2nd Placemark actually get a style applied.
My other related question is once these shapes are imported, is there a way to change their style dynamically. I'm basically trying to import these regions and change their <PolyStyle> so I can change their background fill color on the map (and transparency level if possible).