Improved reprioritization

This commit is contained in:
Éric Lemoine
2013-01-11 18:13:36 +01:00
committed by Tom Payne
parent 52df441cf8
commit 25be29099f

View File

@@ -105,11 +105,12 @@ ol.TileQueue.prototype.loadMoreTiles = function() {
*/ */
ol.TileQueue.prototype.reprioritize = function() { ol.TileQueue.prototype.reprioritize = function() {
if (!this.queue_.isEmpty()) { if (!this.queue_.isEmpty()) {
var queue = this.queue_; var values = /** @type {Array.<Array>} */ this.queue_.getValues();
this.queue_ = new goog.structs.PriorityQueue(); this.queue_.clear();
this.queuedTileKeys_ = {}; this.queuedTileKeys_ = {};
while (!queue.isEmpty()) { var i;
this.enqueue.apply(this, /** @type {Array} */ (queue.remove())); for (i = 0; i < values.length; ++i) {
this.enqueue.apply(this, values[i]);
} }
} }
}; };