Custom KmlLayer Icons

I have a website where a user of my community can import their KML file (exported from Earth from Google Maps) and display a map (for example, his favorite restaurants in Chicago). this part was fine and easy, but now I have set up the icons on the map and I don’t see how it is possible using KML files ...

is there any solution for this, maybe export / import another file instead of kml? Do google maps allow exporting results to json / xml?

+4
source share
1 answer

If you are trying to just change the label marker icons, you can simply set the label style to the style that contains the node icon.

<Style id="icon"> <IconStyle> <Icon> <href>http://path/to/your/icon.png</href> </Icon> </IconStyle> </Style> <Placemark> <name>Name</name> <description> hi </description> <styleUrl>#icon</styleUrl> <Point> <coordinates>...</coordinates> </Point> </Placemark> 

This will show the icon contained in this path for the marker, not the default.

+5
source

All Articles