streamlit-folium
streamlit-folium copied to clipboard
Popup in Folium.Marker not working
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)

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 Safari 15.4 and streamlit-folium 0.6.10
@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.