Skip to content

Commit

Permalink
Fix all_drawings to get properly populated (#76)
Browse files Browse the repository at this point in the history
* Fix all_drawings to get properly populated

* Remove debugger

* Remove unused variable
  • Loading branch information
blackary authored Jul 6, 2022
1 parent b5d7998 commit 658466c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions streamlit_folium/frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ type GlobalData = {
last_active_drawing: any
all_drawings: any
zoom: any
drawn_items: any
last_circle_radius: number | null
last_circle_polygon: any
}
Expand All @@ -18,6 +17,7 @@ declare global {
__GLOBAL_DATA__: GlobalData
initComponent: any
map: any
drawnItems: any
}
}

Expand Down Expand Up @@ -73,8 +73,8 @@ function onLayerClick(e: any) {
if (e.layer && e.layer.toGeoJSON) {
global_data.last_active_drawing = e.layer.toGeoJSON()
}
if (global_data.drawn_items.toGeoJSON) {
details = global_data.drawn_items.toGeoJSON().features
if (window.drawnItems.toGeoJSON) {
details = window.drawnItems.toGeoJSON().features
}
global_data.all_drawings = details
debouncedUpdateComponentValue(window.map)
Expand Down Expand Up @@ -140,7 +140,6 @@ function onRender(event: Event): void {
all_drawings: null,
last_active_drawing: null,
zoom: null,
drawn_items: [],
last_circle_radius: null,
last_circle_polygon: null,
}
Expand Down

0 comments on commit 658466c

Please sign in to comment.