New tile image cache and tile queue improvements

We now reuse tile images by maintaining a cache of image elements with a
simplified LRU expiry policy (by order, not by timestamp). The tile queue
is bypassed for images that are available in the cache, so they can be
rendered immediately. And the tile queue itself loads more than just one
image at a time now (2 per layer url).
This commit is contained in:
ahocevar
2012-11-16 16:19:59 +01:00
parent 810d9ea95d
commit 2ee362a79b
3 changed files with 125 additions and 23 deletions
+4 -4
View File
@@ -201,13 +201,13 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
},
/**
* Method: drawTileFromQueue
* Draws the first tile from the tileQueue, and unqueues that tile
* Method: drawTilesFromQueue
* Draws tiles from the tileQueue, and unqueues the tiles
*/
drawTileFromQueue: function() {
drawTilesFromQueue: function() {
// don't start working on the queue before we have a url from initLayer
if (this.url) {
OpenLayers.Layer.XYZ.prototype.drawTileFromQueue.apply(this, arguments);
OpenLayers.Layer.XYZ.prototype.drawTilesFromQueue.apply(this, arguments);
}
},