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

Experiment removing off-screen maps #447

Open
leopiccionia opened this issue Sep 26, 2024 · 0 comments
Open

Experiment removing off-screen maps #447

leopiccionia opened this issue Sep 26, 2024 · 0 comments

Comments

@leopiccionia
Copy link
Collaborator

MapboxGL instances contain the Map.remove() method that, according to documentation:

Clean up and release all internal resources associated with this map.

This includes DOM elements, event bindings, web workers, and WebGL resources.

Use this method when you are done using the map and wish to ensure that it no longer consumes browser resources. Afterwards, you must not call any other methods on the map.

We should experiment with removing off-screen maps to save resource, specially WebGL-related resources.

While removing a map is simple, re-initializing a map to its previous state (including interactions, etc.) when it's back to screen may require non-trivial refactoring.

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