Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot hide instructions #101

Closed
ghost opened this issue Nov 22, 2016 · 5 comments
Closed

cannot hide instructions #101

ghost opened this issue Nov 22, 2016 · 5 comments
Assignees

Comments

@ghost
Copy link

ghost commented Nov 22, 2016

As per the instructions, I want to hide the inputs and instructions:

 this.directions = new MapboxDirections({
        unit: 'metric', 
        profile: 'walking',
        controls: {
          inputs: false,
          instructions: false
        }
      });

However, the instructions are not hidden.

An if statement is missing here: https://github.com/mapbox/mapbox-gl-directions/blob/master/src/directions.js#L54

@ghost ghost changed the title cannot hide inputs and instructions cannot hide instructions Nov 22, 2016
@mapsam
Copy link
Contributor

mapsam commented Nov 23, 2016

Hi @rolandoldengarm - you're correct. This was my fault in the recent 3.x updates. I'll try and get a fix out soon!

@mapsam
Copy link
Contributor

mapsam commented Dec 7, 2016

3.0.3 has been released - CDN will be up after this is merged in gl-js: mapbox/mapbox-gl-js#3754

@mapsam
Copy link
Contributor

mapsam commented Dec 7, 2016

@rolandoldengarm 3.0.3 is released and should fix this!

@mapsam mapsam closed this as completed Dec 7, 2016
@ghost
Copy link

ghost commented Jul 1, 2017

Is it possible to hide/show the instructions after the directions control has been added to the map?
I've tried to change the instructions value on the MapboxDirections object at run-time with .actions.setOptions( options ) which does change the instructions value, but this is not visually reflected on the map.

@ghost
Copy link

ghost commented Jul 1, 2017

Btw, I solved the dynamic hide/show of instructions with the following;

let instructions = document.getElementsByClassName("directions-control-instructions");
instructions[0].hidden = hide;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant