How to speed up map plots on dash?

Hello, I have built a dash app which allows one to visualize scatter traces on a map plot (I use go.Scattermap(…), update the plot layout with mapbox_style = “open-street-map”, and I return the figure to a dcc.Figure() element). However 1. the map loads quite slowly, and 2. it updates very slowly (map goes blank for a few seconds) upon zooming and sometimes just zooms out while zooming in. Does anyone know how this could be avoided?
It only happens on dash – if I just create an HTML file then there is no zooming or latency problem whatsoever.

Thanks in advance!

Hey @Spitfire, generally spoken, you should aim for using clientside callbacks. These are much faster than the python based callbacks. Instead of returning a figure, try using partial updates.

Without knowing what exactly you are doing it’ll be difficult to help you any further.

1 Like