Reuse/store map instance
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 1.2.1
### Question
Is there a way to reuse mapbox loads?
My use case is an app where the pages are navigated via react router and 1 of the pages is a map. Currently I am creating a map each time the user visits the page but I'd like to be able to reuse loads + token uses if possible when navigating away from and back to the map page.
Sorry if duplicate issue -- I searched old issues and stackoverflow and couldn't find something very closely related
Thanks
### Links to related documentation
[API Documentation for map](https://docs.mapbox.com/mapbox-gl-js/api/#map)
Contributor guide
Research direction
Start with the linked Map API documentation and the React Router map-page lifecycle described in the issue. Determine whether a Map instance and its loads can be reused when navigating away and back, and document the supported approach or the limitation clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100