Move configuration of maximum tiles loading into map.js
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user