Add a Home button and fill icon gaps from NPS's newer symbol library
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:
1 parent
481233c232
commit
170af80cac
6 files changed
+235
-39
No files matched your search
@@ -11,6 +11,7 @@ import { LiveTrackPanelControl } from "/js/livetrack.js";
|
||||
import { TrackProfilePanel } from "/js/track_profile.js";
|
||||
import { LAYERS_ICON } from "/js/icons.js";
|
||||
import { notifySidePanelOpen, onlyOneSidePanelOpen } from "/js/panels.js";
|
||||
import HomeButton from "/vendor/npmap-home-button/home-button.esm.js";
|
||||
|
||||
const CENTER = [17.1077, 48.1486];
|
||||
const ZOOM = 13;
|
||||
@@ -133,6 +134,13 @@ map.addControl(
|
||||
}),
|
||||
"bottom-right",
|
||||
);
|
||||
// homePosition/zoom pinned to the app's own default rather than left to the
|
||||
// button's own fallback (current center/zoom at construction) — now that
|
||||
// the URL hash can restore any view on load (see the Hash option above),
|
||||
// "current view" and "the default view" are no longer the same thing, and
|
||||
// a home button that resets to wherever you happened to load the page
|
||||
// wouldn't be a home button.
|
||||
map.addControl(new HomeButton({ homePosition: CENTER, zoom: ZOOM }), "top-left");
|
||||
|
||||
const sidebar = document.getElementById("sidebar");
|
||||
|
||||
|
||||
Reference in new issue
Block a user