Prerender labels and cache them as images

This commit is contained in:
Andreas Hocevar
2017-08-31 16:19:33 +02:00
parent 5f2b729c74
commit 35bd92b713
15 changed files with 211 additions and 258 deletions

View File

@@ -10,8 +10,14 @@ goog.require('ol.asserts');
* @constructor
* @struct
* @template T
* @param {number=} opt_highWaterMark High water mark.
*/
ol.structs.LRUCache = function() {
ol.structs.LRUCache = function(opt_highWaterMark) {
/**
* @type {number}
*/
this.highWaterMark = opt_highWaterMark !== undefined ? opt_highWaterMark : 2048;
/**
* @private
@@ -40,6 +46,14 @@ ol.structs.LRUCache = function() {
};
/**
* @return {boolean} Can expire cache.
*/
ol.structs.LRUCache.prototype.canExpireCache = function() {
return this.getCount() > this.highWaterMark;
};
/**
* FIXME empty description for jsdoc
*/