Skip to content

Commit

Permalink
Fix layer-click bug (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary authored May 11, 2022
1 parent cec74c5 commit 4947e42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="streamlit_folium",
version="0.6.8",
version="0.6.9",
author="Randy Zwitch",
author_email="[email protected]",
description="Render Folium objects in Streamlit",
Expand Down
5 changes: 4 additions & 1 deletion streamlit_folium/frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ function onRender(event: Event): void {
function onLayerClick(e: any) {
const global_data = __GLOBAL_DATA__;
global_data.last_object_clicked = e.latlng;
let details: Array<any> = [];
if (e.layer && e.layer.toGeoJSON) {
global_data.last_active_drawing = e.layer.toGeoJSON();
}
let details: Array<any> = global_data.drawnItems.toGeoJSON().features;
if (global_data.drawnItems.toGeoJSON) {
details = global_data.drawnItems.toGeoJSON().features;
}
global_data.all_drawings = details;
debouncedUpdateComponentValue()
}
Expand Down

0 comments on commit 4947e42

Please sign in to comment.