Closed 46bit closed 8 years ago
This control is really quite clean already, but using Leaflet LayerGroup might make this keep more to the Leaflet system. Leaving for distant-future refactoring.
Given calls to L.map.addLayer
and L.map.removeLayer
will always mess with layer ordering, I've chosen to just control the layer opacity. Layers are added in the correct order and then never removed - just changed in visibility.
Hydrology
andAerials
end up on top.The fix is the same:
L.Control.LayerTree
needs to respect correct ordering, ideally without duplicating a lot of themap.hasLayer
state machine.