Remove ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK
This commit is contained in:
@@ -1,5 +1,19 @@
|
|||||||
## Upgrade notes
|
## Upgrade notes
|
||||||
|
|
||||||
|
### v3.15.0
|
||||||
|
|
||||||
|
#### Removal of `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK`
|
||||||
|
|
||||||
|
The `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK` define has been removed. The size of the cache can now be defined on every tile based `ol.source`:
|
||||||
|
```js
|
||||||
|
new ol.layer.Tile({
|
||||||
|
source: new ol.source.OSM({
|
||||||
|
cacheSize: 128
|
||||||
|
})
|
||||||
|
})
|
||||||
|
```
|
||||||
|
The default cache size is `2048`.
|
||||||
|
|
||||||
### v3.14.0
|
### v3.14.0
|
||||||
|
|
||||||
#### Internet Explorer 9 support
|
#### Internet Explorer 9 support
|
||||||
|
|||||||
@@ -35,12 +35,6 @@ ol.DEFAULT_MIN_ZOOM = 0;
|
|||||||
ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD = 0.5;
|
ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD = 0.5;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @define {number} Default high water mark.
|
|
||||||
*/
|
|
||||||
ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK = 2048;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @define {number} Default tile size.
|
* @define {number} Default tile size.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,12 +26,9 @@ goog.require('ol.source.UrlTile');
|
|||||||
*/
|
*/
|
||||||
ol.source.VectorTile = function(options) {
|
ol.source.VectorTile = function(options) {
|
||||||
|
|
||||||
var cacheSize = options.cacheSize !== undefined ?
|
|
||||||
options.cacheSize : ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK / 16;
|
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
attributions: options.attributions,
|
attributions: options.attributions,
|
||||||
cacheSize: cacheSize,
|
cacheSize: options.cacheSize !== undefined ? options.cacheSize : 128,
|
||||||
extent: options.extent,
|
extent: options.extent,
|
||||||
logo: options.logo,
|
logo: options.logo,
|
||||||
opaque: options.opaque,
|
opaque: options.opaque,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
goog.provide('ol.TileCache');
|
goog.provide('ol.TileCache');
|
||||||
|
|
||||||
goog.require('ol');
|
|
||||||
goog.require('ol.TileRange');
|
goog.require('ol.TileRange');
|
||||||
goog.require('ol.structs.LRUCache');
|
goog.require('ol.structs.LRUCache');
|
||||||
goog.require('ol.tilecoord');
|
goog.require('ol.tilecoord');
|
||||||
@@ -20,8 +19,7 @@ ol.TileCache = function(opt_highWaterMark) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.highWaterMark_ = opt_highWaterMark !== undefined ?
|
this.highWaterMark_ = opt_highWaterMark !== undefined ? opt_highWaterMark : 2048;
|
||||||
opt_highWaterMark : ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.TileCache, ol.structs.LRUCache);
|
goog.inherits(ol.TileCache, ol.structs.LRUCache);
|
||||||
|
|||||||
Reference in New Issue
Block a user