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;
|
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.
|
* @define {number} Maximum new tile loads per frame.
|
||||||
*/
|
*/
|
||||||
@@ -279,7 +285,9 @@ ol.Map = function(mapOptions) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {ol.TileQueue}
|
* @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.bind(this.handleTileChange_, this));
|
||||||
|
|
||||||
goog.events.listen(this, ol.Object.getChangedEventType(ol.MapProperty.VIEW),
|
goog.events.listen(this, ol.Object.getChangedEventType(ol.MapProperty.VIEW),
|
||||||
|
|||||||
@@ -18,12 +18,15 @@ ol.TilePriorityFunction;
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.structs.PriorityQueue}
|
* @extends {ol.structs.PriorityQueue}
|
||||||
|
* @param {number} maxTilesLoading Maximum number of simultaneously loading
|
||||||
|
* tiles.
|
||||||
* @param {ol.TilePriorityFunction} tilePriorityFunction
|
* @param {ol.TilePriorityFunction} tilePriorityFunction
|
||||||
* Tile priority function.
|
* Tile priority function.
|
||||||
* @param {Function} tileChangeCallback
|
* @param {Function} tileChangeCallback
|
||||||
* Function called on each tile change event.
|
* Function called on each tile change event.
|
||||||
*/
|
*/
|
||||||
ol.TileQueue = function(tilePriorityFunction, tileChangeCallback) {
|
ol.TileQueue =
|
||||||
|
function(maxTilesLoading, tilePriorityFunction, tileChangeCallback) {
|
||||||
|
|
||||||
goog.base(
|
goog.base(
|
||||||
this,
|
this,
|
||||||
@@ -52,7 +55,7 @@ ol.TileQueue = function(tilePriorityFunction, tileChangeCallback) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.maxTilesLoading_ = 8;
|
this.maxTilesLoading_ = maxTilesLoading;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
Reference in New Issue
Block a user