Hey - I have a multi-page app, where the main page is a dash-leaflet map and another tab where I display the data. Trouble is, when the user goes to “data” tab and back, the map is refreshed. It can be expensive, plus information about the previous location is lost.
I tried to extend the component with Persistence of center and zoom, but the map still gets refreshed.
Is there any way to indicate that the page should not be refreshed upon navigating to it? I don’t want all the callbacks to fire.
I hoped the refresh=False will do the trick, but no luck. The background_callback_manager is DiskcacheManager, I am also using gunicorn, but i guess that does not matter.
If not is there any straightforward way (other than keeping the state of the map in a dcc.Store) of preserving the state of the map when the use navigates away from a page containing a map (e.g. in a multi-page app) and then returns to that page?
I can put together a working example if that would help.
(And I can work around the issue in other ways if there’s no straightforward way of preserving the state of the map )
No, it does not. One possible solution would be to keep the map mounted in the DOM, toggling its visibility depending on the page - either manually, or using page components,