randyzwitch / streamlit-folium

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

Fix map center and zoom map update #168

Closed patrontheo closed 9 months ago

patrontheo commented 9 months ago

Fixes #154.

@blackary the solution you proposed in #154 to change the widget key works, but it triggers a widget reloading (map quickly disappearing and appearing again). This can be avoided by using setView instead of manually setting the zoom and the center separately (see leafleat issue 170.

I couldn't add tests since (to the best of my knowledge) playwright doesn't allow to interact with the map (change center and zoom). But you can test it on your side with the same sample code as in #154 and it works fine.

Tests were passing on my side.

randyzwitch commented 9 months ago

Since it's not clear how to automate a test, let's go with it for now and write a test later when it becomes more obvious