adds maplibre for new routes

This commit is contained in:
Christian Beutel
2024-11-28 19:35:59 +01:00
parent b6b409e855
commit aea4e26084
7 changed files with 201 additions and 112 deletions

View File

@@ -347,15 +347,4 @@
.leaflet-popup-content {
width: max-content !important;
max-width: 100%;
}
.leaflet-anchor {
background-color: #fff;
border: 2px solid black;
width: 24px;
height: 24px;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
text-align: center;
}

View File

@@ -25,7 +25,10 @@ export function haversineCumulatedDistanceWgs84(path: Position[]): number[] {
export function smoothElevations(positions: Position[], windowSize: number): Position[] {
// Ensure windowSize is valid (at least 1)
if (windowSize < 1) throw new Error("Window size must be at least 1.");
if (windowSize < 1) {
console.warn("Window size must be at least 1.");
return positions
};
// Create a new array with smoothed elevations
return positions.map((pos, i, arr) => {