From d40dd695cbfdecf2791155a6e1a8cae222fafee5 Mon Sep 17 00:00:00 2001 From: marcosox Date: Fri, 6 Oct 2017 18:37:25 +0200 Subject: [PATCH] Pass pixel tolerance as a parameter to constructor of ol.interaction.Extent This adds the pixelTolerance option parameter to the constructor of ol.interaction.Extent. In this way the user can override the current default value of 10. --- src/ol/interaction/extent.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ol/interaction/extent.js b/src/ol/interaction/extent.js index 66f7dc9897..4373893872 100644 --- a/src/ol/interaction/extent.js +++ b/src/ol/interaction/extent.js @@ -31,6 +31,8 @@ goog.require('ol.style.Style'); */ ol.interaction.Extent = function(opt_options) { + var options = opt_options ? opt_options : {}; + /** * Extent of the drawn box * @type {ol.Extent} @@ -50,7 +52,8 @@ ol.interaction.Extent = function(opt_options) { * @type {number} * @private */ - this.pixelTolerance_ = 10; + this.pixelTolerance_ = options.pixelTolerance !== undefined ? + options.pixelTolerance : 10; /** * Is the pointer snapped to an extent vertex