Reputation: 87
I have a KMl file with some multigeometries. When I import this KML file in Google Earth it looks like this image.
But when I Import same KML in Google Map is shows Like This
In Place of Lable it shows default blue color icon.
this is My Sample KMl for One Multigeomety
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2"><Document><Style id="Yellow"><IconStyle><scale>0</scale></IconStyle><PolyStyle><color>6414F0FF</color></PolyStyle></Style><Placemark><styleUrl>#Yellow</styleUrl><name>0,15</name><MultiGeometry><Point><coordinates>-97.04983000000001,32.81053</coordinates></Point><Polygon><outerBoundaryIs><LinearRing><coordinates>-97.05083000000002,32.81083 -97.04667,32.81083 -97.04667,32.8075 -97.05083000000002,32.8075 -97.05083000000002,32.81083</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark></Document></kml>
I have already googled so many time, Please help on this.
Upvotes: 4
Views: 1365
Reputation: 23748
Google Maps has issues with MultiGeometry placemarks.
If want label from the point and use Polygon then best to have separate placemark for Point with LabelStyle/IconStyle and another for the Polygon. Google Earth has no such issue with MultiGeometry features.
UPDATE: Using Google Maps KmlLayer does not allow the label names to appear on the map - label only appears when click on placemark icon. If you want to stay with Google Maps then you might try geoxml3 library to parse the KML then enumerate the placemark and create Markers using Google Maps API. Alternately, can use Openlayers or Cesium to parse KML and display correctly.
Upvotes: 3