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.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.