I have a mapbox in my dash layout. By default I define some defaults for map center, zoom level:
fig.update_layout(mapbox=dict(bearing=0,center=dict(lat=center_lat,lon=center_lon),zoom=center_zoom))
Within my dash layout, I then have some buttons that I’d like to trigger a callback to update the layout, rather than all the data in the figure as there is a lot of data and reloading it is costly.
I’ve tried a callback like this:
@app.callback(
Output(component_id='my_map',component_property='figure'),
[Input(component_id='map_button_1', component_property='n_clicks'),
State('my_map', 'figure'),]
)
def recenter_map(click_in,fig):
But i get the error stating my_map needs to be of type dcc.Input.
Is there any way to achieve what I’m attempting?
Thanks in advance.