Add a Home button and fill icon gaps from NPS's newer symbol library
CI / check (push) Successful in 42s
CI / deploy (push) Successful in 18s

Two things pulled in from github.com/nationalparkservice/npmap5-plugins:

- A "Home" button (public/vendor/npmap-home-button/, NPS's own MapLibre
  control) pinned to the app's CENTER/ZOOM, sitting top-left on the map. Now
  that the URL hash permalink can open the map at any view, "current view"
  and "the default view" aren't the same thing anymore, so a quick way back
  to the default is worth having.

- npmap5-plugins bundles a newer, actively-maintained version of the same
  NPS symbol-library already used for POI_ICONS (confirmed by its
  maintainer to be the designated replacement for the older standalone
  repo: nationalparkservice/npmap5-plugins#4), with a much larger icon
  vocabulary and a simpler CC0 (public domain) license. All 25 icons
  already in use came back byte-identical from the new source, so this
  just repoints their attribution — but it also has icons the old repo
  didn't: `forest` (POI_ICONS) is now the official "wilderness" pictogram
  instead of hand-drawn, and three of the five previously icon-less
  Services/Activities tags (wifi, mobile data coverage, winter/snow
  camping) now have real icons too. Only bakery and vehicle wash still
  have no NPS equivalent.
This commit is contained in:
randy committed 2026-09-07 19:45:19 +02:00
1 parent 481233c232
commit 170af80cac
6 files changed
+235 -39

No files matched your search

+20 -10
View File
@@ -117,6 +117,14 @@ Maps use, so copying the URL bar shares the exact spot someone's
looking at, and reloading the page doesn't reset the view back to the
default.
Now that any view can be the starting one (via that permalink), a way
back to the app's actual default is worth having: a "Home" button
(`public/vendor/npmap-home-button/`, the National Park Service's own
`home-button` MapLibre control — see `docs/third-party-notices.adoc`)
sits top-left on the map, pinned to `CENTER`/`ZOOM` explicitly rather
than its own fallback (the view at construction time, which would just
be wherever a loaded permalink happened to point).
== Weather radar overlay
`public/js/radar.js` adds a "Radar" map control that overlays recent
@@ -252,13 +260,14 @@ categories p4n2gpx actually uses, not an exhaustive OsmAnd icon set)
draws a white glyph on top of the badge for any waypoint whose `icon`
matches a known key (filtered out entirely for anything else, so an
unrecognized icon key just falls back to a plain colored badge rather
than a broken/missing image warning). Six of the seven glyphs are the
National Park Service's own map symbols
(`github.com/nationalparkservice/symbol-library`, BSD-licensed,
originally forked from Mapbox's Maki project) — a professional,
than a broken/missing image warning). All seven glyphs are the National
Park Service's own map symbols — pulled from
`github.com/nationalparkservice/npmap5-plugins`'s bundled
`symbol-library` (CC0-licensed, an actively-maintained monorepo that's
the designated replacement for the same org's older standalone
`symbol-library` repo, per its maintainer) — a professional,
purpose-built icon set beats hand-drawing "fuel pump"/"picnic table"
glyphs from scratch; `forest` has no NPS equivalent (that set covers
facilities, not land cover) and stays hand-drawn.
glyphs from scratch.
+
Both the badge and the glyphs are rasterized from their source SVGs
(an `<img>` → `<canvas>` → `ImageData` round trip, since `map.addImage`
@@ -366,10 +375,11 @@ instead. That table covers the codes p4n2gpx's exports actually use
(not park4night's whole API), with a human label always and an icon
only where the icon set below has a reasonable match — most of the
icons are National Park Service symbols again (same source/license as
`POI_ICONS`), a few (bakery, wifi, vehicle wash, ...) have no NPS
equivalent and get a label with no icon. A code this table doesn't
cover at all just renders as its own raw text, same as before this
existed — nothing p4n2gpx might add later is silently dropped.
`POI_ICONS`); a couple (bakery, vehicle wash) have no NPS equivalent
even in that larger set and get a label with no icon. A code this
table doesn't cover at all just renders as its own raw text, same as
before this existed — nothing p4n2gpx might add later is silently
dropped.
Track properties:: Every track feature (both formats) also carries
`distance_meters`, `elevation_gain_meters`, `duration_secs`,