From c3d986c0671d674561db77c9b71c51d2e1dbc03b Mon Sep 17 00:00:00 2001 From: Alexis Jacomy Date: Fri, 5 Jul 2024 16:42:11 +0200 Subject: [PATCH] warped-map: fixes extendLine issue This commit fixes #7964. The lengthToAdd value is supposed to be positive, and doesn't need to be less than 1 in practice. --- front/src/common/Map/WarpedMap/core/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/common/Map/WarpedMap/core/helpers.ts b/front/src/common/Map/WarpedMap/core/helpers.ts index 37088562a4a..516d8ac1b9e 100644 --- a/front/src/common/Map/WarpedMap/core/helpers.ts +++ b/front/src/common/Map/WarpedMap/core/helpers.ts @@ -58,7 +58,7 @@ export function getSamples( * Given a line and a lengthToAdd, extend the line at its two extremities by lengthToAdd meters. */ export function extendLine(line: Feature, lengthToAdd: number): Feature { - if (lengthToAdd <= 1) throw new Error('lengthToAdd must be a positive'); + if (lengthToAdd < 0) throw new Error('lengthToAdd must be positive'); const points = line.geometry.coordinates; const firstPoint = points[0] as Vec2;