No backbuffer removal delay needed with 3d enabled

This commit is contained in:
ahocevar
2012-12-12 16:48:23 +01:00
parent eb65336fa9
commit a02163f01d

View File

@@ -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 <singleTile> layers,
* 2500 for tiled layers. See <className> 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, <removeBackBufferDelay>
* 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();
}
}
};