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

Support changing style while keeping custom base layers #4

Open
stevage opened this issue Jul 10, 2019 · 2 comments
Open

Support changing style while keeping custom base layers #4

stevage opened this issue Jul 10, 2019 · 2 comments

Comments

@stevage
Copy link
Owner

stevage commented Jul 10, 2019

This might look like:

map.U.setStyle('mapbox://mapbox.blah', { discardRegex: 'mapbox://' })

Then:

  1. Fetch new style
  2. Find every source in current style whose URL doesn't match the discardRegex, add it to the new style
  3. Find every layer in current style belonging to a retained source, copy over`

Alternative:

map.U.checkpointStyle("beforeLoaded");

map.U.setStyle('mapbox://mapbox.blah', 'beforeLoaded`);

That is, define a name for this point in the style, and allow operations to diff between points.

@vinayakkulkarni
Copy link

Or something like this: mapbox/mapbox-gl-js#2268 (comment)

@stevage
Copy link
Owner Author

stevage commented Apr 15, 2021

Just mulling over some more ideas here. A few possible design goals:

  • more elegant way of loading a basemap and manipulating it, in one go. (ie, load style from server, but add additional layers, without having to wait for a map render between the two steps)
  • make it easy to switch basemaps while retaining other layers
  • make it easy to specify how custom layers sit within a basemap (eg, "below first symbol layer")

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

2 participants