Fix - support ol.Collection only as features
This commit is contained in:
+2
-2
@@ -2674,7 +2674,7 @@ olx.interaction.SelectOptions.prototype.multi;
|
|||||||
/**
|
/**
|
||||||
* Options for snap
|
* Options for snap
|
||||||
* @typedef {{
|
* @typedef {{
|
||||||
* features: (Array.<ol.Feature>|ol.Collection.<ol.Feature>|undefined),
|
* features: (ol.Collection.<ol.Feature>|undefined),
|
||||||
* pixelTolerance: (number|undefined),
|
* pixelTolerance: (number|undefined),
|
||||||
* source: (ol.source.Vector|undefined)
|
* source: (ol.source.Vector|undefined)
|
||||||
* }}
|
* }}
|
||||||
@@ -2685,7 +2685,7 @@ olx.interaction.SnapOptions;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Snap to these features. Either this option or source should be provided.
|
* Snap to these features. Either this option or source should be provided.
|
||||||
* @type {Array.<ol.Feature>|ol.Collection.<ol.Feature>|undefined}
|
* @type {ol.Collection.<ol.Feature>|undefined}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.interaction.SnapOptions.prototype.features;
|
olx.interaction.SnapOptions.prototype.features;
|
||||||
|
|||||||
@@ -65,11 +65,7 @@ ol.interaction.Snap = function(opt_options) {
|
|||||||
* @type {?ol.Collection.<ol.Feature>}
|
* @type {?ol.Collection.<ol.Feature>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.features_ = goog.isDef(options.features) ?
|
this.features_ = goog.isDef(options.features) ? options.features : null;
|
||||||
goog.isArray(options.features) ?
|
|
||||||
new ol.Collection(options.features) :
|
|
||||||
options.features :
|
|
||||||
null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.Collection.<goog.events.Key>}
|
* @type {ol.Collection.<goog.events.Key>}
|
||||||
|
|||||||
Reference in New Issue
Block a user