From adec250db38d009840188fa0e16bc83caf968299 Mon Sep 17 00:00:00 2001 From: Zachary Blackwood Date: Fri, 18 Feb 2022 15:10:49 -0500 Subject: [PATCH] Fix-bidirectional (#35) * add ALL the dependencies * Don't pull in leaflet again * Remove padding * Remove extra bootstrap, and don't assume layer * Bump version --- setup.py | 2 +- streamlit_folium/frontend/public/index.html | 78 +++++++++++++++++++-- streamlit_folium/frontend/src/index.tsx | 2 +- 3 files changed, 74 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 6b16ff0..b88b654 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setuptools.setup( name="streamlit_folium", - version="0.6.0", + version="0.6.1", author="Randy Zwitch", author_email="randy@streamlit.io", description="Render Folium objects in Streamlit", diff --git a/streamlit_folium/frontend/public/index.html b/streamlit_folium/frontend/public/index.html index 0b40670..c956ddc 100644 --- a/streamlit_folium/frontend/public/index.html +++ b/streamlit_folium/frontend/public/index.html @@ -7,21 +7,87 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/streamlit_folium/frontend/src/index.tsx b/streamlit_folium/frontend/src/index.tsx index d28891a..3e63af3 100644 --- a/streamlit_folium/frontend/src/index.tsx +++ b/streamlit_folium/frontend/src/index.tsx @@ -60,7 +60,7 @@ function onRender(event: Event): void { function onLayerClick(e: any) { const global_data = __GLOBAL_DATA__; global_data.last_object_clicked = e.latlng; - if (e.layer.toGeoJSON) { + if (e.layer && e.layer.toGeoJSON) { global_data.last_active_drawing = e.layer.toGeoJSON(); } if (e.target._layers) {