Select polygon on click using kml

I am using kml file to draw polygons on google map. I set up click events for those polygons that work. Now I want the clicked polygon to be selected. I tried setOption () method but it didn't work. Is it possible to change the color of a polygon when clicking on it?

0


source to share


2 answers


If you are using KmlLayer (guess) you cannot change the polygon properties. If you are using a third party KML parser like geoxml3. Here is a link to that. http://developers.cloudmade.com/projects/web-maps-api/examples/kml-and-geo-rss



+1


source


If you are using KmlLayer (guess) you cannot change polygon properties. If you are using a third-party KML parser like geoxml3 or geoxml-v3 to render polygons as native Google Maps API v3 objects, you can change their properties (but whether performance is acceptable depends on how complex your KML is). You can also dynamically modify polygons in tiles created with FusionTablesLayer (import your KML into Fusion Tabel).



An example of changing the color of polygons from KML displayed with geoxml3 on hover

+2


source







All Articles