I am using jquery-ui map plugin to manipulate some maps
I am using overlays from a kml file and afterwards I am adding a marker, my goal is to see in which overlay's territory the marker was added Any ideas? My code can be found here
I am using jquery-ui map plugin to manipulate some maps
I am using overlays from a kml file and afterwards I am adding a marker, my goal is to see in which overlay's territory the marker was added Any ideas? My code can be found here
Uses:
Based off of this Google Maps API v2 example, which was ported to the Google Maps API v3.
It's been tough to find, but here it is. You should use containsLocation , methods of poly* namespace. (poly).
Quoting #Neograph734
var polyOptions = {
...
}
draw = new google.maps.Polygon(polyOptions);
draw.setMap(map);
if(google.maps.geometry.poly.containsLocation(point, draw) == true) {
alert("yes");
}
See how-to-use-containslocation-in-google-maps-geometry-library
Please, note that polygons have events. So if in your actual application, the marker is added by the user, use the click event from the polygons (Polygon)