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.
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.