Conversation
0eac21d to
1fcd6f2
Compare
Update LayerControl._layers object which was being neglected and not being updated. Added a line to properly sort the layerControl based on the MapML Layer zIndex.
|
It appears we were neglecting an internal Leaflet object ( The |
That sorting function we pass is being used but only in _addLayer method of Leaflet Whenever we drag and drop layers in the Layer control (MapML updates the z-index) and the LayerControl._update method gets called which is in charge of updating the layer control, hence the need to add that sorting functionality to that _update method also. |
_update function to use the options.sortFunction if present. tbd: if this should be offered via PR to upstream project. Prettier formatting changes to pre-existing test file
Needs a test
@AliyanH have a look to see if you agree.
Don't look too hard at layer re-ordering I think there are bugs there too :-<