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
+5
-2
@@ -5,7 +5,8 @@ import {
|
||||
addProtocol,
|
||||
} from "/vendor/maplibre-gl/maplibre-gl.mjs";
|
||||
import { RadarControl } from "/js/radar.js";
|
||||
import { GpxPanelControl, setKiwixConfig } from "/js/gpx.js";
|
||||
import { GpxPanelControl } from "/js/gpx.js";
|
||||
import { OverlaysControl } from "/js/overlays.js";
|
||||
import { GnssControl } from "/js/gnss.js";
|
||||
import { LiveTrackPanelControl } from "/js/livetrack.js";
|
||||
import { TrackProfilePanel } from "/js/track_profile.js";
|
||||
@@ -556,6 +557,8 @@ profilePanel.mount();
|
||||
|
||||
sidebar.insertAdjacentHTML("beforeend", `<div class="sidebar-group-label" title="Explorer"></div>`);
|
||||
new GpxPanelControl(map, profilePanel).mount(sidebar);
|
||||
const overlaysControl = new OverlaysControl(map);
|
||||
overlaysControl.mount(sidebar);
|
||||
const hillshadeControl = new HillshadeControl(map);
|
||||
hillshadeControl.mount(sidebar);
|
||||
// Running a plugin needs a login (POST /api/plugins/:name/run) — same
|
||||
@@ -615,7 +618,7 @@ fetch("/api/terrain-tiles")
|
||||
|
||||
fetch("/api/kiwix")
|
||||
.then((response) => response.json())
|
||||
.then(setKiwixConfig)
|
||||
.then(({ available }) => overlaysControl.setWikiAvailable(available))
|
||||
.catch(() => {});
|
||||
|
||||
// Alt+click anywhere shows every rendered feature at that point — base map
|
||||
|
||||
Reference in new issue
Block a user