feat: routes - add route on burg creation

This commit is contained in:
Azgaar 2024-08-11 15:47:15 +02:00
parent 16b441c5cf
commit 6907c9dcac
7 changed files with 191 additions and 95 deletions

View file

@ -134,13 +134,7 @@ function editRoute(id) {
}
function redrawRoute(route) {
const lineGen = d3.line();
lineGen.curve(ROUTE_CURVES[route.group] || ROUTE_CURVES.default);
const points = route.points.map(p => [p[0], p[1]]);
const path = round(lineGen(points), 1);
elSelected.attr("d", path);
elSelected.attr("d", Routes.getPath(route));
updateRouteLength(route);
if (byId("elevationProfile").offsetParent) showRouteElevationProfile();
}