mapbox / mapbox-directions.js

Leaflet plugin for the Mapbox Directions API
https://www.mapbox.com/mapbox.js/example/v1.0.0/mapbox-directions/
ISC License
60 stars 23 forks source link

Hide Control #104

Open yvanvds opened 8 years ago

yvanvds commented 8 years ago

Could you provide a method to hide this control after showing it? The other mapbox controls in mapbox-gs-js can easily be hided with their remove() method (inherited from the base control class). Only the directions control cannot.

I understand this is an extension and it's not part of mapbox itself, but it in a single page application it is a bit problematic if the control can not be hidden at certain views.

tmcw commented 8 years ago

The other mapbox controls in mapbox-gs-js can easily be hided with their remove() method (inherited from the base control class).

To clarify, are you using this code or https://github.com/mapbox/mapbox-gl-directions ? This repository, for mapbox-directions.js, matches Mapbox.js, not Mapbox GL JS.