I have a Densitymapbox display on a callback. It works.
I am trying to zoom to the appropriate range where the data is located when loading. I’ve tried a few combinations in the layout but I keep having errors.
Here is my example code below. What argument and where do I need to place it, so I can the zoom.
thanks,
Mike
def map_plot(value):
gps = create_dataframe(value)
heatmap = go.Densitymapbox(lat=gps .lat,
lon=gps.lon,
z=gps.av_lat_lon_gps_signal,
text=gps ['ul_gps_datetime'],
hovertemplate="Datetime: %{text} <br>" +
"average signal: %{z} <br>"
,
radius=20,
colorscale='tropic',
)
return {'data': [heatmap],
'layout': go.Layout(
mapbox_style="open-street-map",
mapbox_center_lon=130,
margin={"r": 0, "t": 0, "l": 0, "b": 0},