问题
My polygons are loaded dynamically from a .kml file using KMLLayer.
I need these polygons (on click) to link to a page.
Can anyone advise me or provide a solution please?
Thanks!
回答1:
You can just simply add a listerer to the polygon.
var polygon = google.maps.Polygon(....);
polygon.addListener('click', function(){
});
Polygon reference
回答2:
If i'm not mistaken i think that features loaded from kml cannot have listeners attached to them.Please take a close look here
来源:https://stackoverflow.com/questions/5067534/how-do-i-monitor-for-clicks-on-polygons-with-google-maps-api-v3