removeLayer must reset layers z-index. Thanks tschaub for the review and the new patch. (closes #1090)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5386 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2007-12-12 20:08:49 +00:00
parent 8f38213e86
commit 00d6f66c06
2 changed files with 34 additions and 1 deletions

View File

@@ -632,6 +632,17 @@ OpenLayers.Map = OpenLayers.Class({
+ zIdx * 5 );
},
/**
* Method: resetLayersZIndex
* Reset each layer's z-index based on layer's array index
*/
resetLayersZIndex: function() {
for (var i = 0; i < this.layers.length; i++) {
var layer = this.layers[i];
this.setLayerZIndex(layer, i);
}
},
/**
* APIMethod: addLayer
*
@@ -740,6 +751,9 @@ OpenLayers.Map = OpenLayers.Class({
}
}
}
this.resetLayersZIndex();
this.events.triggerEvent("removelayer");
},