46bit / taesp_maps

Leaflet.js maps for Internet Archaeology.
http://intarch.ac.uk/journal/issue20/4/4_01.htm
0 stars 0 forks source link

L.Control.LayerTree doesn't respect layer ordering #15

Closed 46bit closed 8 years ago

46bit commented 8 years ago

The fix is the same: L.Control.LayerTree needs to respect correct ordering, ideally without duplicating a lot of the map.hasLayer state machine.

46bit commented 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.

46bit commented 8 years ago

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.