diff --git a/public/js/track_profile.js b/public/js/track_profile.js index 4687e2d..97c03c2 100644 --- a/public/js/track_profile.js +++ b/public/js/track_profile.js @@ -30,6 +30,7 @@ const BEST_DISTANCES_KM = [1, 5, 10, 21.0975, 42.195, 100]; const BEST_POWER_SECS = [5, 60, 300, 1200, 3600]; const CLIMB_TOLERANCE_M = 10; // a dip smaller than this doesn't end a climb const MILEPOST_SOURCE = "profile-mileposts"; +const MOVING_MPS = 0.3; // slower counts as a pause on the time axis export class TrackProfilePanel { constructor(map) { @@ -51,7 +52,7 @@ export class TrackProfilePanel { if (!profile || profile.length === 0) return; this._profile = profile.map((point) => ({ ...point, speed_kmh: typeof point.speed_mps === "number" ? point.speed_mps * 3.6 : null })); - this._maxDistance = this._profile.at(-1).distance_meters || 1; + addMovingTime(this._profile); this._title.textContent = properties.name || "Track"; this._stats.textContent = statsText(properties); @@ -69,7 +70,7 @@ export class TrackProfilePanel { // Only offer the time axis when there's actually elapsed-time data — // plenty of GPX files have no