From 8e0793b191bbece1c314e30079f22351600c3673 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Thu, 22 Jun 2006 19:02:33 +0000 Subject: [PATCH] Only draw transparent images if the tiles are transparent. git-svn-id: http://svn.openlayers.org/trunk/openlayers@681 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Grid.js | 2 +- lib/OpenLayers/Tile/Image.js | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 5bc9785bca..e93b634e29 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -146,7 +146,7 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), { new OpenLayers.Pixel(tileoffsetx - parseInt(this.map.layerContainerDiv.style.left), tileoffsety - parseInt(this.map.layerContainerDiv.style.top)) ); - tile.draw(); + tile.draw((this.params.TRANSPARENT == true)); row.append(tile); tileoffsetlon += tilelon; diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index e4b113cdc4..fa201ed675 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -35,12 +35,20 @@ OpenLayers.Tile.Image.prototype = /** */ - draw:function() { - this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null, - this.position, - this.size, - this.url, - "absolute"); + draw:function(transparent) { + if (transparent) { + this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null, + this.position, + this.size, + this.url, + "absolute"); + } else { + this.imgDiv = OpenLayers.Util.createImage(null, + this.position, + this.size, + this.url, + "absolute"); + } this.layer.div.appendChild(this.imgDiv); },