mapbox / mapbox/mapbox-gl-directions

Get more annotations

Open
#306 0 comments 0 reactions 0 assignees View on GitHub
auto-triaged question
Dominant language
JavaScript
Stars
255
Forks
130
PR merge metrics
No merged PRs in 30d

Description

Hey guys,

I've been taking a look at the Directions API docs and some annotation params caught my attention, but I'm not able to return some of them using the mapbox-gl-directions plugin in a React application. So I came here and spend some time to study the plugin docs, I use this reference: https://github.com/mapbox/mapbox-gl-directions/blob/master/API.md#mapboxdirections .

From what I understand the only params that can be returned using the mapbox-gl-directions plugin is the congestion, is that right? Do I have any other params that I can get, how do I do that?

The way I'm doing it is this:

` const directions = new MapboxDirections({
accessToken: process.env.REACT_APP_TOKEN_MAP_BOX,
unit: 'metric',
profile: 'mapbox/driving',
geometries: 'linestring',
controls: {
inputs: false,
instructions: false,
profileSwitcher: false
},
congestion: true,
annotations: 'congestion,distance,duration,speed'
})`

If you have any tips for me to get the congestion, distance, duration and speed params from the route please tell me!

Contributor guide

Open the contributing guide

Research direction

Start with the API.md MapboxDirections reference and the configuration shown in the issue, then compare the plugin's annotation options with the Directions API documentation. Determine which requested values are supported and how they are exposed in the returned route; document the result or identify the missing plugin support.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.