fix elevation_gain_m null for modern Garmin FIT files; fix map flash

FIT parser: try enhanced_altitude before altitude. Barometric altimeters
on modern Garmins (Edge 540, 840, etc.) write enhanced_altitude in
record messages and total_ascent in lap messages. The old code read only
altitude, producing null elevation_m per point → null elevation_gain_m
at the activity root while laps had correct values from total_ascent.

ActivityMap: use preview_coords (passed from ActivitySummary) to
initialise the map at the activity's location on mount, eliminating the
flash of world-view before the async detail JSON / bbox arrives.
This commit is contained in:
Davide Scaini
2026-04-13 19:18:37 +02:00
parent e7eefa345e
commit e6bb6e61a2
3 changed files with 27 additions and 3 deletions
@@ -244,6 +244,7 @@
{trackUrl}
{timeseries}
bbox={detail?.bbox ?? null}
initialCoords={activity.preview_coords}
accentColor={color}
bind:hoveredIdx
/>