@mapmap/maps 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -304,10 +304,24 @@ const map = new MapMapMap({
304
304
  - **`extra.nav`** (Studio's navigation design block) is carried by the theme
305
305
  file and ignored by style compilation - see "Using your Studio design"
306
306
  below.
307
- - **Layer ids** (paint order): `background landcover landuse park water
308
- waterway aeroway building rail road-path road-minor road-major
309
- boundary-minor boundary housenumber road-labels water-name poi-labels
310
- mountain-peak-labels aerodrome-labels place-labels`.
307
+ - **Layer ids** (29, paint order): `background landcover landuse park water
308
+ waterway aeroway building building-outline rail pedestrian-areas road-path
309
+ road-minor-casing road-major-casing road-minor road-major
310
+ road-bridge-casing road-bridge boundary-minor boundary road-oneway
311
+ housenumber road-labels water-name poi-labels
312
+ mountain-peak-labels aerodrome-labels place-labels country-labels`.
313
+ `landuse` and `landcover` are class-tinted via a `match` on the feature
314
+ `class` (hospital, school, cemetery, military, retail, grass, wood, …),
315
+ blended from existing slots so the palette stays at 17; unknown classes
316
+ fall through to the plain slot colour. `brunnel: tunnel` roads dim in
317
+ place and `brunnel: bridge` roads redraw above the flat network as
318
+ `road-bridge-casing`/`road-bridge`. `road-oneway` draws direction arrows
319
+ from z16 as a text glyph, so no sprite is required.
320
+ The `*-casing` and `building-outline` layers take their colour from the
321
+ `road`/`roadMajor`/`building` slots blended toward `textSecondary` — they
322
+ are not separate palette slots, so overriding the base slot restyles the
323
+ casing with it. Both casings paint beneath both road fills so a minor
324
+ road's casing never crosses a major road at a junction.
311
325
  - Per-layer overrides: `visible`, `paint`/`layout` (per-key merge), `filter`
312
326
  (replace), `minzoom`/`maxzoom`. `extra_layers` (full MapLibre layers over
313
327
  the `territory` source) are inserted above the base map, below labels.
@@ -497,6 +511,35 @@ Voice prompts arrive plain and as SSML; banners carry the maneuver glyph
497
511
  and, where OSM has `turn:lanes` data, a lane diagram (sprite icons
498
512
  `lane-left`, `lane-straight`, … ship with the map assets).
499
513
 
514
+ ### Direction icons (`@mapmap/maps/direction-icons`)
515
+
516
+ A separate entry point (so the core bundle is unaffected) with the platform's
517
+ 90-icon manoeuvre set as inline SVG, plus the OSRM maneuver mapping:
518
+
519
+ ```ts
520
+ import {
521
+ directionIcons, // { turn_left: "<svg…>", roundabout_right: …, ferry: … }
522
+ iconNameForStep, // (step) => DirectionIconName — preferred
523
+ iconNameForManeuver, // (type?, modifier?, drivingSide?) => DirectionIconName
524
+ directionIconSvg, // shorthand: the SVG for a maneuver
525
+ } from "@mapmap/maps/direction-icons";
526
+
527
+ el.innerHTML = directionIcons[iconNameForStep(step)];
528
+ ```
529
+
530
+ Icons are 20×20 `viewBox` SVGs. The arrow inherits `currentColor`; secondary
531
+ road furniture (other lanes, the rest of a roundabout ring, ferry water) is
532
+ filled with `var(--mm-icon-secondary, #C9CDD2)` — set that CSS custom
533
+ property to retheme it. Unknown maneuvers degrade to the plain turn family,
534
+ never a missing icon.
535
+
536
+ Prefer `iconNameForStep(step)`: it reads everything off the OSRM step
537
+ itself — ferry legs from `step.mode`, and the u-turn direction from
538
+ `step.driving_side` (the MapMap gateway emits it on u-turn steps), so
539
+ left-hand-traffic markets render `uturn_right` with no configuration.
540
+ The lower-level `iconNameForManeuver` remains for callers without a step
541
+ object; it defaults to right-hand traffic.
542
+
500
543
  ## Navigation camera
501
544
 
502
545
  `NavigationCamera` gives the Google-Maps-style chase cam in one call per