Files
randy 9edc2d9534
CI / check (push) Successful in 22s
CI / deploy (push) Successful in 12s
Show clicked hiking trail info in a docked panel, not a popup
A map-anchored Popup on a trail click routinely overlapped the very
line it described. Follows the same click -> docked panel pattern
gpx.js already uses for a track line click (TrackProfilePanel) rather
than inventing a new one: a fixed #trail-panel docks to the right edge
on desktop and the bottom edge on narrow viewports (this file's first
@media breakpoint), so the trail stays fully visible either way.

routeHtml()'s own markup is reused unchanged for the panel body —
.trail-panel__body's padding matches .maplibregl-popup-content's own
(15px 10px) so the header's canceling negative margin still lines up.
The popup-identity staleness guard for the async Overpass lookup is
replaced with a plain request token, since there's no longer a fresh
Popup instance to key off of.
2026-09-15 12:52:54 +02:00

108 lines
4.1 KiB
ERB

<div id="app">
<header class="topbar">
<span class="topbar__brand" title="rev <%= revision %>">MapTool</span>
<span class="topbar__center">
<span class="topbar__coords"></span>
<span class="topbar__sun" hidden></span>
</span>
<span class="topbar__offline-status" hidden></span>
<div class="topbar__auth">
<% if logged_in %>
<span><%= user %></span>
<a href="/logout">Log out</a>
<% else %>
<a href="/login">Log in</a>
<% end %>
</div>
</header>
<div class="app-body">
<nav id="sidebar" class="sidebar"></nav>
<div id="map"></div>
</div>
</div>
<div id="profile-panel" class="profile-panel" hidden>
<div class="profile-panel__header">
<strong class="profile-panel__title"></strong>
<span class="profile-panel__stats"></span>
<button type="button" class="profile-panel__close" aria-label="Close">&times;</button>
</div>
<div class="profile-panel__charts"></div>
</div>
<div id="trail-panel" class="trail-panel" hidden>
<button type="button" class="trail-panel__close" aria-label="Close">&times;</button>
<div class="trail-panel__body"></div>
</div>
<div id="basemap-panel" class="basemap-panel" hidden>
<div class="basemap-panel__header">
<strong>Base map</strong>
<button type="button" class="basemap-panel__close" aria-label="Close">&times;</button>
</div>
<div class="basemap-panel__list">
<button type="button" class="basemap-panel__option" data-style="online">
<span>Online</span>
<span class="basemap-panel__check">&check;</span>
</button>
<button type="button" class="basemap-panel__option" data-style="offline">
<span>Offline</span>
<span class="basemap-panel__check">&check;</span>
</button>
</div>
</div>
<div id="gpx-panel" class="gpx-panel" hidden>
<div class="gpx-panel__header">
<strong>Tracks &amp; Points</strong>
<div class="gpx-panel__actions">
<button type="button" class="gpx-panel__action" data-action="new-folder" title="New folder" aria-label="New folder"></button>
<button type="button" class="gpx-panel__action" data-action="upload" title="Upload GPX/FIT/GeoJSON file" aria-label="Upload GPX/FIT/GeoJSON file"></button>
<button type="button" class="gpx-panel__close" aria-label="Close">&times;</button>
</div>
</div>
<input type="file" class="gpx-file-input" accept=".gpx,.fit,.geojson,.zip" multiple hidden>
<p class="gpx-upload__status" hidden></p>
<div class="gpx-tree"></div>
<div class="gpx-legend" hidden></div>
</div>
<div id="overlays-panel" class="basemap-panel" hidden>
<div class="basemap-panel__header">
<strong>Overlays</strong>
<button type="button" class="basemap-panel__close" aria-label="Close">&times;</button>
</div>
<!-- Each item is a live layer refetched/toggled from its own source as
the map moves, not a file to add/remove/reorder — a plain on/off
list, no upload/new-folder actions the way Tracks & Points has.
Populated by OverlaysControl#mount (public/js/overlays.js), not
here — Radar's item needs its own scrub/forecast markup built by
RadarControl itself (radar.js), so all three items go through the
same "control owns its own <li>" path rather than half static
markup, half dynamic. -->
<ul class="overlays-panel__list"></ul>
</div>
<div id="livetrack-panel" class="basemap-panel" hidden>
<div class="basemap-panel__header">
<strong>LiveTrack sessions</strong>
<button type="button" class="basemap-panel__close" aria-label="Close">&times;</button>
</div>
<ul class="livetrack-panel__list"></ul>
</div>
<div id="offline-data-panel" class="basemap-panel" hidden>
<div class="basemap-panel__header">
<strong>Offline data</strong>
<button type="button" class="basemap-panel__close" aria-label="Close">&times;</button>
</div>
<!-- Two rows (map data / terrain data), each its own status text +
"Regenerate for current view" button — built by
OfflineDataControl#mount (public/js/offline_data.js), same
"control owns its content" story as the Overlays panel. -->
<div class="offline-data-panel__body"></div>
</div>