add an ol.TileCache and use it in ol.TileLayer
This commit is contained in:
29
src/ol/TileCache.js
Normal file
29
src/ol/TileCache.js
Normal file
@@ -0,0 +1,29 @@
|
||||
goog.provide('ol.TileCache');
|
||||
|
||||
goog.require('goog.structs.LinkedMap');
|
||||
|
||||
/**
|
||||
* A cache of ol.Tile objects.
|
||||
* @constructor
|
||||
* @extends {goog.structs.LinkedMap}
|
||||
* @param {number=} opt_size
|
||||
*/
|
||||
ol.TileCache = function(opt_size) {
|
||||
/**
|
||||
* @constant
|
||||
* @type {number}
|
||||
*/
|
||||
this.size_ = opt_size || 100;
|
||||
|
||||
goog.base(this, 1, true /* cache mode */);
|
||||
};
|
||||
|
||||
goog.inherits(ol.TileCache, goog.structs.LinkedMap);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.TileCache.prototype.removeNode = function(node) {
|
||||
goog.base(this, 'removeNode', node);
|
||||
node.value.destroy();
|
||||
};
|
||||
Reference in New Issue
Block a user