coding standards

git-svn-id: http://svn.openlayers.org/trunk/openlayers@4186 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-09-04 11:11:42 +00:00
parent dab3144c16
commit a113ac58b3

View File

@@ -622,15 +622,17 @@ OpenLayers.Map = OpenLayers.Class({
*/
setLayerIndex: function (layer, idx) {
var base = this.getLayerIndex(layer);
if (idx < 0)
if (idx < 0) {
idx = 0;
else if (idx > this.layers.length)
} else if (idx > this.layers.length) {
idx = this.layers.length;
}
if (base != idx) {
this.layers.splice(base, 1);
this.layers.splice(idx, 0, layer);
for (var i = 0; i < this.layers.length; i++)
for (var i = 0; i < this.layers.length; i++) {
this.setLayerZIndex(this.layers[i], i);
}
this.events.triggerEvent("changelayer");
}
},