Closed Dinuxax100 closed 4 years ago
I think the problem is in the Control.Layers
class, not in Layers.Tree
With this function you can more or less workaround it
function multiCheckbox(layer, control) {
list_input=[];
control.getContainer().querySelectorAll('input').forEach(input => {
if (input.layerId && input.layerId === L.Util.stamp(layer)) {
list_input.push(input);
L.DomEvent.on(input, 'click', function(ev){
list_input.forEach(i => {
if(i.checked !== input.checked) i.click();
});
});
}
});
}
And call it with the layers you know are duplicated.
In the example options.html
, I created another entry "sevilla" and added with
multiCheckbox(sevilla, lay);
However it does not work in some scenarios if you use selectAllCheckbox
.
Thanks for your code. It's working.
Hi,
In leaflet.control.layers.tree, i have same layer in different children group. On selecting the layer in one group, need to select the same layer in all other group. same goes to unchecked.
Can you help on this.
Thanks.