mapbox / mapbox/mapbox-directions.js
How to minimize instruction panel in mapbox gl js but can also be reverted back by clicking a button? help
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 58
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
The instruction eats all the space of my screen when I run my app in mobile. Is there a way to minimize or toggle the instruction in mapbox gl js?
im using this code to show instructions:
var directions = new MapboxDirections({
accessToken: mapboxgl.accessToken,
interactive: false,
controls: {
inputs: false,
instructions: true, //setting this to true shows the instructions
profileSwitcher: false
}
});
map.addControl(directions, 'top-left');

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the MapboxDirections configuration shown in the issue, especially the instructions control added with map.addControl. Check how the instructions panel is rendered and styled on mobile, then verify that it can be minimized and restored with a button without affecting the other controls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100