Convert ol.DrawEvent#getFeature method into feature property
This commit is contained in:
@@ -18,6 +18,15 @@ oli.CollectionEvent = function() {};
|
||||
oli.CollectionEvent.prototype.element;
|
||||
|
||||
|
||||
/** @interface */
|
||||
oli.DrawEvent;
|
||||
|
||||
|
||||
/** @type {ol.Feature} */
|
||||
oli.DrawEvent.prototype.feature;
|
||||
|
||||
|
||||
|
||||
/** @interface */
|
||||
oli.ObjectEvent;
|
||||
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
@exportSymbol ol.interaction.Draw
|
||||
|
||||
@exportProperty ol.DrawEvent.prototype.getFeature
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user