onaio / js-tools

Ona shared JavaScript components and utilities
Apache License 2.0
11 stars 2 forks source link

Support Multiple map instances on Gisidalite #184

Open kahummer opened 2 years ago

kahummer commented 2 years ago

Is this a new feature or an enhancement? enhancement

Is your feature request related to a problem? Please describe. When running multiple instances of maps on different routes/tabs that don't initiate a complete component mount, the map instance Object is garbage collected thus making it difficult to access mapbox functions for these instances when moving to a previously loaded map.

Describe the solution you'd like A solution for these would be to implement a unique key that forces the ReactMapboxgl map instance to fully mount based on this key.

Additional context

Ensure re-mounting of Reactmapboxgl Map component by using a unique key in the event we have multiple map instances