Add a clickTolerance option to the Draw interaction

This commit is contained in:
Éric Lemoine
2015-06-05 16:09:51 +02:00
parent bad5a97d20
commit e99f43af8d
3 changed files with 47 additions and 6 deletions

View File

@@ -2356,7 +2356,8 @@ olx.interaction.DragZoomOptions.prototype.style;
/**
* @typedef {{features: (ol.Collection.<ol.Feature>|undefined),
* @typedef {{clickTolerance: (number|undefined),
* features: (ol.Collection.<ol.Feature>|undefined),
* source: (ol.source.Vector|undefined),
* snapTolerance: (number|undefined),
* type: ol.geom.GeometryType,
@@ -2372,6 +2373,18 @@ olx.interaction.DragZoomOptions.prototype.style;
olx.interaction.DrawOptions;
/**
* The maximum distance in pixels between "down" and "up" for a "up" event
* to be considered a "click" event and actually add a point/vertex to the
* geometry being drawn. Default is 6 pixels. That value was chosen for
* the draw interaction to behave correctly on mouse as well as on touch
* devices.
* @type {number|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.clickTolerance;
/**
* Destination collection for the drawn features.
* @type {ol.Collection.<ol.Feature>|undefined}