mapbox / mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/
ISC License
235 stars 124 forks source link

Get duration, distance and weight-name to calculate further #290

Open Lenn1K opened 1 year ago

Lenn1K commented 1 year ago

Hey folks,

Absolute beginner with APIs in general and more so with Mapbox here. I'm a student develoving a web-app for school and i'm using Mapbox GL JS with the directions plugin to calculate a route. I now would love to get the values of "weight-name", "distance" and "duration" to make some calculations in my app. How can i get these? Is there for example a function that returns the response JSON back to me? Any nudge in the right direction is much appreciated, thanks in advance!