Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typedef, use underscore for private methods #14925

Merged
merged 2 commits into from Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/ol/interaction/DblClickDragZoom.js
Expand Up @@ -58,6 +58,12 @@ class DblClickDragZoom extends Interaction {
*/
this.handlingDoubleDownSequence_ = false;

/**
* @type {ReturnType<typeof setTimeout>}
* @private
*/
this.doubleTapTimeoutId_ = undefined;

/**
* @type {!Object<string, PointerEvent>}
* @private
Expand Down Expand Up @@ -104,7 +110,7 @@ class DblClickDragZoom extends Interaction {
stopEvent = this.stopDown(handled);
} else {
stopEvent = this.stopDown(false);
this.waitForDblTap();
this.waitForDblTap_();
}
}
}
Expand Down Expand Up @@ -210,16 +216,17 @@ class DblClickDragZoom extends Interaction {

/**
* Wait the second double finger tap.
* @private
*/
waitForDblTap() {
waitForDblTap_() {
if (this.doubleTapTimeoutId_ !== undefined) {
// double-click
clearTimeout(this.doubleTapTimeoutId_);
this.doubleTapTimeoutId_ = undefined;
} else {
this.handlingDoubleDownSequence_ = true;
this.doubleTapTimeoutId_ = setTimeout(
this.endInteraction.bind(this),
this.endInteraction_.bind(this),
250
);
}
Expand All @@ -228,7 +235,7 @@ class DblClickDragZoom extends Interaction {
/**
* @private
*/
endInteraction() {
endInteraction_() {
this.handlingDoubleDownSequence_ = false;
this.doubleTapTimeoutId_ = undefined;
}
Expand Down