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:
@@ -31,6 +31,8 @@ goog.require('ol.style.Style');
|
|||||||
*/
|
*/
|
||||||
ol.interaction.Extent = function(opt_options) {
|
ol.interaction.Extent = function(opt_options) {
|
||||||
|
|
||||||
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extent of the drawn box
|
* Extent of the drawn box
|
||||||
* @type {ol.Extent}
|
* @type {ol.Extent}
|
||||||
@@ -50,7 +52,8 @@ ol.interaction.Extent = function(opt_options) {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.pixelTolerance_ = 10;
|
this.pixelTolerance_ = options.pixelTolerance !== undefined ?
|
||||||
|
options.pixelTolerance : 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the pointer snapped to an extent vertex
|
* Is the pointer snapped to an extent vertex
|
||||||
|
|||||||
Reference in New Issue
Block a user