Boost number of loading tiles when not animating or interacting

This commit is contained in:
Tom Payne
2013-04-07 18:25:19 +02:00
parent da6f4cc764
commit b93283e8f3
2 changed files with 11 additions and 21 deletions

View File

@@ -68,19 +68,19 @@ ol.TileQueue.prototype.handleTileChange = function() {
/**
* @param {number} limit Maximum number of new tiles to load.
* @param {number} maxTilesLoading Maximum number tiles to load simultaneously.
* @param {number} maxTotalLoading Maximum number tiles to load simultaneously.
* @param {number} maxNewLoads Maximum number of new tiles to load.
*/
ol.TileQueue.prototype.loadMoreTiles = function(limit, maxTilesLoading) {
ol.TileQueue.prototype.loadMoreTiles = function(maxTotalLoading, maxNewLoads) {
var tile;
while (limit > 0 &&
while (maxNewLoads > 0 &&
!this.isEmpty() &&
this.tilesLoading_ < maxTilesLoading) {
this.tilesLoading_ < maxTotalLoading) {
tile = /** @type {ol.Tile} */ (this.dequeue()[0]);
goog.events.listenOnce(tile, goog.events.EventType.CHANGE,
this.handleTileChange, false, this);
tile.load();
++this.tilesLoading_;
--limit;
--maxNewLoads;
}
};