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:
@@ -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");
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user