Fix: preciseInputPicker will show correct icon if snapped or not snapped to a wall

This commit is contained in:
Pieter Vander Vennet 2023-03-15 22:02:29 +01:00
parent 64728d17db
commit 98703914ca

View file

@ -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(<any>matchedWay)
return min
},