I'm using Mapbox-GL-Leaflet bindings on Leaflet to style my vector tiles. I'd now allow the user to switch a style using Leaflet control.

The easiest way would be to use LayerControl for this. Since the basemap is always the same data, just the style changes. But this change of basemaps would remove the old data and reload the same data. I don't know if you can detect this change (plus the delay of Mapbox-GL-Leaflet) on slower systems.

Is there a way to make the LayerControl not reload the data, but just change the style?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.