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 },