@mapmap/maps 0.2.0 → 0.4.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/LICENSE +3 -3
- package/README.md +41 -5
- package/dist/direction-icons.d.ts +124 -0
- package/dist/direction-icons.js +151 -0
- package/dist/direction-icons.js.map +1 -0
- package/dist/index.d.ts +233 -3
- package/dist/index.js +816 -70
- package/dist/index.js.map +1 -1
- package/package.json +8 -3
package/LICENSE
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
MapMap Maps SDK (@mapmap/maps)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026
|
|
3
|
+
Copyright (c) 2026 Mapmap AI Ltd. All rights reserved.
|
|
4
4
|
|
|
5
|
-
This package is proprietary first-party software of
|
|
5
|
+
This package is proprietary first-party software of Mapmap AI Ltd, distributed
|
|
6
6
|
under a commercial licence. It is part of the MapMap
|
|
7
7
|
product. Use of this package requires a written commercial agreement with
|
|
8
|
-
|
|
8
|
+
Mapmap AI Ltd and a valid MapMap gateway API key; it is licensed per fleet
|
|
9
9
|
vehicle or per monthly-active-user (see docs/SDK-DISTRIBUTION.md). No licence,
|
|
10
10
|
express or implied, is granted except under that agreement.
|
|
11
11
|
|
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
|
|
309
|
-
|
|
310
|
-
|
|
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,28 @@ 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
|
+
iconNameForManeuver, // (type?, modifier?, drivingSide?) => DirectionIconName
|
|
523
|
+
directionIconSvg, // shorthand: the SVG for a maneuver
|
|
524
|
+
} from "@mapmap/maps/direction-icons";
|
|
525
|
+
|
|
526
|
+
el.innerHTML = directionIconSvg(step.maneuver.type, step.maneuver.modifier);
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Icons are 20×20 `viewBox` SVGs. The arrow inherits `currentColor`; secondary
|
|
530
|
+
road furniture (other lanes, the rest of a roundabout ring, ferry water) is
|
|
531
|
+
filled with `var(--mm-icon-secondary, #C9CDD2)` — set that CSS custom
|
|
532
|
+
property to retheme it. Unknown maneuvers degrade to the plain turn family,
|
|
533
|
+
never a missing icon; pass `drivingSide: "left"` for left-hand-traffic
|
|
534
|
+
u-turns.
|
|
535
|
+
|
|
500
536
|
## Navigation camera
|
|
501
537
|
|
|
502
538
|
`NavigationCamera` gives the Google-Maps-style chase cam in one call per
|
|
@@ -569,5 +605,5 @@ npm test # vitest (pure-logic unit tests, no browser)
|
|
|
569
605
|
|
|
570
606
|
## Licence
|
|
571
607
|
|
|
572
|
-
Proprietary - © 2026
|
|
608
|
+
Proprietary - © 2026 Mapmap AI Ltd, distributed under a commercial licence.
|
|
573
609
|
See [`LICENSE`](./LICENSE).
|