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

Open
#120 0 comments 0 reactions 0 assignees View on GitHub

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');
![direct](https://user-images.githubusercontent.com/46692565/51144579-6aee4900-188c-11e9-8a11-658d930b2105.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.