Only reprioritize tile queue when more tiles will be loaded

This commit is contained in:
Tom Payne
2013-04-07 18:31:56 +02:00
parent b93283e8f3
commit 5b133d40d9
2 changed files with 12 additions and 2 deletions

View File

@@ -586,8 +586,10 @@ ol.Map.prototype.handlePostRender = function() {
}
}
this.tileQueue_.reprioritize(); // FIXME only call if needed
if (this.tileQueue_.getTilesLoading() < maxTotalLoading) {
this.tileQueue_.reprioritize(); // FIXME only call if view has changed
this.tileQueue_.loadMoreTiles(maxTotalLoading, maxNewLoads);
}
var postRenderFunctions = this.postRenderFunctions_;
var i;

View File

@@ -58,6 +58,14 @@ ol.TileQueue = function(tilePriorityFunction, tileChangeCallback) {
goog.inherits(ol.TileQueue, ol.structs.PriorityQueue);
/**
* @return {number} Number of tiles loading.
*/
ol.TileQueue.prototype.getTilesLoading = function() {
return this.tilesLoading_;
};
/**
* @protected
*/