'Reset view' option on scatter_mapbox is stuck on old data!

So I built my first Dash app (woo!) and am loving it so far. I’m currently struggling with a small scatter_mapbox issue that I am hoping to get some help with!

Basically my Dash app lets you select a wind farm from a dropdown. I have a callback that takes the farm name information, generates a dataframe of turbine names and lat/lon values, and creates a map of these turbine locations using scatter_mapbox. The result is as intended and the map updates to show the new wind farm with markers representing the turbine locations.

If you zoom in and then wish to zoom out easily to view the entire farm, you can usually just click on the home/reset view button instead of scrolling manually. The issue that I’m running into is that if I select the home/reset view icon, it will take the map back to the area where the first selected wind farm is instead of the wind farm that is currently selected. Why is it retaining this info about the first farm if I’m generating a new figure each time the callback is triggered? Is there a way to clear this so that the ‘home’ area is relative to the selected wind farm?

2 Likes

I am also struggling with this. Any help would be much appreciated! I have tried manually changing the center each time the callback is called and changing fig[‘layout’][‘uirevision’] but nothing has worked.

Hello I have the same problem.
Here is a video that I found that presents the bug: Issue Dash GIF | Gfycat
Can you correct this anomaly?

I have created a new issue for this here including a minimal reproducible example.