kmllayer with polygons hide map

115 views Asked by At

Based on Google Map's KML Layers I have a kmllayer to load polygons from http://www.vis-it.com.ar/www/barrios08062015081002PM.kml

The map loads ok, but when load the klmlayer the map is hidden, all map_canvas are shown in blue and the polygons are rotated from its original position. Each same coord shows OK one polygon at the time, but the kml behaves that way. My kml is formatted from kmlreference documentation, and I tried with <Altitude> tags but the result is the same.

1

There are 1 answers

0
geocodezip On

You have your coordinates backwards in the KML.

KML coordinates are longitude,latitude[,altitude].

your kml on a map

snippet from it:

<Placemark>
<name>64 VIVIENDAS</name>
<visibility>0</visibility>
<Polygon>
<extrude>1</extrude>
<innerBoundaryIs>
<LinearRing>
<coordinates>
-29.766407681574762,-62.047154903411865,0
-29.76759976891944,-62.04902172088623,0
-29.769052606190985,-62.047669887542725,0
-29.766407681574762,-62.047154903411865,0
</coordinates>
</LinearRing>
</innerBoundaryIs>
</Polygon>
</Placemark>

fixed (reversed coordinates)

snippet from it:

<Placemark>
<name>64 VIVIENDAS</name>
<visibility>0</visibility>
<Polygon>
<extrude>1</extrude>
<innerBoundaryIs>
<LinearRing>
<coordinates>
-62.047154903411865,-29.766407681574762,0
-62.04902172088623,-29.76759976891944,0
-62.047669887542725,-29.769052606190985,0
-62.047154903411865,-29.766407681574762,0
</coordinates>
</LinearRing>
</innerBoundaryIs>
</Polygon>
</Placemark>