Track properties gain activity_type (FIT: sport enum from the session/sport message, Garmin's own table; GPX: <trk><type> passed through as-is) alongside the existing distance/elevation/duration. Clicking a track line now opens a bottom panel with a chart per metric the track actually has (elevation always; speed/cadence/heart rate only when present — FIT's record fields or GPX's device extensions). TrackStats.build_profile computes cumulative distance the same way for both formats so they're directly comparable. One pointermove listener drives a synchronized crosshair across every chart, a single tooltip listing all series, and a map marker at the hovered point's position — hovering the chart shows where on the track that moment was.
36 lines
1.5 KiB
ERB
36 lines
1.5 KiB
ERB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>MapTool</title>
|
|
<link rel="stylesheet" href="/vendor/maplibre-gl/maplibre-gl.css">
|
|
<link rel="stylesheet" href="/css/style.css?v=<%= ASSET_VERSION %>">
|
|
</head>
|
|
<body>
|
|
<%= yield %>
|
|
<script src="/vendor/pmtiles/pmtiles.js"></script>
|
|
<script src="/vendor/protomaps-themes-base/protomaps-themes-base.js"></script>
|
|
<%# Vendored libs above don't change between deploys, so they're left
|
|
unversioned; app.js's own modules do, and map.js statically imports
|
|
them by bare path — an import map remaps those paths to a versioned
|
|
URL so editing e.g. gpx.js also busts its cache, without having to
|
|
touch every file's import statements. Must come before the module
|
|
script below: the importmap has to be parsed first. %>
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"/js/gnss.js": "/js/gnss.js?v=<%= ASSET_VERSION %>",
|
|
"/js/gpx.js": "/js/gpx.js?v=<%= ASSET_VERSION %>",
|
|
"/js/icons.js": "/js/icons.js?v=<%= ASSET_VERSION %>",
|
|
"/js/livetrack.js": "/js/livetrack.js?v=<%= ASSET_VERSION %>",
|
|
"/js/panels.js": "/js/panels.js?v=<%= ASSET_VERSION %>",
|
|
"/js/radar.js": "/js/radar.js?v=<%= ASSET_VERSION %>",
|
|
"/js/track_profile.js": "/js/track_profile.js?v=<%= ASSET_VERSION %>"
|
|
}
|
|
}
|
|
</script>
|
|
<script type="module" src="/js/map.js?v=<%= ASSET_VERSION %>"></script>
|
|
</body>
|
|
</html>
|