From 9ef5f0b060bf233bb2e10915103401a3098b750f Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sat, 19 Jan 2013 21:58:01 +0100 Subject: [PATCH] Ensure dropped tiles are properly removed from tile queue --- src/ol/tilequeue.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ol/tilequeue.js b/src/ol/tilequeue.js index baf61b1e06..c1f3554f14 100644 --- a/src/ol/tilequeue.js +++ b/src/ol/tilequeue.js @@ -245,14 +245,17 @@ ol.TileQueue.prototype.siftDown_ = function(startIndex, index) { */ ol.TileQueue.prototype.reprioritize = function() { var heap = this.heap_; - var i, n = 0, node, priority, tile, tileCenter, tileSourceKey; + var i, n = 0, node, priority, tile, tileCenter, tileKey, tileSourceKey; for (i = 0; i < heap.length; ++i) { node = heap[i]; tile = /** @type {ol.Tile} */ (node[1]); tileSourceKey = /** @type {string} */ (node[2]); tileCenter = /** @type {ol.Coordinate} */ (node[3]); priority = this.tilePriorityFunction_(tile, tileSourceKey, tileCenter); - if (priority != ol.TileQueue.DROP) { + if (priority == ol.TileQueue.DROP) { + tileKey = tile.getKey(); + delete this.queuedTileKeys_[tileKey]; + } else { node[0] = priority; heap[n++] = node; }