Fix Snap -> Interaction
This commit changes ol.Snap -> ol.interaction.Snap, which extends ol.interaction.Pointer. The 'pointerdown', 'pointermove' and 'pointerup' map browser events are hanlded to edit the pixel and coordinate properties to make them 'snap' to the closest feature.
This commit is contained in:
+37
-1
@@ -2450,7 +2450,7 @@ olx.interaction.ModifyOptions.prototype.deleteCondition;
|
||||
|
||||
/**
|
||||
* Pixel tolerance for considering the pointer close enough to a segment or
|
||||
* vertex for editing. Default is `10` pixels.
|
||||
* vertex for editing.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
@@ -2671,6 +2671,42 @@ olx.interaction.SelectOptions.prototype.toggleCondition;
|
||||
olx.interaction.SelectOptions.prototype.multi;
|
||||
|
||||
|
||||
/**
|
||||
* Options for snap
|
||||
* @typedef {{
|
||||
* features: (Array.<ol.Feature>|ol.Collection.<ol.Feature>|undefined),
|
||||
* pixelTolerance: (number|undefined),
|
||||
* source: (ol.source.Vector|undefined)
|
||||
* }}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.SnapOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Snap to this features
|
||||
* @type {Array.<ol.Feature>|ol.Collection.<ol.Feature>|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.SnapOptions.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* Pixel tolerance for considering the pointer close enough to a segment or
|
||||
* vertex for editing. Default is `10` pixels.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.SnapOptions.prototype.pixelTolerance;
|
||||
|
||||
|
||||
/**
|
||||
* Snap to features from this source
|
||||
* @type {ol.source.Vector|undefined}
|
||||
*/
|
||||
olx.interaction.SnapOptions.prototype.source;
|
||||
|
||||
|
||||
/**
|
||||
* Namespace.
|
||||
* @type {Object}
|
||||
|
||||
Reference in New Issue
Block a user