1
votes

I'm working on a project (web application) kind of a trip planner which uses maps to show directions (driving) for the users which they enter destinations of their trip. and I'm using Mapbox web services to do this. What I'm trying to do is get the directions for user input which was entered early stage and plot it on a mapbox map.

I know how to get the directions calling the api directly, but I'm having hard time for show this data on a map, I know there is this directions.js which is a pulgin for mapbox but I dont understand how to implement it.

and is there a better or easy way to achieve this. thanks in advance

Mapbox Directions api

Leaflet plugin for the Mapbox Directions API

1
What wrong with the working example on the Mapbox site? mapbox.com/mapbox.js/example/v1.0.0/mapbox-directions As is, your question is very thin. What did you try? What problems did you encounter, Any code or any errors? See: stackoverflow.com/help/how-to-ask - iH8
Hi, there is nothing wrong with the example. what I don't get is how to plot/show responses I get using directions api on a mapbox map. - Tharindu

1 Answers

2
votes

Check out this code example which does example what you want:

https://www.mapbox.com/mapbox.js/example/v1.0.0/mapbox-directions/