From a02163f01db20d44cfb886c442e8d4f42f4e415f Mon Sep 17 00:00:00 2001 From: ahocevar Date: Wed, 12 Dec 2012 16:48:23 +0100 Subject: [PATCH] No backbuffer removal delay needed with 3d enabled --- lib/OpenLayers/Layer/Grid.js | 48 +----------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 8791236cb6..3c77ac1b6d 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -189,24 +189,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { */ backBufferLonLat: null, - /** - * Property: backBufferTimerId - * {Number} The id of the back buffer timer. This timer is used to - * delay the removal of the back buffer, thereby preventing - * flash effects caused by tile animation. - */ - backBufferTimerId: null, - - /** - * APIProperty: removeBackBufferDelay - * {Number} Delay for removing the backbuffer when all tiles have finished - * loading. Can be set to 0 when no css opacity transitions for the - * olTileImage class are used. Default is 0 for layers, - * 2500 for tiled layers. See for more information on - * tile animation. - */ - removeBackBufferDelay: null, - /** * APIProperty: className * {String} Name of the class added to the layer div. If not set in the @@ -236,8 +218,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * transition: opacity 0.2s linear; * } * (end) - * In that case, to avoid flash effects, - * should not be zero. */ className: null, @@ -311,10 +291,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { this.tileQueue = []; this._removeBackBuffer = OpenLayers.Function.bind(this.removeBackBuffer, this); - if (this.removeBackBufferDelay === null) { - this.removeBackBufferDelay = this.singleTile ? 0 : 2500; - } - if (this.className === null) { this.className = this.singleTile ? 'olLayerGridSingleTile' : 'olLayerGrid'; @@ -354,10 +330,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { this.moveTimerId = null; } this.clearTileQueue(); - if(this.backBufferTimerId !== null) { - window.clearTimeout(this.backBufferTimerId); - this.backBufferTimerId = null; - } }, /** @@ -426,7 +398,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { obj.gridResolution = null; // same for backbuffer and tile queue obj.backBuffer = null; - obj.backBufferTimerId = null; obj.tileQueue = []; obj.tileQueueId = null; obj.loading = false; @@ -686,9 +657,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * resolution - {Number} The resolution to transition to. */ applyBackBuffer: function(resolution) { - if(this.backBufferTimerId !== null) { - this.removeBackBuffer(); - } var backBuffer = this.backBuffer; if(!backBuffer) { backBuffer = this.createBackBuffer(); @@ -778,10 +746,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { this.div.removeChild(this.backBuffer); this.backBuffer = null; this.backBufferResolution = null; - if(this.backBufferTimerId !== null) { - window.clearTimeout(this.backBufferTimerId); - this.backBufferTimerId = null; - } } }, @@ -1137,17 +1101,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { this.loading = false; this.events.triggerEvent("loadend"); if(this.backBuffer) { - this._transitionElement = tile.imgDiv; - for (var i=this.transitionendEvents.length-1; i>=0; --i) { - OpenLayers.Event.observe(this._transitionElement, - this.transitionendEvents[i], - this._removeBackBuffer); - } - // the removal of the back buffer is delayed to prevent - // flash effects due to the animation of tile displaying - this.backBufferTimerId = window.setTimeout( - this._removeBackBuffer, this.removeBackBufferDelay - ); + this.removeBackBuffer(); } } };