Move configuration of maximum tiles loading into map.js

This commit is contained in:
Tom Payne
2013-04-04 23:49:21 +02:00
parent 71d1207201
commit 0e12d16c37
2 changed files with 14 additions and 3 deletions

View File

@@ -77,6 +77,12 @@ ol.ENABLE_DOM = true;
ol.ENABLE_WEBGL = true;
/**
* @define {number} Maximum number of simultaneously loading tiles.
*/
ol.MAXIMUM_TILES_LOADING = 8;
/**
* @define {number} Maximum new tile loads per frame.
*/
@@ -279,7 +285,9 @@ ol.Map = function(mapOptions) {
* @private
* @type {ol.TileQueue}
*/
this.tileQueue_ = new ol.TileQueue(goog.bind(this.getTilePriority, this),
this.tileQueue_ = new ol.TileQueue(
ol.MAXIMUM_TILES_LOADING,
goog.bind(this.getTilePriority, this),
goog.bind(this.handleTileChange_, this));
goog.events.listen(this, ol.Object.getChangedEventType(ol.MapProperty.VIEW),

View File

@@ -18,12 +18,15 @@ ol.TilePriorityFunction;
/**
* @constructor
* @extends {ol.structs.PriorityQueue}
* @param {number} maxTilesLoading Maximum number of simultaneously loading
* tiles.
* @param {ol.TilePriorityFunction} tilePriorityFunction
* Tile priority function.
* @param {Function} tileChangeCallback
* Function called on each tile change event.
*/
ol.TileQueue = function(tilePriorityFunction, tileChangeCallback) {
ol.TileQueue =
function(maxTilesLoading, tilePriorityFunction, tileChangeCallback) {
goog.base(
this,
@@ -52,7 +55,7 @@ ol.TileQueue = function(tilePriorityFunction, tileChangeCallback) {
* @private
* @type {number}
*/
this.maxTilesLoading_ = 8;
this.maxTilesLoading_ = maxTilesLoading;
/**
* @private