diff --git a/src/ol/TileCache.js b/src/ol/TileCache.js index 72ebbb5f29..e6eeaacc71 100644 --- a/src/ol/TileCache.js +++ b/src/ol/TileCache.js @@ -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.} 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; diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index f9172a30d3..b5a9138fb9 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -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 diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index f962145d45..b6c9b987b9 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -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]; } diff --git a/test/spec/ol/tilecache.test.js b/test/spec/ol/tilecache.test.js index f1f4735b4e..1089327b8e 100644 --- a/test/spec/ol/tilecache.test.js +++ b/test/spec/ol/tilecache.test.js @@ -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');