Add an Alt+click debug inspector, NPMap4-infobox style
CI / check (push) Successful in 41s
CI / deploy (push) Successful in 13s

NPMap4 has infoboxControl: a generic "click anything, show every raw
property" debug view, kept separate from a dataset's own curated popup.
Not portable code (Leaflet), but the concept is: Alt+click anywhere now
opens a popup listing every rendered feature at that point via
map.queryRenderedFeatures — base map OSM tags included, not just this
app's own GPX/FIT/radar layers — with a raw key/value table per feature.

No dedicated UI for it on purpose: a keyboard-modified click needs no
button, toggle state, or cursor change of its own, and it's fine for it to
coexist with a layer's own click handler firing on the same click (e.g. a
GPX waypoint's normal popup) since this is a power-user/debugging
affordance, not a replacement for those. Feature properties can come from
an uploaded GPX/FIT file (untrusted input) via this app's own layers, so
every value is escaped the same way gpx.js's popups already are.
This commit is contained in:
randy committed 2026-09-07 20:34:15 +02:00
1 parent d58580f4d9
commit 8fa3391c6b
4 files changed
+99 -1

No files matched your search

+18
View File
@@ -154,6 +154,24 @@ manages in the page's own sidebar — both call the same
`LayerToggleControl#toggle()`, so there's one source of truth for the
panel's open/closed state either way.
=== Debug inspector (Alt+click)
Alt+click anywhere on the map opens a popup listing every rendered
feature at that point — across all layers, not just this app's own GPX/
FIT/radar layers — with its raw properties (`public/js/map.js`, a plain
`map.on("click", ...)` handler gated on `event.originalEvent.altKey`,
calling `map.queryRenderedFeatures(event.point)`). Inspired by NPMap4's
`infoboxControl`, a similar generic "show me everything here" debug
view kept separate from the curated popups those same features already
have. Deliberately no dedicated UI for it — a keyboard-modified click
needs no button, toggle state, or cursor change of its own, and it
coexists fine with layer-specific click handlers (e.g. a GPX waypoint's
normal popup) firing on the same click, since this is a power-user/
debugging affordance, not a replacement for those. Feature properties
can come straight from an uploaded GPX/FIT file (untrusted input) via
this app's own layers, not just the base map, so every key/value is
HTML-escaped the same way `gpx.js`'s popups already are.
== Weather radar overlay
`public/js/radar.js` adds a "Radar" map control that overlays recent