Merge pull request #10332 from ahocevar/no-touch-action-css

Conditional default prevention instead of touch-action: none
This commit is contained in:
Andreas Hocevar
2019-11-29 09:52:29 +01:00
committed by GitHub
10 changed files with 103 additions and 49 deletions

View File

@@ -115,6 +115,7 @@ class DragPan extends PointerInteraction {
}
this.lastCentroid = centroid;
this.lastPointersCount_ = targetPointers.length;
mapBrowserEvent.originalEvent.preventDefault();
}
/**

View File

@@ -95,6 +95,16 @@ class PointerInteraction extends Interaction {
}
/**
* Returns the current number of pointers involved in the interaction,
* e.g. `2` when two fingers are used.
* @return {number} The number of pointers.
* @api
*/
getPointerCount() {
return this.targetPointers.length;
}
/**
* Handle pointer down events.
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.