Fix various bugs

This commit is contained in:
Pieter Vander Vennet 2022-02-22 14:13:41 +01:00
parent 30f4be183e
commit 5284f198d8
26 changed files with 339 additions and 119 deletions

View file

@ -543,9 +543,9 @@ class LengthTextField extends TextFieldDef {
// Bit of a hack: we project the centerpoint to the closes point on the road - if available
if (options?.feature !== undefined && options.feature.geometry.type !== "Point") {
const lonlat = <[number, number]>[...options.location]
lonlat.reverse()
lonlat.reverse(/*Changes a clone, this is safe */)
options.location = <[number, number]>GeoOperations.nearestPoint(options.feature, lonlat).geometry.coordinates
options.location.reverse()
options.location.reverse(/*Changes a clone, this is safe */)
}