diff --git a/externs/oli.js b/externs/oli.js index 81bc3cd27a..a88d2f913a 100644 --- a/externs/oli.js +++ b/externs/oli.js @@ -18,6 +18,15 @@ oli.CollectionEvent = function() {}; oli.CollectionEvent.prototype.element; +/** @interface */ +oli.DrawEvent; + + +/** @type {ol.Feature} */ +oli.DrawEvent.prototype.feature; + + + /** @interface */ oli.ObjectEvent; diff --git a/src/ol/interaction/drawinteraction.exports b/src/ol/interaction/drawinteraction.exports index 5ebae98a99..890ae0f515 100644 --- a/src/ol/interaction/drawinteraction.exports +++ b/src/ol/interaction/drawinteraction.exports @@ -1,3 +1 @@ @exportSymbol ol.interaction.Draw - -@exportProperty ol.DrawEvent.prototype.getFeature diff --git a/src/ol/interaction/drawinteraction.js b/src/ol/interaction/drawinteraction.js index e0594c9d49..7702487b94 100644 --- a/src/ol/interaction/drawinteraction.js +++ b/src/ol/interaction/drawinteraction.js @@ -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