Convert ol.DrawEvent#getFeature method into feature property

This commit is contained in:
Tom Payne
2014-01-23 20:31:18 +01:00
parent ec81a77cdb
commit 390b61762e
3 changed files with 11 additions and 12 deletions

View File

@@ -18,6 +18,15 @@ oli.CollectionEvent = function() {};
oli.CollectionEvent.prototype.element;
/** @interface */
oli.DrawEvent;
/** @type {ol.Feature} */
oli.DrawEvent.prototype.feature;
/** @interface */
oli.ObjectEvent;

View File

@@ -1,3 +1 @@
@exportSymbol ol.interaction.Draw
@exportProperty ol.DrawEvent.prototype.getFeature

View File

@@ -38,6 +38,7 @@ ol.DrawEventType = {
/**
* @constructor
* @extends {goog.events.Event}
* @implements {oli.DrawEvent}
* @param {ol.DrawEventType} type Type.
* @param {ol.Feature} feature The feature drawn.
*/
@@ -46,23 +47,14 @@ ol.DrawEvent = function(type, feature) {
goog.base(this, type);
/**
* @private
* @type {ol.Feature}
*/
this.feature_ = feature;
this.feature = feature;
};
goog.inherits(ol.DrawEvent, goog.events.Event);
/**
* @return {ol.Feature} The feature drawn to which this event pertains.
*/
ol.DrawEvent.prototype.getFeature = function() {
return this.feature_;
};
/**
* Interaction that allows drawing geometries