feat(05-04): route paint stack + endpoint markers + load-hook install + shell chrome

- route-layers.ts: 2 empty GeoJSON sources + 4 line layers (route-alt-casing
  5px matte-black / route-alt-line 3px soft-beige / route-casing 9px
  matte-black / route-line 5px signal-orange), opacity 1.0, cap square,
  join bevel, no beforeId — idempotent install, setData-only updates,
  zero setStyle (T-05-09); verbatim tokens.css hex (DSGN-01)
- route-markers.ts: origin ring (24px, 2px matte-black, aria-hidden) +
  destination pin (12px square + 3px×8px tail, white inset rule, never
  orange) + 160px ellipsis name chip; WeakMap-tracked removal
- map.ts: bootMap gains opts.onLoad — invoked inside the existing load
  handler AFTER building-3d, BEFORE the ready log, its own try/catch
- shell.css: .route-stack registers (64px control-clearance composite),
  telemetry/diff/chips rows composing the .card child rules (no padding
  overrides), 28px chips with 44px ::after hit slop + instant :active
  invert + 3px focus bracket, marker chrome — token references only
This commit is contained in:
araharah-executor
2026-10-24 05:29:25 +08:00
parent d0751c1a33
commit 01a75f1fbe
4 changed files with 294 additions and 2 deletions
+11 -1
View File
@@ -22,7 +22,7 @@ import { KL_CENTER } from "../location/types.ts";
setWorkerUrl(workerUrl); // required for ALL bundlers in v6
export function bootMap(container: HTMLElement): MapLibreMap | null {
export function bootMap(container: HTMLElement, opts: { onLoad?: (map: MapLibreMap) => void } = {}): MapLibreMap | null {
try {
const map = new MapLibreMap({
container,
@@ -63,6 +63,16 @@ export function bootMap(container: HTMLElement): MapLibreMap | null {
} catch {
// extrusion is enhancement, never load-bearing — flat map still boots
}
try {
// Route layers install HERE — after building-3d, before the ready
// log (the capture race implies route sources exist by READY), with
// no beforeId: additions only, inside this ONE load handler — the
// style is never re-set (T-05-09). A route-layer failure degrades
// to "no route drawn", never a broken boot.
opts.onLoad?.(map);
} catch {
// route rendering is enhancement; the basemap boot is not
}
console.log("RAMS-BASEMAP-READY layers=" + map.getStyle().layers.map((l) => l.id).length);
});
map.on("error", (e: { error?: { message?: string } }) => {