I have a Google Maps V3 polyline. I can detect click events on the entire polyline, but can I do anything more advanced with the click event?
What I'd like to do is detect which section of the polyline has been clicked, and show this in an alert.
routePath = new google.maps.Polyline({
path: routeCoordinates,
strokeColor: "#CC33FF",
strokeWeight: 3
});
routePath.setMap(map);
google.maps.event.addListener(routePath, 'click', function() {
alert(routePath);
// TODO: display which section of the polyline has been clicked?
});
Does anyone know how to do this in Google Maps?
thanks!