开发者

How do I monitor for clicks on polygons with Google Maps API v3

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!


You can just simply add a listerer to the polygon.

var polygon = google.maps.Polygon(....);
polygon.addListener('click', function(){

});

Polygon reference


If i'm not mistaken i think that features loaded from kml cannot have listeners attached to them.Please take a close look here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜