From a290cccf75a705dc54e9df432a1eea6ca9c53407 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Wed, 18 Mar 2020 17:21:17 +0100 Subject: [PATCH] Don't call onDrag when multiple fingers are touching the map Calling onDrag when multiple fingers are touching the map causes a delay when you start pinch zooming. This is because the pinch is interpreted as a tap in the beginning, which causes stopPropagation to be called. I think dragging is an action you only do with one finger, so therefore I think not calling onDrag is the correct solution to this. Fixes #962 --- src/events.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/events.js b/src/events.js index 02936ac92..3b9538614 100644 --- a/src/events.js +++ b/src/events.js @@ -101,7 +101,10 @@ export default function(ctx) { } currentMode.touchmove(event); - return events.touchdrag(event); + + if (event.points.length === 1) { + events.touchdrag(event); + } }; events.touchend = function(event) {