Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st_folium breaks some map features #34

Closed
bdebbabi opened this issue Feb 16, 2022 · 0 comments · Fixed by #35
Closed

st_folium breaks some map features #34

bdebbabi opened this issue Feb 16, 2022 · 0 comments · Fixed by #35

Comments

@bdebbabi
Copy link

Hi, thank you for adding bi-directional support, this is a great feature! However some map features don't work with st_folium().

  • The marker popup doesn't appear when clicking a marker.
  • When adding a LayerControl the button appears but it flickers when hovering.
  • The map shrinks when adding some elements like an Icon() to the marker or a Draw() plugin.

With st_folium() :
image

With folium_static():
image

Here's the code:

from streamlit_folium import folium_static, st_folium
from folium import plugins
import folium

m = folium.Map(location=[39.94, -75.15], zoom_start=5)
folium.Marker(
    location=[39.94, -75.15],
    popup="Marker",
    icon=folium.Icon(),
).add_to(m)
plugins.Draw().add_to(m)
folium.LayerControl().add_to(m)

# does not work with st_folium
st_folium(m, key="fig1", width=700, height=700)
# everything works with folium_static
folium_static(m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant