Merge pull request #6626 from ahocevar/reprojected-cache-size
Respect cacheSize for reprojected caches
This commit is contained in:
@@ -194,7 +194,7 @@ ol.source.TileImage.prototype.getTileCacheForProjection = function(projection) {
|
||||
} else {
|
||||
var projKey = ol.getUid(projection).toString();
|
||||
if (!(projKey in this.tileCacheForProjection)) {
|
||||
this.tileCacheForProjection[projKey] = new ol.TileCache();
|
||||
this.tileCacheForProjection[projKey] = new ol.TileCache(this.tileCache.highWaterMark);
|
||||
}
|
||||
return this.tileCacheForProjection[projKey];
|
||||
}
|
||||
|
||||
@@ -15,10 +15,9 @@ ol.TileCache = function(opt_highWaterMark) {
|
||||
ol.structs.LRUCache.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.highWaterMark_ = opt_highWaterMark !== undefined ? opt_highWaterMark : 2048;
|
||||
this.highWaterMark = opt_highWaterMark !== undefined ? opt_highWaterMark : 2048;
|
||||
|
||||
};
|
||||
ol.inherits(ol.TileCache, ol.structs.LRUCache);
|
||||
@@ -28,7 +27,7 @@ ol.inherits(ol.TileCache, ol.structs.LRUCache);
|
||||
* @return {boolean} Can expire cache.
|
||||
*/
|
||||
ol.TileCache.prototype.canExpireCache = function() {
|
||||
return this.getCount() > this.highWaterMark_;
|
||||
return this.getCount() > this.highWaterMark;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user