0

Hi all This is the scenario:

  1. Have a KML layer with points of data, with description, if you click on marker it will popup description. KML layer added via: geoxml= new google.maps.KmlLayer('http://MYRURL',{preserveViewport:true});
    geoxml.setMap(map);

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

Problem: I can click (Green Arrow on image) and see data of description for points outside polygon but cannot (red arrows on image) of the ones geo-inside the polygon. I will like to see infowindows of those too, Poly AFAIK has no click listener.

I have tested setMap the KMLLayer before and after setMap of poly..

See attached image.
MAP with KML Layer and poly

thanks

neavilag
  • 609
  • 1
  • 8
  • 20

1 Answers1

2

Your kmllayer is getting the click event rather than the map which has the markers on it. Add the "clickable: false" option.

Like so:

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

Works in google maps api v3.

keza
  • 2,601
  • 2
  • 16
  • 10