Unable to click point from KML if inside Polygon

Hello everyone. This is the scenario:

  • You have a KML layer with data points, with a description, if you click on the marker, it will be a pop-up description. KML level added via: geoxml = new google.maps.KmlLayer (' http: // MYRURL ', {preserveViewport: true}); geoxml.setMap (map);

  • You have a polygon made with an array of angles directly on the map with poly = new google.maps.Polygon ({paths: polyCoords, strokeColor: "# 0000FF", strokeOpacity: 1, strokeWeight: 2, fillColor: "# FF0000", fillOpacity : 0.2});

Problem: I can click (the green arrow on the image) and see the description data of the points outside the polygon, but cannot (the red arrows on the image) those that are inside the polygon. I will also like the infowindows of them, Poly AFAIK does not have a click listener.

I tested setMap KMLLayer before and after setMap poly.

See attached image.
MAP with KML Layer and poly

thank

0
source share
1 answer

Your kmllayer receives a click event, not a map that has markers on it. Add the "clickable: false" parameter.

Same:

new google.maps.KmlLayer('http://MYRURL',{preserveViewport:true, clickable: false});

Works in Google Maps api v3.

+2
source

All Articles