adds route editing capabilities

This commit is contained in:
Christian Beutel
2025-01-11 22:43:09 +01:00
parent a19a96f524
commit 35f12f1816
12 changed files with 469 additions and 181 deletions

View File

@@ -696,7 +696,7 @@ export class ElevationProfile {
wpDiv.style.top = `8px`; // Position horizontally
// Add custom HTML content (e.g., icon + label)
wpDiv.innerHTML = `<div class="tooltip" data-title="${this.waypoints[index].name ?? "?"}"><i class="fa fa-${this.waypoints.at(index)?.icon ?? 'circle'}"></i></div>`;
wpDiv.innerHTML = `<div class="tooltip" data-title="${this.waypoints[index]?.name ?? "?"}"><i class="fa fa-${this.waypoints.at(index)?.icon ?? 'circle'}"></i></div>`;
waypointContainer.appendChild(wpDiv); // Add to container
});
@@ -864,7 +864,7 @@ export class ElevationProfile {
async setData(data: GeoJsonObject, waypoints?: Waypoint[]) {
// Concatenates the positions that may come from multiple LineStrings or MultiLineString
const { positions, times } = geoJsonObjectToPositionsAndTimes(data);
this.times = times;
this.elevatedPositions = smoothElevations(positions, Math.ceil(positions.length / 100));
@@ -896,7 +896,7 @@ export class ElevationProfile {
this.cumulatedDPlus = [];
this.grade = [];
this.waypoints = waypoints ?? [];
// this.waypointPositions = [];
this.waypointPositions = [];
let cumulatedDPlus = 0;
let cumulatedTime = 0;