I am trying to get the index of an edge in a polyline path, as it is written in the documentation . However, I get undefined values ββwhen I fire the click event on the polyline.
Here is my code: edge, path and vertex are all undefined
route = new google.maps.Polyline({
path: polyLineArray,
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 5,
clickable: true,
editable: false
});
google.maps.event.addListener(route, 'click', function(evt) {
console.log("route click1: " + evt.edge);
console.log("route click2: " + evt.path);
console.log("route click2: " + evt.vertex);
console.log("route click3: " + evt);
for(var property in evt) {
console.log("route click4: " + property + " - " + evt[property]);
}
}});
Am I missing something? Many thanks
source
share