You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 8, 2017. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 8, 2017. It is now read-only.
Users don't expect setStyle to overwrite everything, and consider the current behavior a bug. This is a bummer, and something that we could document around, saying "setStyle will wipe out the current state of the map". I'm fine with the documentation approach, but it needs a workaround, because "switching the map style" is a common usecase that is a hard expectation - it's easy to do in Leaflet and all similar tile-based libraries. -- @tmcw, 2016
Injecting custom layers into Mapbox core styles is a common use case and confusing to our users, especially when the user wants to swap out the core style and keep the custom layers.
Have we considered supporting "nested styles"? These would help our users build a solid mental model of their stylesheet, encapsulate core style implementation details, allow new kinds of style modularity, and fit nicely into Studio.
Another user here trying to replicate this common Leaflet/Mapbox JSAPI use case (swapping out basemap beneath overlay layers). If there is a way to do this by constructing/manipulating a style object to change the "basemap" layers, an example in the documentation would go a long way to help.
Activity
chadwilcomb commentedon Aug 26, 2016
Another user here trying to replicate this common Leaflet/Mapbox JSAPI use case (swapping out basemap beneath overlay layers). If there is a way to do this by constructing/manipulating a style object to change the "basemap" layers, an example in the documentation would go a long way to help.
samanpwbb commentedon Sep 2, 2016
I support this idea. To side-step the problem, I find myself relying on multiple instances of mapbox gl and https://github.com/mapbox/mapbox-gl-sync-move.
chriswhong commentedon Dec 5, 2016
+1, I need to allow the user to pick a different basemap style while leaving their carefully selected overlay layers in place.
lucaswoj commentedon Jan 17, 2017
Migrated to mapbox/mapbox-gl-js#4000