mapbox / mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/
ISC License
237 stars 125 forks source link

Map SetStyle removes direction polyline #277

Open mapsensedev opened 3 years ago

mapsensedev commented 3 years ago

When switching basemap using setStyle all the layers are removed including any directions polyline. Is the directions control has been added to the map then the map should retain the directions polyline. The developer should not have to add these as these capabilities come out of the box with directions implementation

mithun-halo commented 2 years ago

I solved it by using doing this