jjimenezshaw / Leaflet.Control.Layers.Tree

a Tree Layers Control for Leaflet
https://jjimenezshaw.github.io/Leaflet.Control.Layers.Tree/examples/basic.html
BSD 3-Clause "New" or "Revised" License
148 stars 36 forks source link

Toggle for all layers in a group #2

Closed kingrollo closed 7 years ago

kingrollo commented 7 years ago

Hello.

Is there a way of toggling all the layers in a layer group at once?

Thanks! R.

jjimenezshaw commented 7 years ago

@kingrollo this feature is not implemented itself. Maybe you can do some hack in your code detecting the changes in the layers. But it is not directly in the tree. You can implement a pull request to include that :) Unfortunately I do not have time now :'(

If you want to enable many layers at once, of course you can make a group layer. However, you shouldn't include both in the tree, the group and the layer alone. It has estrange behaviors: there can be contradictions (i.e. the group is disabled, but one element is enabled. Which one rules?)

jjimenezshaw commented 4 years ago

Some time ago I added a new functionality to select all the layers in a group. Maybe it is useful for you, @kingrollo