Search code examples
google-maps-api-3routeslatitude-longitudedirection

How to get lat long from dragable route by google map api


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


Solution

    1. Use the dragend event.
    2. Add a listener to the route
    3. when the dragend event fires get the points out of the route.

    Example of how to iterate through the coordinates in a dragged route (look at the getPolylineXml function)