Compositions · Preview · requirements · design · tasks

Haz map - Design

Approach

Do not reimplement the map. Fetch beta's modules at build time, put their

dependencies on the import map, load MapLibre as a classic global, and mount the

same markup beta uses for #geonet-haz-map. The entry module decides it is a home

map because the kit path is not /earthquake/….

That keeps the slice liftable: the HTML fragment is what a Go template would emit,

and the JS stays GeoNet's.

Slots used

SlotFragmentWhy
bodyslots/body.htmlMap sits in the main column; no page hero

On home-beta it mounts first in body, above the intensity tables.

Config

KeyDefaultWhy it is a knob
headingShaking in the last hourBeta home wording
actionLabelView all earthquakesButton label
actionHrefhttps://beta.geonet.org.nz/earthquakeAbsolute so it works off beta's origin

Markup

<div class="home-shaking">
  <h2 class="title">…</h2>
  <div class="buttons">…</div>
  <div class="haz-map -full-width">
    <div id="geonet-haz-map" class="map"></div>
    <div class="footer">…copyright…fullscreen…</div>
  </div>
</div>
<dialog id="haz-map-modal" class="haz-map-modal">…</dialog>

id="geonet-haz-map" is required: beta's initBaseMap("geonet-haz-map", …) hardcodes it.

The fullscreen helper moves that node into the dialog and back.

Asset wiring

KindManifest keyRole
Classic scriptremoteScriptsmaplibre-gl.js global
Entry moduleremoteJsgeonet-map-quake.mjs
Import-map onlyremoteImportsgeonet-map, iconUtils, dateUtils, shakingUtils
StylesremoteCsshaz-map, MapLibre, geonet-maplibre

Root-relative /assets/… strings inside fetched modules are rewritten to

https://beta.geonet.org.nz/assets/… at emit time so basemap switcher icons load

from a localhost preview. Stylesheets stay linked from beta, so their own

url(/assets/…) references already resolve on beta's origin.

Tokens and styling

Height and button row come from beta home.css (already on the base) plus a local

fallback height for designSystem: none. Expand-icon mask URL is pointed at beta

in the slice CSS so it still works if the remote sheet's root-relative mask 404s.

Accessibility

Handoff notes

/assets/… already works.

URLs in slice.yaml when beta redeploys them.

Rejected alternatives

filters, legends and geohash behaviour.

them would mean forking those modules.

side effects; the rest belong on the import map only.