Rename ol.style.IconImageCache to ol.style.IconImageCache_

This commit is contained in:
Frederic Junod
2016-08-09 13:25:07 +02:00
parent fbb585c5d8
commit ce3346a477
+9 -9
View File
@@ -640,7 +640,7 @@ ol.style.IconImage_.prototype.unlistenImage_ = function() {
* @constructor * @constructor
* @private * @private
*/ */
ol.style.IconImageCache = function() { ol.style.IconImageCache_ = function() {
/** /**
* @type {Object.<string, ol.style.IconImage_>} * @type {Object.<string, ol.style.IconImage_>}
@@ -669,7 +669,7 @@ ol.style.IconImageCache = function() {
* @param {ol.Color} color Color. * @param {ol.Color} color Color.
* @return {string} Cache key. * @return {string} Cache key.
*/ */
ol.style.IconImageCache.getKey = function(src, crossOrigin, color) { ol.style.IconImageCache_.getKey = function(src, crossOrigin, color) {
goog.DEBUG && console.assert(crossOrigin !== undefined, goog.DEBUG && console.assert(crossOrigin !== undefined,
'argument crossOrigin must be defined'); 'argument crossOrigin must be defined');
var colorString = color ? ol.color.asString(color) : 'null'; var colorString = color ? ol.color.asString(color) : 'null';
@@ -680,7 +680,7 @@ ol.style.IconImageCache.getKey = function(src, crossOrigin, color) {
/** /**
* FIXME empty description for jsdoc * FIXME empty description for jsdoc
*/ */
ol.style.IconImageCache.prototype.clear = function() { ol.style.IconImageCache_.prototype.clear = function() {
this.cache_ = {}; this.cache_ = {};
this.cacheSize_ = 0; this.cacheSize_ = 0;
}; };
@@ -689,7 +689,7 @@ ol.style.IconImageCache.prototype.clear = function() {
/** /**
* FIXME empty description for jsdoc * FIXME empty description for jsdoc
*/ */
ol.style.IconImageCache.prototype.expire = function() { ol.style.IconImageCache_.prototype.expire = function() {
if (this.cacheSize_ > this.maxCacheSize_) { if (this.cacheSize_ > this.maxCacheSize_) {
var i = 0; var i = 0;
var key, iconImage; var key, iconImage;
@@ -710,8 +710,8 @@ ol.style.IconImageCache.prototype.expire = function() {
* @param {ol.Color} color Color. * @param {ol.Color} color Color.
* @return {ol.style.IconImage_} Icon image. * @return {ol.style.IconImage_} Icon image.
*/ */
ol.style.IconImageCache.prototype.get = function(src, crossOrigin, color) { ol.style.IconImageCache_.prototype.get = function(src, crossOrigin, color) {
var key = ol.style.IconImageCache.getKey(src, crossOrigin, color); var key = ol.style.IconImageCache_.getKey(src, crossOrigin, color);
return key in this.cache_ ? this.cache_[key] : null; return key in this.cache_ ? this.cache_[key] : null;
}; };
@@ -722,12 +722,12 @@ ol.style.IconImageCache.prototype.get = function(src, crossOrigin, color) {
* @param {ol.Color} color Color. * @param {ol.Color} color Color.
* @param {ol.style.IconImage_} iconImage Icon image. * @param {ol.style.IconImage_} iconImage Icon image.
*/ */
ol.style.IconImageCache.prototype.set = function(src, crossOrigin, color, ol.style.IconImageCache_.prototype.set = function(src, crossOrigin, color,
iconImage) { iconImage) {
var key = ol.style.IconImageCache.getKey(src, crossOrigin, color); var key = ol.style.IconImageCache_.getKey(src, crossOrigin, color);
this.cache_[key] = iconImage; this.cache_[key] = iconImage;
++this.cacheSize_; ++this.cacheSize_;
}; };
ol.style.iconImageCache = new ol.style.IconImageCache(); ol.style.iconImageCache = new ol.style.IconImageCache_();