Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions

View File

@@ -1,9 +1,9 @@
goog.provide('ol.TileCache');
goog.require('ol');
goog.require('ol.structs.LRUCache');
goog.require('ol.tilecoord');
/**
* @module ol/TileCache
*/
import _ol_ from './index.js';
import _ol_structs_LRUCache_ from './structs/LRUCache.js';
import _ol_tilecoord_ from './tilecoord.js';
/**
* @constructor
@@ -11,18 +11,19 @@ goog.require('ol.tilecoord');
* @param {number=} opt_highWaterMark High water mark.
* @struct
*/
ol.TileCache = function(opt_highWaterMark) {
var _ol_TileCache_ = function(opt_highWaterMark) {
ol.structs.LRUCache.call(this, opt_highWaterMark);
_ol_structs_LRUCache_.call(this, opt_highWaterMark);
};
ol.inherits(ol.TileCache, ol.structs.LRUCache);
_ol_.inherits(_ol_TileCache_, _ol_structs_LRUCache_);
/**
* @param {Object.<string, ol.TileRange>} usedTiles Used tiles.
*/
ol.TileCache.prototype.expireCache = function(usedTiles) {
_ol_TileCache_.prototype.expireCache = function(usedTiles) {
var tile, zKey;
while (this.canExpireCache()) {
tile = this.peekLast();
@@ -39,17 +40,18 @@ 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() {
_ol_TileCache_.prototype.pruneExceptNewestZ = function() {
if (this.getCount() === 0) {
return;
}
var key = this.peekFirstKey();
var tileCoord = ol.tilecoord.fromKey(key);
var tileCoord = _ol_tilecoord_.fromKey(key);
var z = tileCoord[0];
this.forEach(function(tile) {
if (tile.tileCoord[0] !== z) {
this.remove(ol.tilecoord.getKey(tile.tileCoord));
this.remove(_ol_tilecoord_.getKey(tile.tileCoord));
tile.dispose();
}
}, this);
};
export default _ol_TileCache_;