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
146 stars 36 forks source link

markers with checkboxes in the basemap #72

Open Kurtaja opened 8 months ago

Kurtaja commented 8 months ago

Hi and thank you for a great library! Two questions: 1) I'm looking for a way to have check boxes in one of the branches of the baseTree, but even if I add the 'selectAllCheckbox: true' attribute, they still turn up as radio boxes. Is it just me not being able to figure out of it or is it impossible to have check boxes in the baseTree? If impossible at the moment, would it be possible to have in the next release? Else if possible, do you have the possibility to give me an example structure to see how it should be done? 2) When I call the 'setBaseTree' function again (after it's already been set initially) to update the contents of it, it expands the tree. Is there a way to avoid that the tree gets expanded when I call that function?

jjimenezshaw commented 8 months ago

1) checkboxes are only possible in the overlays. Base layer is a radio button because you can only have one. Where are you having that problem? 2) you can just collapse it afterwards with collapseTree