randyzwitch / streamlit-folium

Streamlit Component for rendering Folium maps
https://folium.streamlit.app/
MIT License
468 stars 176 forks source link

Session state key #169

Open patrontheo opened 9 months ago

patrontheo commented 9 months ago

Not really an issue but is there a reason why you use a hash to create the key of the map ? The other widgets in streamlit just use the key provided as an argument.

It could be useful to get the returned objects before the call to st_folium(...). For this we need to know in advance what is the key of the widget.

A workaround I found is to look for a key that is 64 characters long in st.session_state..keys(), but it is not reliable and limited to one map being displayed.

An easy fix could be to return the key along with the other returned objects, and the user can save this key to a session state if he needs to use the returned objects before the call to st_folium.