No backbuffer removal delay needed with 3d enabled
This commit is contained in:
@@ -189,24 +189,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
*/
|
*/
|
||||||
backBufferLonLat: null,
|
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
|
* APIProperty: className
|
||||||
* {String} Name of the class added to the layer div. If not set in the
|
* {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;
|
* transition: opacity 0.2s linear;
|
||||||
* }
|
* }
|
||||||
* (end)
|
* (end)
|
||||||
* In that case, to avoid flash effects, <removeBackBufferDelay>
|
|
||||||
* should not be zero.
|
|
||||||
*/
|
*/
|
||||||
className: null,
|
className: null,
|
||||||
|
|
||||||
@@ -311,10 +291,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
this.tileQueue = [];
|
this.tileQueue = [];
|
||||||
this._removeBackBuffer = OpenLayers.Function.bind(this.removeBackBuffer, this);
|
this._removeBackBuffer = OpenLayers.Function.bind(this.removeBackBuffer, this);
|
||||||
|
|
||||||
if (this.removeBackBufferDelay === null) {
|
|
||||||
this.removeBackBufferDelay = this.singleTile ? 0 : 2500;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.className === null) {
|
if (this.className === null) {
|
||||||
this.className = this.singleTile ? 'olLayerGridSingleTile' :
|
this.className = this.singleTile ? 'olLayerGridSingleTile' :
|
||||||
'olLayerGrid';
|
'olLayerGrid';
|
||||||
@@ -354,10 +330,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
this.moveTimerId = null;
|
this.moveTimerId = null;
|
||||||
}
|
}
|
||||||
this.clearTileQueue();
|
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;
|
obj.gridResolution = null;
|
||||||
// same for backbuffer and tile queue
|
// same for backbuffer and tile queue
|
||||||
obj.backBuffer = null;
|
obj.backBuffer = null;
|
||||||
obj.backBufferTimerId = null;
|
|
||||||
obj.tileQueue = [];
|
obj.tileQueue = [];
|
||||||
obj.tileQueueId = null;
|
obj.tileQueueId = null;
|
||||||
obj.loading = false;
|
obj.loading = false;
|
||||||
@@ -686,9 +657,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
* resolution - {Number} The resolution to transition to.
|
* resolution - {Number} The resolution to transition to.
|
||||||
*/
|
*/
|
||||||
applyBackBuffer: function(resolution) {
|
applyBackBuffer: function(resolution) {
|
||||||
if(this.backBufferTimerId !== null) {
|
|
||||||
this.removeBackBuffer();
|
|
||||||
}
|
|
||||||
var backBuffer = this.backBuffer;
|
var backBuffer = this.backBuffer;
|
||||||
if(!backBuffer) {
|
if(!backBuffer) {
|
||||||
backBuffer = this.createBackBuffer();
|
backBuffer = this.createBackBuffer();
|
||||||
@@ -778,10 +746,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
this.div.removeChild(this.backBuffer);
|
this.div.removeChild(this.backBuffer);
|
||||||
this.backBuffer = null;
|
this.backBuffer = null;
|
||||||
this.backBufferResolution = 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.loading = false;
|
||||||
this.events.triggerEvent("loadend");
|
this.events.triggerEvent("loadend");
|
||||||
if(this.backBuffer) {
|
if(this.backBuffer) {
|
||||||
this._transitionElement = tile.imgDiv;
|
this.removeBackBuffer();
|
||||||
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
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user