From 98703914ca48afefb614e1f19eb15663ab3280b7 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 15 Mar 2023 22:02:29 +0100 Subject: [PATCH] Fix: preciseInputPicker will show correct icon if snapped or not snapped to a wall --- UI/Input/LocationInput.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UI/Input/LocationInput.ts b/UI/Input/LocationInput.ts index 56f20f445..f52a39243 100644 --- a/UI/Input/LocationInput.ts +++ b/UI/Input/LocationInput.ts @@ -176,13 +176,13 @@ export default class LocationInput loc.lat, ]) if (min === undefined) { - min = nearestPointOnLine + min = { ...nearestPointOnLine } matchedWay = feature continue } if (min.properties.dist > nearestPointOnLine.properties.dist) { - min = nearestPointOnLine + min = { ...nearestPointOnLine } matchedWay = feature } } catch (e) { @@ -208,6 +208,10 @@ export default class LocationInput } } min.properties = options?.snappedPointTags ?? min.properties + min.properties = { + ...min.properties, + _referencing_ways: JSON.stringify([matchedWay.properties.id]), + } self.snappedOnto.setData(matchedWay) return min },