saving-willy-dev / snippets /click_map.py
rmm
chore: moved demo/example scripts to snippets
90b0271
raw
history blame
457 Bytes
import folium
import streamlit as st
from streamlit_folium import st_folium
# center on Liberty Bell, add marker
m = folium.Map(location=[39.949610, -75.150282], zoom_start=16)
folium.Marker(
[39.949610, -75.150282], popup="Liberty Bell", tooltip="Liberty Bell"
).add_to(m)
# call to render Folium map in Streamlit
st_data = st_folium(m, width=725)
if st_data['last_clicked'] is not None:
print(st_data)
st.info(st_data['last_clicked'])