folium icon indicating copy to clipboard operation
folium copied to clipboard

Passing base layers to GroupedLayerControl plugin

Open berrfred opened this issue 1 year ago • 2 comments

My goal is to display in a single control layer component both base layers and grouped overlays.

As far as I understand today we can either display base layers with non grouped overlays or display grouped overlays with the GroupedLayerControl plugin but then a null is used for base layers ...

Why not allowing to also pass a base layers array to the GroupedLayerControl ? Then setting the regular control to False I should be ok.

berrfred avatar Feb 08 '24 07:02 berrfred

Below what I would like to achieve.

image

berrfred avatar Feb 08 '24 07:02 berrfred

@berrfred That would be a useful addition. The underlying leaflet control supports this, so it should be possible to add. I am not sure when this will be picked up though (unless you are willing to make PR yourself).

In the meantime, there is another plugin (treelayercontrol.TreeLayerControl) that already supports adding base Layers. This control is scheduled to be released with release 17, but you can pip install it from source code. Can you have a look to see if this would help for your use case?

hansthen avatar Apr 07 '24 08:04 hansthen