Add moveTolerance option for ol.Map

This commit is contained in:
itjope
2017-05-18 13:22:31 +02:00
parent 4664a19718
commit 56b3203fa9
3 changed files with 17 additions and 3 deletions

View File

@@ -12,10 +12,11 @@ goog.require('ol.pointer.PointerEventHandler');
/**
* @param {ol.Map} map The map with the viewport to listen to events on.
* @param {number|undefined} moveTolerance The minimal distance the pointer must travel to trigger a move.
* @constructor
* @extends {ol.events.EventTarget}
*/
ol.MapBrowserEventHandler = function(map) {
ol.MapBrowserEventHandler = function(map, moveTolerance) {
ol.events.EventTarget.call(this);
@@ -48,7 +49,8 @@ ol.MapBrowserEventHandler = function(map) {
* @type {number}
* @private
*/
this.moveTolerance_ = ol.has.DEVICE_PIXEL_RATIO;
this.moveTolerance_ = moveTolerance ?
moveTolerance * ol.has.DEVICE_PIXEL_RATIO : ol.has.DEVICE_PIXEL_RATIO;
/**
* The most recent "down" type event (or null if none have occurred).