Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion folium/plugins/groupedlayercontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class GroupedLayerControl(JSCSSMixin, MacroElement):
exclusive_groups: bool, default True
Whether to use radio buttons (default) or checkboxes.
If you want to use both, use two separate instances of this class.

group_checkboxes: bool, default True
Show a checkbox next to non-exclusive group labels for toggling all
**kwargs
Additional (possibly inherited) options. See
https://leafletjs.com/reference.html#control-layers
Expand Down Expand Up @@ -66,12 +69,13 @@ class GroupedLayerControl(JSCSSMixin, MacroElement):
"""
)

def __init__(self, groups, exclusive_groups=True, **kwargs):
def __init__(self, groups, exclusive_groups=True, group_checkboxes=True, **kwargs):
super().__init__()
self._name = "GroupedLayerControl"
self.options = remove_empty(**kwargs)
if exclusive_groups:
self.options["exclusiveGroups"] = list(groups.keys())
self.options["groupCheckboxes"] = group_checkboxes
self.layers_untoggle = set()
self.grouped_overlays = {}
for group_name, sublist in groups.items():
Expand Down
Loading