From 850aaf96f2f3db80e5b8424d317fa00c19c2b930 Mon Sep 17 00:00:00 2001 From: marcosox Date: Mon, 16 Oct 2017 15:46:12 +0200 Subject: [PATCH] Add pixelTolerance to olx.interaction.ExtentOptions --- externs/olx.js | 9 +++++++++ src/ol/interaction/extent.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/externs/olx.js b/externs/olx.js index 22e1921606..c4a5ebb218 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -3138,6 +3138,7 @@ olx.interaction.DrawOptions.prototype.wrapX; /** * @typedef {{extent: (ol.Extent|undefined), * boxStyle: (ol.style.Style|Array.|ol.StyleFunction|undefined), + * pixelTolerance: (number|undefined), * pointerStyle: (ol.style.Style|Array.|ol.StyleFunction|undefined), * wrapX: (boolean|undefined)}} * @api @@ -3159,6 +3160,14 @@ olx.interaction.ExtentOptions.prototype.extent; */ olx.interaction.ExtentOptions.prototype.boxStyle; +/** + * Pixel tolerance for considering the pointer close enough to a segment or + * vertex for editing. Default is `10`. + * @type {number|undefined} + * @api + */ +olx.interaction.ExtentOptions.prototype.pixelTolerance; + /** * Style for the cursor used to draw the extent. * Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POINT] diff --git a/src/ol/interaction/extent.js b/src/ol/interaction/extent.js index 4373893872..0443b5e7e4 100644 --- a/src/ol/interaction/extent.js +++ b/src/ol/interaction/extent.js @@ -31,7 +31,7 @@ goog.require('ol.style.Style'); */ ol.interaction.Extent = function(opt_options) { - var options = opt_options ? opt_options : {}; + var options = opt_options || {}; /** * Extent of the drawn box