Skip to content

Commit 95f4233

Browse files
Added groupCheckboxes option to GroupedLayerControl
1 parent 5f9f4f0 commit 95f4233

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

folium/plugins/groupedlayercontrol.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class GroupedLayerControl(JSCSSMixin, MacroElement):
2222
exclusive_groups: bool, default True
2323
Whether to use radio buttons (default) or checkboxes.
2424
If you want to use both, use two separate instances of this class.
25+
26+
group_checkboxes: bool, default True
27+
Show a checkbox next to non-exclusive group labels for toggling all
2528
**kwargs
2629
Additional (possibly inherited) options. See
2730
https://leafletjs.com/reference.html#control-layers
@@ -66,12 +69,13 @@ class GroupedLayerControl(JSCSSMixin, MacroElement):
6669
"""
6770
)
6871

69-
def __init__(self, groups, exclusive_groups=True, **kwargs):
72+
def __init__(self, groups, exclusive_groups=True, group_checkboxes=True, **kwargs):
7073
super().__init__()
7174
self._name = "GroupedLayerControl"
7275
self.options = remove_empty(**kwargs)
7376
if exclusive_groups:
7477
self.options["exclusiveGroups"] = list(groups.keys())
78+
self.options["groupCheckboxes"] = group_checkboxes
7579
self.layers_untoggle = set()
7680
self.grouped_overlays = {}
7781
for group_name, sublist in groups.items():

0 commit comments

Comments
 (0)