Removing option for temporary layer

Instead, adding setter and getter for a private temp_ property,
as suggested by @elemoine.
This commit is contained in:
ahocevar
2013-08-21 09:52:52 +02:00
parent 3a50a754aa
commit 56c228d009
4 changed files with 24 additions and 7 deletions

View File

@@ -303,8 +303,9 @@ ol.layer.Vector = function(options) {
/**
* True if this is a temporary layer.
* @type {boolean}
* @private
*/
this.temp = goog.isDef(options.temp) ? options.temp : false;
this.temp_ = false;
};
goog.inherits(ol.layer.Vector, ol.layer.Layer);
@@ -343,6 +344,14 @@ ol.layer.Vector.prototype.clear = function() {
};
/**
* @return {boolean} Whether this layer is temporary.
*/
ol.layer.Vector.prototype.getTemporary = function() {
return this.temp_;
};
/**
* @return {ol.source.Vector} Source.
*/
@@ -604,6 +613,14 @@ ol.layer.Vector.prototype.setRenderIntent = function(renderIntent, features) {
};
/**
* @param {boolean} temp Whether this layer is temporary.
*/
ol.layer.Vector.prototype.setTemporary = function(temp) {
this.temp_ = temp;
};
/**
* @param {Array.<ol.Feature>} features Features.
* @return {string} Feature info.