diff --git a/src/ol/feature.js b/src/ol/feature.js index 6414970982..603c6be8f9 100644 --- a/src/ol/feature.js +++ b/src/ol/feature.js @@ -24,6 +24,12 @@ ol.Feature = function(geometryOrValues) { goog.base(this); + /** + * @private + * @type {number|string|undefined} + */ + this.id_ = undefined; + /** * @private * @type {number} @@ -74,6 +80,14 @@ goog.exportProperty( ol.Feature.prototype.getGeometry); +/** + * @return {number|string|undefined} Id. + */ +ol.Feature.prototype.getId = function() { + return this.id_; +}; + + /** * @return {number} Revision. */ @@ -117,3 +131,11 @@ goog.exportProperty( ol.Feature.prototype, 'setGeometry', ol.Feature.prototype.setGeometry); + + +/** + * @param {number|string|undefined} id Id. + */ +ol.Feature.prototype.setId = function(id) { + this.id_ = id; +};