Add the ability to set the zIndex explicitly to the addLayer call, and do so in the markers.html file. This demonstrates the creation of a marker which can be clicked upon to give the url of its icon.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@200 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-20 01:18:17 +00:00
parent 26c2b6651b
commit 50a9f706b9
2 changed files with 12 additions and 5 deletions

View File

@@ -120,10 +120,14 @@ OpenLayers.Map.prototype = {
/**
* @param {OpenLayers.Layer} layer
*/
addLayer: function (layer) {
addLayer: function (layer, zIndex) {
layer.map = this;
layer.div.style.overflow = "";
layer.div.style.zIndex = this.Z_INDEX_BASE['Layer'] + this.layers.length;
if (zIndex) {
layer.div.style.zIndex = zIndex;
} else {
layer.div.style.zIndex = this.Z_INDEX_BASE['Layer'] + this.layers.length;
}
this.layerContainerDiv.appendChild(layer.div);
this.layers.push(layer);
this.events.triggerEvent("addlayer");