Don't gratuitously reverse the layer order in the switcher.

This commit is contained in:
Oliver Jowett 2016-07-03 13:35:54 +01:00
parent 6e8b7cff57
commit 4862010d42

View file

@ -213,7 +213,7 @@ ol.control.LayerSwitcher.prototype.renderLayer_ = function(lyr, idx) {
* @param {Element} elm DOM element that children will be appended to. * @param {Element} elm DOM element that children will be appended to.
*/ */
ol.control.LayerSwitcher.prototype.renderLayers_ = function(lyr, elm) { ol.control.LayerSwitcher.prototype.renderLayers_ = function(lyr, elm) {
var lyrs = lyr.getLayers().getArray().slice().reverse(); var lyrs = lyr.getLayers().getArray().slice();
for (var i = 0, l; i < lyrs.length; i++) { for (var i = 0, l; i < lyrs.length; i++) {
l = lyrs[i]; l = lyrs[i];
if (l.get('title')) { if (l.get('title')) {