Set opacity on layer div, not on tiles and markers. r=fredj (closes #3431)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12185 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-07-25 11:42:43 +00:00
parent c3850a9fb9
commit fe720b259e
9 changed files with 17 additions and 178 deletions

View File

@@ -349,6 +349,11 @@ OpenLayers.Layer = OpenLayers.Class({
this.div.style.width = "100%";
this.div.style.height = "100%";
this.div.dir = "ltr";
if (this.opacity != null) {
OpenLayers.Util.modifyDOMElement(
this.div, null, null, null, null, null, null, this.opacity
);
}
this.events = new OpenLayers.Events(this, this.div,
this.EVENT_TYPES);
@@ -1269,11 +1274,8 @@ OpenLayers.Layer = OpenLayers.Class({
setOpacity: function(opacity) {
if (opacity != this.opacity) {
this.opacity = opacity;
for(var i=0, len=this.div.childNodes.length; i<len; ++i) {
var element = this.div.childNodes[i].firstChild;
OpenLayers.Util.modifyDOMElement(element, null, null, null,
null, null, null, opacity);
}
OpenLayers.Util.modifyDOMElement(this.div, null, null, null,
null, null, null, opacity);
if (this.map != null) {
this.map.events.triggerEvent("changelayer", {
layer: this,