Removing option for temporary layer
Instead, adding setter and getter for a private temp_ property, as suggested by @elemoine.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user