Rename _ol_TileCache_ to TileCache

This commit is contained in:
Frederic Junod
2017-12-17 09:07:20 +01:00
parent f96a94fbcd
commit f4305de074
4 changed files with 11 additions and 11 deletions

View File

@@ -11,19 +11,19 @@ import _ol_tilecoord_ from './tilecoord.js';
* @param {number=} opt_highWaterMark High water mark.
* @struct
*/
var _ol_TileCache_ = function(opt_highWaterMark) {
var TileCache = function(opt_highWaterMark) {
LRUCache.call(this, opt_highWaterMark);
};
inherits(_ol_TileCache_, LRUCache);
inherits(TileCache, LRUCache);
/**
* @param {Object.<string, ol.TileRange>} usedTiles Used tiles.
*/
_ol_TileCache_.prototype.expireCache = function(usedTiles) {
TileCache.prototype.expireCache = function(usedTiles) {
var tile, zKey;
while (this.canExpireCache()) {
tile = this.peekLast();
@@ -40,7 +40,7 @@ _ol_TileCache_.prototype.expireCache = function(usedTiles) {
/**
* Prune all tiles from the cache that don't have the same z as the newest tile.
*/
_ol_TileCache_.prototype.pruneExceptNewestZ = function() {
TileCache.prototype.pruneExceptNewestZ = function() {
if (this.getCount() === 0) {
return;
}
@@ -54,4 +54,4 @@ _ol_TileCache_.prototype.pruneExceptNewestZ = function() {
}
}, this);
};
export default _ol_TileCache_;
export default TileCache;

View File

@@ -2,7 +2,7 @@
* @module ol/source/Tile
*/
import {inherits, nullFunction} from '../index.js';
import _ol_TileCache_ from '../TileCache.js';
import TileCache from '../TileCache.js';
import _ol_TileState_ from '../TileState.js';
import Event from '../events/Event.js';
import {equivalent} from '../proj.js';
@@ -56,7 +56,7 @@ var _ol_source_Tile_ = function(options) {
* @protected
* @type {ol.TileCache}
*/
this.tileCache = new _ol_TileCache_(options.cacheSize);
this.tileCache = new TileCache(options.cacheSize);
/**
* @protected

View File

@@ -4,7 +4,7 @@
import {ENABLE_RASTER_REPROJECTION} from '../reproj/common.js';
import {getUid, inherits} from '../index.js';
import _ol_ImageTile_ from '../ImageTile.js';
import _ol_TileCache_ from '../TileCache.js';
import TileCache from '../TileCache.js';
import _ol_TileState_ from '../TileState.js';
import _ol_events_ from '../events.js';
import EventType from '../events/EventType.js';
@@ -193,7 +193,7 @@ _ol_source_TileImage_.prototype.getTileCacheForProjection = function(projection)
} else {
var projKey = getUid(projection).toString();
if (!(projKey in this.tileCacheForProjection)) {
this.tileCacheForProjection[projKey] = new _ol_TileCache_(this.tileCache.highWaterMark);
this.tileCacheForProjection[projKey] = new TileCache(this.tileCache.highWaterMark);
}
return this.tileCacheForProjection[projKey];
}

View File

@@ -1,5 +1,5 @@
import _ol_Tile_ from '../../../src/ol/Tile.js';
import _ol_TileCache_ from '../../../src/ol/TileCache.js';
import TileCache from '../../../src/ol/TileCache.js';
import _ol_tilecoord_ from '../../../src/ol/tilecoord.js';
@@ -16,7 +16,7 @@ describe('ol.TileCache', function() {
new _ol_Tile_([2, 2, 0]),
new _ol_Tile_([2, 3, 0]) // newest tile at z: 2
];
var cache = new _ol_TileCache_();
var cache = new TileCache();
sinon.spy(tiles[0], 'dispose');