Compositions · Preview · requirements · design · tasks

Haz map - Requirements

Problem

The beta home page leads with a map of the last hour's shaking: quakes as circles,

measured shaking and felt reports as overlays, on a LINZ basemap. Reviewing

intensity tables without that map leaves out the spatial answer people actually

look for first. This slice mounts that map so it can be reviewed on its own and

assembled into a home page composition.

Reimplementing MapLibre wiring would drift from GeoNet's modules. The slice

therefore reuses beta's own geonet-map-quake.mjs stack.

In scope

Out of scope

Data

Fetched by beta's map modules (not by a kit script):

LayerEndpoint
Quakes (last hour)https://api.geonet.org.nz/quake?MMI=3
Measured shakinghttps://api.geonet.org.nz/intensity?type=measured
Felt reportshttps://api.geonet.org.nz/intensity?type=reported
Basemap styleshttps://static.geonet.org.nz/dist/geonet-linz-styles/…

Map type is chosen from location.pathname. Any kit path that is not under

/earthquake/ stays on HOME, which is what we want for /c/… previews.

Requirements

1. R1 Render beta's .haz-map -full-width block with #geonet-haz-map as the

MapLibre container, plus copyright popover and full-screen dialog.

2. R2 Load MapLibre as a classic script, then beta's geonet-map-quake.mjs

entry with its import-map dependencies (geonet-map, iconUtils, dateUtils,

shakingUtils).

3. R3 Link beta's haz-map.css, MapLibre CSS and geonet-maplibre.css.

4. R4 Show a heading and secondary action link above the map (home-shaking

pattern).

5. R5 designSystem: link is required for a reviewable preview; none is not

a supported review state for this slice.

6. R6 No fixture states. Live layers only.

7. R7 The map region has an accessible name. Full-screen open/close uses beta's

existing controls.

States

StateTriggerExpected
LoadingMapLibre / style loadingEmpty map container, then basemap tiles
PopulatedOverlay fetches succeedQuake / shaking / felt markers for the last hour
Quiet hourNo recent activityBasemap only, or empty overlay layers
Full screen"View full screen map"Dialog opens with the same map moved into it
ErrorTile or API failureMapLibre / module console errors; page chrome still intact

Acceptance

npm run build emits /c/haz-map-beta/

Entry module and import-map deps are hashed under /assets/js

MapLibre classic script precedes the ES module tags

Reviewed live: basemap tiles and last-hour overlays appear

Full-screen open/close checked on desktop

Compared next to https://beta.geonet.org.nz/ at desktop and 320px