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

sortLayers:true is not working #24

Closed nrtkrishna closed 4 years ago

nrtkrishna commented 4 years ago

I gave sortLayers:true option but the tree layers or groups are not sorted.

jjimenezshaw commented 4 years ago

Due to tree construction (the tree cannot be modified, nodes added, etc), sortLayers does not work. You have to implement that before creating it. I will document it in the next release.

nrtkrishna commented 4 years ago

ok..thank you. That would be great. For now can I proceed with sorting array and passing it to overlays?

jjimenezshaw commented 4 years ago

Yes. Sort it in the object you pass before you create the tree.