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

Layers lost when changing basemap #42

Closed
mvl22 opened this issue Aug 11, 2022 · 2 comments
Closed

Layers lost when changing basemap #42

mvl22 opened this issue Aug 11, 2022 · 2 comments

Comments

@mvl22
Copy link
Collaborator

mvl22 commented Aug 11, 2022

This is a long-standing problem with Mapbox GL JS -based sites where a basemap change means that layers are not reliably reloaded.

We have a workaround in place, but it is clearly not being effective, so needs some reworking.

@mvl22
Copy link
Collaborator Author

mvl22 commented Aug 12, 2022

This posting helpfully summarises the workaround needed - basically the entire state has to be cached, and rebuilt on style change:

mapbox/mapbox-gl-js#4006 (comment)

In particular I have found that the source itself is lost, not just the data state.

@mvl22 mvl22 closed this as completed in 34b86c9 Aug 12, 2022
@mvl22
Copy link
Collaborator Author

mvl22 commented Aug 12, 2022

Now fixed.

This is not a 100% fix but basically works most of the time now.

This is difficult to resolve properly until Mapbox fix basemap layer changing timing problems upstream.

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

1 participant