Add Layer.setZIndex so that layers can add behavior when their div's z-index changes. Also, change Map.setLayerZIndex() to use it.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1611 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-10-05 20:34:21 +00:00
parent a0ed21125c
commit bf075e63e0
2 changed files with 10 additions and 2 deletions

View File

@@ -516,6 +516,14 @@ OpenLayers.Layer.prototype = {
}
},
/**
* @param {int} zIdx
* @private
*/
setZIndex: function (zIdx) {
this.div.style.zIndex = zIdx;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Layer"
};

View File

@@ -261,9 +261,9 @@ OpenLayers.Map.prototype = {
* @private
*/
setLayerZIndex: function (layer, zIdx) {
layer.div.style.zIndex =
layer.setZIndex(
this.Z_INDEX_BASE[layer.isBaseLayer ? 'BaseLayer' : 'Overlay']
+ zIdx * 5;
+ zIdx * 5 );
},
/**