From e3ac9554b16c1b5ed95761bf5961364bb2c0c2ea Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 4 Jul 2024 14:26:45 +0200 Subject: [PATCH] add end point instead of set, fixes #396 --- src/map/ContextMenuContent.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/map/ContextMenuContent.tsx b/src/map/ContextMenuContent.tsx index 931d395d..46853cdd 100644 --- a/src/map/ContextMenuContent.tsx +++ b/src/map/ContextMenuContent.tsx @@ -20,6 +20,16 @@ export function ContextMenuContent({ route: RouteStoreState onSelect: () => void }) { + + const dispatchAddPoint = function (coordinate: Coordinate) { + if(queryPoints.length == 2 && !queryPoints[1].isInitialized) { + dispatchSetPoint(queryPoints[1], coordinate) + } else { + onSelect() + Dispatcher.dispatch(new AddPoint(queryPoints.length, coordinate, true)) + } + } + const dispatchSetPoint = function (point: QueryPoint, coordinate: Coordinate) { onSelect() Dispatcher.dispatch( @@ -100,7 +110,7 @@ export function ContextMenuContent({