Added an 'alpha' option to Layer.Grid by which Layers can have the PNG alpha hack enabled on a per-Layer basis.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@840 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-06-30 15:41:40 +00:00
parent b064dce7f5
commit 44fee8a018
3 changed files with 7 additions and 5 deletions
+5 -1
View File
@@ -19,6 +19,10 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
// this is an array of rows, each row is an array of tiles // this is an array of rows, each row is an array of tiles
grid: null, grid: null,
// alpha: boolean
// asserts whether or not the layer's images have an alpha channel
alpha: false,
/** /**
* @param {str} name * @param {str} name
* @param {str} url * @param {str} url
@@ -161,7 +165,7 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
new OpenLayers.Pixel(tileoffsetx - parseInt(this.map.layerContainerDiv.style.left), new OpenLayers.Pixel(tileoffsetx - parseInt(this.map.layerContainerDiv.style.left),
tileoffsety - parseInt(this.map.layerContainerDiv.style.top)) tileoffsety - parseInt(this.map.layerContainerDiv.style.top))
); );
tile.draw((this.params.TRANSPARENT == 'true')); tile.draw(this.alpha);
row.append(tile); row.append(tile);
tileoffsetlon += tilelon; tileoffsetlon += tilelon;
+1 -1
View File
@@ -71,7 +71,7 @@ OpenLayers.Layer.WMS.prototype =
}, },
/** /**
* addTile creates a tile, initializes it (via 'draw' in this case), and * addTile creates a tile, initializes it, and
* adds it to the layer div. * adds it to the layer div.
* *
* @param {OpenLayers.Bounds} bounds * @param {OpenLayers.Bounds} bounds
+1 -3
View File
@@ -36,9 +36,7 @@ OpenLayers.Tile.Image.prototype =
/** /**
*/ */
draw:function(transparent) { draw:function(transparent) {
if (false) { // don't actually use the alpha PNG hack right now if (transparent) {
// it has a fiercely bad effect on IE6's performance
// if (transparent) {
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null, this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
this.position, this.position,
this.size, this.size,