From edab7c85f1103934c67780b16d5aef6a89117cf7 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 19 Nov 2020 14:26:06 +1100 Subject: [PATCH] Seperated drag events in map interaction --- src/components/map/MapInteraction.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/map/MapInteraction.js b/src/components/map/MapInteraction.js index b750f6d..a4c22ae 100644 --- a/src/components/map/MapInteraction.js +++ b/src/components/map/MapInteraction.js @@ -91,14 +91,14 @@ function MapInteraction({ onPinchEnd: () => { onSelectedToolChange(previousSelectedToolRef.current); }, - onDrag: ({ first, last }) => { - if (first) { - interactionEmitter.emit("dragStart"); - } else if (last) { - interactionEmitter.emit("dragEnd"); - } else { - interactionEmitter.emit("drag"); - } + onDragStart: () => { + interactionEmitter.emit("dragStart"); + }, + onDrag: () => { + interactionEmitter.emit("drag"); + }, + onDragEnd: () => { + interactionEmitter.emit("dragEnd"); }, } );