Hi @AndreasNehls, welcome to the Streamlit community!
As streamlit-folium is an external Component (that just happens to be written by me ), it’s not part of the methods defined in Streamlit for the column/layout API. Instead, try the following as your last line:
I did it using with column:
folium_static(m)
and it works fine but it is currently not possible to set the option “use_container_width = True”. Can you make it happen?
I can set the width and height in folium but the map doesn’t resize if I zoom in or zoom out my dashboard
Not sure that’s possible. The way folium_static sets the size is by reading from the Folium object on the Python side, or whatever the developer specifies from Python. It’s not clear to me how I’d be able to get the size from the JavaScript side (i.e. the browser), but know about it from the Python side.
If someone could figure it out though, I am happy to accept a PR, as it does sound like desirable functionality.
How did you do for other maps and charts such as: st.pydeck_chart, st.map or st.altair_chart etc ? they are all equipped with use_container_width option
Because all of those functions are part of the Streamlit python package. Folium and streamlit-folium don’t share any of the same Python classes, folium_static literally just reads the HTML representation from the Folium object and displays it.
Thanks! Do you know if it’s possible to set initial page-zoom level smaller than 100% (currently if I deploy the app) - don’t see it in the st.set_page_config
what I meant was because I can’t control the width of folium_static when I first deploy my app and open - it will be display with 100% and the two columns are overlaid like this:
I’m encountering the same issue – is there a way to prevent the Folium map from overlaying on the Streamlit app? The map size doesn’t change when zooming in on the web, which is causing the app to become unresponsive. I’m keen to know if anyone has found a solution or an alternative.
Hi, Is there any update on this? I am encountering the same issue aswell.
I have tried several options but it did not worked out. What I want is that the folium map adjust dynamically on page/container width.