diff --git a/examples/modify-features.js b/examples/modify-features.js index ef900db35e..0a508d4dea 100644 --- a/examples/modify-features.js +++ b/examples/modify-features.js @@ -235,10 +235,8 @@ var overlay = new ol.render.FeaturesOverlay({ styleFunction: overlayStyle }); -var modify = new ol.interaction.Modify(overlay); -var select = new ol.interaction.Select({ - featuresOverlay: overlay -}); +var modify = new ol.interaction.Modify({ featuresOverlay: overlay }); +var select = new ol.interaction.Select({ featuresOverlay: overlay }); var map = new ol.Map({ interactions: ol.interaction.defaults().extend([select, modify]), diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index d2244f9c4d..fe3528acfc 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -440,6 +440,7 @@ * the styleFunction for the feature * @property {number|undefined} pixelTolerance Pixel tolerance for considering * the pointer close enough to a vertex for editing. Default is 20 pixels. + * @property {ol.render.FeaturesOverlay} featuresOverlay Features overlay. */ /** diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 462ae5ebed..10eeaa3de3 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -39,15 +39,12 @@ ol.interaction.SegmentDataType; /** * @constructor * @extends {ol.interaction.Drag} - * @param {ol.render.FeaturesOverlay} featuresOverlay FeaturesOverlay - * @param {olx.interaction.ModifyOptions=} opt_options Options. + * @param {olx.interaction.ModifyOptions} options Options. */ -ol.interaction.Modify = function(featuresOverlay, opt_options) { +ol.interaction.Modify = function(options) { goog.base(this); - var options = goog.isDef(opt_options) ? opt_options : {}; - /** * Editing vertex. @@ -93,7 +90,7 @@ ol.interaction.Modify = function(featuresOverlay, opt_options) { * @type {ol.render.FeaturesOverlay} * @private */ - this.overlay_ = featuresOverlay; + this.overlay_ = options.featuresOverlay; this.overlay_.getFeatures().listen(ol.CollectionEventType.ADD, this.addFeature_, false, this);