Closed fcusimano closed 10 months ago
When using folium.plugins.GroupedLayerControl, my map looks like this:
folium.plugins.GroupedLayerControl
When I use folium.LayerControl, it looks like this:
folium.LayerControl
Code example:
m = folium.Map( location=[city.dissolve().centroid.y, city.dissolve().centroid.x], tiles="cartodbpositron", zoom_start=11, ) folium.GeoJson( city, style_function=lambda x: {"color": "black", "fill": None, "weight": 0.5}, control=False, ).add_to(m) transit_layer = folium.GeoJson( geo_data_dict["transit"].data_per_point, style_function=lambda x: {"color": "red"}, control=True, name="transit", show=False, ).add_to(m) GroupedLayerControl({"Per point": [transit_layer]}).add_to(m) # folium.LayerControl(collapsed=False).add_to(m) st_folium( m, use_container_width=True, )
A similar issue has been mentioned in https://github.com/randyzwitch/streamlit-folium/issues/139 but the discussion focused more on SideBySideLayers
SideBySideLayers
For information, I used to have this error when I used a marker with the same name multiple times, working with folium_static but not st_folium.
When using
folium.plugins.GroupedLayerControl
, my map looks like this:When I use
folium.LayerControl
, it looks like this:Code example:
A similar issue has been mentioned in https://github.com/randyzwitch/streamlit-folium/issues/139 but the discussion focused more on
SideBySideLayers