Rename variables now that trackpads are not special any more
This commit is contained in:
@@ -92,29 +92,23 @@ class MouseWheelZoom extends Interaction {
|
|||||||
this.startTime_ = undefined;
|
this.startTime_ = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* Events separated by this delay will be considered separate
|
||||||
* @type {?}
|
|
||||||
*/
|
|
||||||
this.timeoutId_;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Trackpad events separated by this delay will be considered separate
|
|
||||||
* interactions.
|
* interactions.
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.trackpadEventGap_ = 400;
|
this.eventGap_ = 400;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {?}
|
* @type {?}
|
||||||
*/
|
*/
|
||||||
this.trackpadTimeoutId_;
|
this.timeoutId_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of delta values per zoom level
|
* The number of delta values per zoom level
|
||||||
* @private
|
* @private
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.trackpadDeltaPerZoom_ = 300;
|
this.deltaPerZoom_ = 300;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +130,7 @@ class MouseWheelZoom extends Interaction {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
endInteraction_() {
|
endInteraction_() {
|
||||||
this.trackpadTimeoutId_ = undefined;
|
this.timeoutId_ = undefined;
|
||||||
const view = this.getMap().getView();
|
const view = this.getMap().getView();
|
||||||
view.endInteraction(undefined, this.lastDelta_ ? (this.lastDelta_ > 0 ? 1 : -1) : 0, this.lastAnchor_);
|
view.endInteraction(undefined, this.lastDelta_ ? (this.lastDelta_ > 0 ? 1 : -1) : 0, this.lastAnchor_);
|
||||||
}
|
}
|
||||||
@@ -191,13 +185,13 @@ class MouseWheelZoom extends Interaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const view = map.getView();
|
const view = map.getView();
|
||||||
if (this.trackpadTimeoutId_) {
|
if (this.timeoutId_) {
|
||||||
clearTimeout(this.trackpadTimeoutId_);
|
clearTimeout(this.timeoutId_);
|
||||||
} else {
|
} else {
|
||||||
view.beginInteraction();
|
view.beginInteraction();
|
||||||
}
|
}
|
||||||
this.trackpadTimeoutId_ = setTimeout(this.endInteraction_.bind(this), this.trackpadEventGap_);
|
this.timeoutId_ = setTimeout(this.endInteraction_.bind(this), this.eventGap_);
|
||||||
view.adjustZoom(-delta / this.trackpadDeltaPerZoom_, this.lastAnchor_);
|
view.adjustZoom(-delta / this.deltaPerZoom_, this.lastAnchor_);
|
||||||
this.startTime_ = now;
|
this.startTime_ = now;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user