Closed astridx closed 4 years ago
Of course, your version is much better than mine. I created my version for a map that has 18 overlays and no subtree. That was the most efficient solution. Thank you for your improvements which was without error for me.
It is only a pity that JavaScript functions are assigned in the Layer-Tree object. I have an example where I have the tree as a JSON in a separten file and read it in using JSON.parse. This allows users to change the Layertree themselves without JavaScript. I can not easily do that with the new features.
In the new feature you can use a callback or directly a value (true or false) in the selectAll
field. The callback lets you do things dynamically/fancy. If you do not need it, just use the booleans.
I will document that when I have a bit of time.
Idea for https://github.com/jjimenezshaw/Leaflet.Control.Layers.Tree/issues/12
I thought about how a check and uncheck would be possible. Here's what I use so far.