How to get all coordinates along the way of a direction in mapbox from point A to b?

439 Views Asked by At

As shown in the image We have a start and end point forming a route I need to get all the points(Lat,Lng) forming this route.

This is how I implemented the directions:

     var directions = L.mapbox.directions();

      var directionsLayer = L.mapbox.directions.layer(directions)
          .addTo(map);

      var directionsInputControl = L.mapbox.directions.inputControl('inputs', directions)
          .addTo(map);

      var directionsErrorsControl = L.mapbox.directions.errorsControl('errors', directions)
          .addTo(map);

      var directionsRoutesControl = L.mapbox.directions.routesControl('routes', directions)
          .addTo(map);

0

There are 0 best solutions below