Move the Wikipedia layer into its own "Overlays" panel
Wikipedia doesn't belong inside "Tracks & Points" — that panel is for files you add/remove/reorder, while Wikipedia is a live layer with nothing to manage, just on/off. Gave it its own sidebar panel (#overlays-panel, same shell as LiveTrackPanelControl) instead, sized to hold more such checklist-only layers later without a redesign. Moved all the wiki layer logic out of GpxPanelControl into a new OverlaysControl (public/js/overlays.js). svgToImageData/badgeImageId/ escapeHtml are now exported from gpx.js so it doesn't have to reimplement them — the same three helpers a second overlay would also need.
This commit is contained in:
1 parent
787df5478d
commit
c5b4a9ffb2
6 files changed
+257
-187
No files matched your search
+19
-9
@@ -58,19 +58,29 @@
|
||||
<input type="file" class="gpx-file-input" accept=".gpx,.fit,.geojson,.zip" multiple hidden>
|
||||
<p class="gpx-upload__status" hidden></p>
|
||||
|
||||
<!-- Not a real file in the tree below: a live layer, refetched from the
|
||||
offline Wikipedia ZIM (via kiwix-serve) for whatever's on screen as
|
||||
the map pans/zooms, not a saved .geojson. Hidden entirely when no
|
||||
kiwix-serve is configured (see gpx.js's mount()). -->
|
||||
<label class="gpx-panel__wiki" hidden>
|
||||
<input type="checkbox" class="gpx-panel__wiki-toggle">
|
||||
<span>Wikipedia</span>
|
||||
</label>
|
||||
|
||||
<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">×</button>
|
||||
</div>
|
||||
<!-- Each item is a live layer refetched 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. Wikipedia is
|
||||
the first; see public/js/overlays.js for how one of these works. -->
|
||||
<ul class="overlays-panel__list">
|
||||
<li class="overlays-panel__item">
|
||||
<label>
|
||||
<input type="checkbox" class="overlays-panel__wiki-toggle">
|
||||
<span>Wikipedia</span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="livetrack-panel" class="basemap-panel" hidden>
|
||||
<div class="basemap-panel__header">
|
||||
<strong>LiveTrack sessions</strong>
|
||||
|
||||
Reference in new issue
Block a user