Use window.setTimeout to avoid TS conflict with Node's setTimeout

This commit is contained in:
Kevin Schmidt
2018-10-01 15:41:03 -06:00
parent d62dd67942
commit b6846d6b3d
3 changed files with 4 additions and 4 deletions

View File

@@ -912,7 +912,7 @@ function handleDownEvent(event) {
return true; return true;
} else if (this.condition_(event)) { } else if (this.condition_(event)) {
this.lastDragTime_ = Date.now(); this.lastDragTime_ = Date.now();
this.downTimeout_ = setTimeout(function() { this.downTimeout_ = window.setTimeout(function() {
this.handlePointerMove_(new MapBrowserPointerEvent( this.handlePointerMove_(new MapBrowserPointerEvent(
MapBrowserEventType.POINTERMOVE, event.map, event.pointerEvent, false, event.frameState)); MapBrowserEventType.POINTERMOVE, event.map, event.pointerEvent, false, event.frameState));
}.bind(this), this.dragVertexDelay_); }.bind(this), this.dragVertexDelay_);

View File

@@ -258,7 +258,7 @@ function handleEvent(mapBrowserEvent) {
} else { } else {
view.setHint(ViewHint.INTERACTING, 1); 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_); let resolution = view.getResolution() * Math.pow(2, delta / this.trackpadDeltaPerZoom_);
const minResolution = view.getMinResolution(); const minResolution = view.getMinResolution();
const maxResolution = view.getMaxResolution(); const maxResolution = view.getMaxResolution();
@@ -309,7 +309,7 @@ function handleEvent(mapBrowserEvent) {
const timeLeft = Math.max(this.timeout_ - (now - this.startTime_), 0); const timeLeft = Math.max(this.timeout_ - (now - this.startTime_), 0);
clearTimeout(this.timeoutId_); clearTimeout(this.timeoutId_);
this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, map), timeLeft); this.timeoutId_ = window.setTimeout(this.handleWheelZoom_.bind(this, map), timeLeft);
return false; return false;
} }

View File

@@ -187,7 +187,7 @@ class TouchSource extends EventSource {
* @private * @private
*/ */
resetClickCount_() { resetClickCount_() {
this.resetId_ = setTimeout( this.resetId_ = window.setTimeout(
this.resetClickCountHandler_.bind(this), this.resetClickCountHandler_.bind(this),
CLICK_COUNT_TIMEOUT); CLICK_COUNT_TIMEOUT);
} }