Make interaction ctor only have an option object
This commit is contained in:
@@ -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]),
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user