From b6846d6b3dbc31f3c35e20c449ff9ad832379640 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Mon, 1 Oct 2018 15:41:03 -0600 Subject: [PATCH] Use window.setTimeout to avoid TS conflict with Node's setTimeout --- src/ol/interaction/Draw.js | 2 +- src/ol/interaction/MouseWheelZoom.js | 4 ++-- src/ol/pointer/TouchSource.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index 98232ee3b0..f7964393bc 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -912,7 +912,7 @@ function handleDownEvent(event) { return true; } else if (this.condition_(event)) { this.lastDragTime_ = Date.now(); - this.downTimeout_ = setTimeout(function() { + this.downTimeout_ = window.setTimeout(function() { this.handlePointerMove_(new MapBrowserPointerEvent( MapBrowserEventType.POINTERMOVE, event.map, event.pointerEvent, false, event.frameState)); }.bind(this), this.dragVertexDelay_); diff --git a/src/ol/interaction/MouseWheelZoom.js b/src/ol/interaction/MouseWheelZoom.js index 23cd3490fb..03089f59cc 100644 --- a/src/ol/interaction/MouseWheelZoom.js +++ b/src/ol/interaction/MouseWheelZoom.js @@ -258,7 +258,7 @@ function handleEvent(mapBrowserEvent) { } else { view.setHint(ViewHint.INTERACTING, 1); } - this.trackpadTimeoutId_ = setTimeout(this.decrementInteractingHint_.bind(this), this.trackpadEventGap_); + this.trackpadTimeoutId_ = window.setTimeout(this.decrementInteractingHint_.bind(this), this.trackpadEventGap_); let resolution = view.getResolution() * Math.pow(2, delta / this.trackpadDeltaPerZoom_); const minResolution = view.getMinResolution(); const maxResolution = view.getMaxResolution(); @@ -309,7 +309,7 @@ function handleEvent(mapBrowserEvent) { const timeLeft = Math.max(this.timeout_ - (now - this.startTime_), 0); clearTimeout(this.timeoutId_); - this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, map), timeLeft); + this.timeoutId_ = window.setTimeout(this.handleWheelZoom_.bind(this, map), timeLeft); return false; } diff --git a/src/ol/pointer/TouchSource.js b/src/ol/pointer/TouchSource.js index 3278e7d40c..69b07475e5 100644 --- a/src/ol/pointer/TouchSource.js +++ b/src/ol/pointer/TouchSource.js @@ -187,7 +187,7 @@ class TouchSource extends EventSource { * @private */ resetClickCount_() { - this.resetId_ = setTimeout( + this.resetId_ = window.setTimeout( this.resetClickCountHandler_.bind(this), CLICK_COUNT_TIMEOUT); }