Tile opacity patch from tschaub: Fix for #235. Also includes tests to ensure

that code works.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1433 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-09-11 14:30:25 +00:00
parent 720c8507f7
commit 4a65590d3e
4 changed files with 53 additions and 0 deletions
+12
View File
@@ -435,6 +435,18 @@ OpenLayers.Layer.prototype = {
Math.round(1/resolution * (extent.top - lonlat.lat))
);
},
/**
* Sets the opacity for the entire layer (all images)
* @param {Float} opacity
*/
setOpacity: function(opacity) {
this.opacity = opacity;
for(var i=0; i<this.div.childNodes.length; ++i) {
var element = this.div.childNodes[i];
OpenLayers.Util.setOpacity(element, opacity);
}
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Layer"