Is it possible during dragable routing we can get latitude and longitude value along the routing way
If it have please leave me a link or solution
Thank for help
Is it possible during dragable routing we can get latitude and longitude value along the routing way
If it have please leave me a link or solution
Thank for help
Example of how to iterate through the coordinates in a dragged route (look at the getPolylineXml function)
See my example to get LatLng for all points in route
directionsRenderer.addListener("directions_changed", function() {
var lat = [];
var lng = [];
result = directionsRenderer.getDirections()
var myroute = result.routes[0];
for (var i = 0; i < myroute.legs.length; i++)
{
//console.log(myroute.legs[i].start_location.lat())
lat[i] = myroute.legs[i].start_location.lat();
lng[i] = myroute.legs[i].start_location.lng();
}
i=myroute.legs.length-1;
lat[i+1] = myroute.legs[i].end_location.lat();
lng[i+1] = myroute.legs[i].end_location.lng();
console.log(lat)
console.log(lng)
});