Skip to content

Commit

Permalink
Fix layercontrol by rendering the map before generating js (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary authored Feb 18, 2022
1 parent adec250 commit 207964d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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.1",
version="0.6.2",
author="Randy Zwitch",
author_email="[email protected]",
description="Render Folium objects in Streamlit",
Expand Down
2 changes: 2 additions & 0 deletions streamlit_folium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def st_folium(

# handle the case where you pass in a figure rather than a map
# this assumes that a map is the first child
fig.render()

if not (isinstance(fig, folium.Map) or isinstance(fig, folium.plugins.DualMap)):
fig = list(fig._children.values())[0]

Expand Down
2 changes: 0 additions & 2 deletions streamlit_folium/frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ function onRender(event: Event): void {
let layer = map._layers[key];
layer.on("click", onLayerClick)
}
debugger;
map.on('draw:created', onDraw);
//map.on('draw:edited', onDraw);

Streamlit.setFrameHeight()
updateComponentValue();
Expand Down

0 comments on commit 207964d

Please sign in to comment.