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.
This commit is contained in:
marcosox
2017-10-06 18:37:25 +02:00
parent 382c6b9832
commit d40dd695cb

View File

@@ -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