diff options
author | Eric <ericmabr@gmail.com> | 2023-08-21 14:46:05 -0400 |
---|---|---|
committer | Eric <ericmabr@gmail.com> | 2023-08-21 14:46:05 -0400 |
commit | cba0d4b26e8e5daf274c7a8ccfd130f284ce2946 (patch) | |
tree | eee2885a2e81c85953f09a0d95aefd3c3ff15c31 /src/client/views/nodes/MapBox/MapBox.tsx | |
parent | f573d7f0e93fe4b2b1f64b8591c77a225170847f (diff) |
new push
Diffstat (limited to 'src/client/views/nodes/MapBox/MapBox.tsx')
-rw-r--r-- | src/client/views/nodes/MapBox/MapBox.tsx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/client/views/nodes/MapBox/MapBox.tsx b/src/client/views/nodes/MapBox/MapBox.tsx index bd631f942..58a43c55a 100644 --- a/src/client/views/nodes/MapBox/MapBox.tsx +++ b/src/client/views/nodes/MapBox/MapBox.tsx @@ -742,11 +742,17 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps // Keeps track of when dragging a pin onto map draggingPin = false; - dragToggle(){ + dragToggle = (e:React.PointerEvent) => { console.log("DRAGGING TOGGLE") - document.addEventListener('pointerup', this.dropPin) + document.addEventListener('drop', this.dropPin, true) + document.addEventListener('pointermove', this.pinMove, true) + e.stopPropagation(); } - dropPin = (e:PointerEvent) => { + pinMove = (e:PointerEvent) => { + console.log("MOVING"); + e.stopPropagation(); + } + dropPin = (e:DragEvent) => { // document.removeChild(ele); @@ -759,13 +765,13 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps console.log(location) this.createPushpin(location.latitude, location.longitude); - + e.stopPropagation(); break; } target = target.parentElement } - document.removeEventListener('pointerup', this.dropPin) + document.removeEventListener('drop', this.dropPin) } |