I am trying to display dynamically polygons on a map (e.g. I click on a button outside the map and it overlays a polygon on the map, and if I click on another button then another polygon appears).
As explained in dynamic_map_vs_rerender.py, I use the feature_group_to_add parameter of st_folium to show the polygons, but any style parameter specified into a folium.GeoJson object are not taken into account when displayed on the map.
Above, the style_parcel dict will not be taken into account and the polygon will be displayed blue. If I specify some style into a GeoJsonTooltip, it will also not be taken into account when displayed on the map.
I think the style works if I add the folium.GeoJson polygon statically to the map (with .add_to(map)), as in geojson_popup.py, but won’t it break the dynamic aspect of the map ?
Is there any workaround possible to make it work ?
I am using python 3.11.6, streamlit 1.27.2, streamlit-folium 0.15, folium 0.14.
Hi @patrontheo, welcome to the forum! Thank you for also opening an issue on the repository issues – I’ll go ahead and link to that post, and respond your question there.