Hello all. Not sure if this is the right place to ask (was either here or github issues), but is it possible to fetch the bounds of the leaflet map with state in dash-leaflet. I’ve tried the following
...
html.Div(
[
dl.Map(
[dl.TileLayer(), dl.LayerGroup(id="layer")],
id="map",
center=[47.5, 13],
zoom=7,
)
]
),
...
@app.callback(
Output("slider-div", "children"),
[Input("submit-button", "n_clicks")],
[
State("date-picker", "start_date"),
State("date-picker", "end_date"),
State("environment", "value"),
State("product", "value"),
State("map", "bounds")
],
)
def date_picker(n_clicks, start_date, end_date, environment, product, bounds):
# bounds is None
This only works if the map is defined with properties, but it doesn’t update when panning and zooming. Otherwise it would return None
. Thanks in advance.