streamlit-folium icon indicating copy to clipboard operation
streamlit-folium copied to clipboard

Popup in Folium.Marker not working

Open KassiusKlay opened this issue 3 years ago • 3 comments

import folium
from streamlit_folium import st_folium


m = folium.Map([45, 0], zoom_start=4)

folium.Marker([45, -30], popup="inline implicit popup").add_to(m)

folium.CircleMarker(
    location=[45, -10],
    radius=25,
    fill=True,
    popup=folium.Popup("inline explicit Popup"),
).add_to(m)

ls = folium.PolyLine(
    locations=[[43, 7], [43, 13], [47, 13], [47, 7], [43, 7]], color="red"
)

ls.add_child(folium.Popup("outline Popup on Polyline"))
ls.add_to(m)

gj = folium.GeoJson(
    data={"type": "Polygon", "coordinates": [[[27, 43], [33, 43], [33, 47], [27, 47]]]}
)

gj.add_child(folium.Popup("outline Popup on GeoJSON"))
gj.add_to(m)

st_folium(m)

output

KassiusKlay avatar May 16 '22 18:05 KassiusKlay

Hi @KassiusKlay, thanks for the very clear code and gif showing the error. I just tried this with the latest version of streamlit-folium, and all 4 popups worked for me. What browser and version of streamlit-folium are you using?

blackary avatar May 16 '22 20:05 blackary

@blackary Safari 15.4 and streamlit-folium 0.6.10

KassiusKlay avatar May 17 '22 05:05 KassiusKlay

@KassiusKlay It appears to be a Safari-specific bug. I don't have an obvious fix at this point, but hopefully will eventually. Thankfully, in the meantime, there's an easy workaround of using an explicit popup instead.

blackary avatar May 17 '22 14:05 blackary