Automatic Zoom for ScatterMapbox trace layer

Hi Team,

Is there a way to get this functionality through Dash.jl at the moment?
Automatic Zoom fitbounds in python

I have seen that it is in the plotlyJS source bundled with Dash.jl, and have been able to get the scattermapbox trace working through Dash, but no luck trying to enable the auto zoom feature.

I have also seen this discussion Auto zoom on mapbox but not sure if plotly/documentatoin has been updated since?

If the auto-zoom is not out-of-the-box then help on how to pass the manual mapbox bounds setting configs via dash.jl would be appreciated, there doesn’t seem to be documentation on how to do that.

Thanks in advance for any help!

Hi @spcogg thanks for reaching out and sorry for the extremely belated response.

In short, yes it is possible!

The recommended way to do this is to use PlotlyJS.jl to create your figure.

Following the example from python that you linked to, we could do this:

using PlotlyJS

p = plot(
    scattergeo(lat=[0,15,30,35], lon=[5, 10, 25, 30], mode="lines"), 

If you return that p to a dcc_graph.figure property in dash you should be good to go!