Skip to content

Commit

Permalink
Fx issue with zoom reset (#153)
Browse files Browse the repository at this point in the history
* feat: fix issue with zoom reset

* fix: linting error

* Update app/callbacks/display_callbacks.py

* Update app/callbacks/display_callbacks.py

* fix: make style
  • Loading branch information
RonanMorgan authored Jun 11, 2024
1 parent e7d060d commit c40c5d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/callbacks/display_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,16 @@ def toggle_fullscreen_map(n_clicks_open, is_open):
if n_clicks_open:
return not is_open # Toggle the modal
return is_open # Keep the current state


# Define the callback to reset the zoom level
@app.callback(
Output("map", "zoom"),
[
Input({"type": "event-button", "index": ALL}, "n_clicks"),
],
)
def reset_zoom(n_clicks):
if n_clicks:
return 10 # Reset zoom level to 10
return dash.no_update

0 comments on commit c40c5d0

Please sign in to comment.