add elevation tool

This commit is contained in:
vcoppe
2024-09-04 19:11:56 +02:00
parent 9ba07ce1ed
commit 8985623639
12 changed files with 1390 additions and 88 deletions

View File

@@ -125,13 +125,11 @@ function getIntermediatePoints(points: Coordinates[]): Promise<TrackPoint[]> {
}
}));
let m = get(map);
route.forEach((point) => {
point.setSurface("unknown");
if (m) {
point.ele = getElevation(m, point.getCoordinates());
}
return getElevation(route).then((elevations) => {
route.forEach((point, i) => {
point.setSurface("unknown");
point.ele = elevations[i];
});
return route;
});
return new Promise((resolve) => resolve(route));
}