@minmaps-dev/mm-web-sdk 1.0.0-rc.35 → 1.0.0-rc.37
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 +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +275 -22
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +76 -5
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/themes/alt3-hybrid-style.json +552 -316
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,12 @@ interface POI {
|
|
|
80
80
|
/** For kiosk POIs only: compass heading the device physically faces, in
|
|
81
81
|
* degrees clockwise from north. Sourced from JACS `Device.heading`. */
|
|
82
82
|
heading?: number | null;
|
|
83
|
+
/** Per-instance name for this specific placement of an amenity (e.g.
|
|
84
|
+
* "Parking Lot A" for a "Parking" amenity), resolved from the waypoint's
|
|
85
|
+
* `amenityAssociations`. Distinct from `name`, which is the amenity's
|
|
86
|
+
* type-level name shared by every instance — see `Amenity.name`. Amenities
|
|
87
|
+
* only, and only set when JACS actually returned an instance name. */
|
|
88
|
+
instanceName?: string;
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
91
|
* Amenity - a specific type of POI (facilities, services)
|
|
@@ -185,6 +191,15 @@ interface Waypoint {
|
|
|
185
191
|
* link between a location and its department — read at runtime across the
|
|
186
192
|
* data provider (see the package CLAUDE.md zone landmine). */
|
|
187
193
|
zoneId?: string | number;
|
|
194
|
+
/** Per-instance names JACS attaches to this waypoint's amenities (e.g. a
|
|
195
|
+
* "Parking" amenity placed twice as "Parking Lot A" / "Parking Lot B").
|
|
196
|
+
* `id` matches an `Amenity.id`, not this waypoint — a waypoint can carry
|
|
197
|
+
* more than one amenity, so a consumer must find the entry for the
|
|
198
|
+
* specific amenity it's rendering rather than assuming index 0. */
|
|
199
|
+
amenityAssociations?: Array<{
|
|
200
|
+
id: string | number;
|
|
201
|
+
name: string;
|
|
202
|
+
}>;
|
|
188
203
|
}
|
|
189
204
|
/**
|
|
190
205
|
* Amenity enriched with the floor it belongs to
|
|
@@ -381,6 +396,11 @@ type AmenityBadgeStyle = {
|
|
|
381
396
|
ringColor?: string;
|
|
382
397
|
/** Ring width in logical px. Default `2`. */
|
|
383
398
|
ringWidth?: number;
|
|
399
|
+
/** Extra inset between the icon and the badge's inner edge, in logical px
|
|
400
|
+
* (applied on all sides). Default `0` — the icon fills ~85% of the disc
|
|
401
|
+
* as before. Raise this if an icon's own artwork reaches close to its
|
|
402
|
+
* viewBox edges and ends up touching the ring. */
|
|
403
|
+
padding?: number;
|
|
384
404
|
};
|
|
385
405
|
interface SDKOptions {
|
|
386
406
|
debug?: boolean;
|
|
@@ -437,18 +457,43 @@ interface SDKOptions {
|
|
|
437
457
|
customSprite?: string;
|
|
438
458
|
minIndoorZoom?: number;
|
|
439
459
|
/**
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
460
|
+
* How far, in **metres** (default `0.3`, ≈1 ft), extruded interior polygons
|
|
461
|
+
* (restrooms, back-of-house, obstacles, connectors) are inset so their edges
|
|
462
|
+
* don't z-fight the neighbouring room block. A polygon too thin to survive
|
|
463
|
+
* the inset (it would keep under half its area, e.g. a ~0.3 m back-of-house
|
|
464
|
+
* perimeter band) is left at its original size rather than erased. Metres to match the theme's
|
|
465
|
+
* `fill-extrusion-height` values, which MapLibre defines in metres — unlike
|
|
466
|
+
* the distances shown to visitors, which are in feet. Was feet before this
|
|
467
|
+
* option changed units; a value of `1` is now ~3.3× thicker.
|
|
444
468
|
*/
|
|
445
469
|
wallThickness?: number;
|
|
470
|
+
/**
|
|
471
|
+
* How much costlier a candidate on a **different floor** from the kiosk is
|
|
472
|
+
* treated when choosing the closest instance of an amenity (default `1.5`).
|
|
473
|
+
* Used by `findClosestByWalkTime`, and so by `navigateFromKioskToClosestAmenity`
|
|
474
|
+
* and `highlightAmenity`.
|
|
475
|
+
*
|
|
476
|
+
* A multiplier on the trip's effort — walk time plus the elevator wait — not
|
|
477
|
+
* a distance: `1.5` means another floor's instance has to be a third cheaper
|
|
478
|
+
* to beat one on the kiosk's floor. It is a *preference* for not making the
|
|
479
|
+
* visitor change floors, layered on top of the physical cost of doing so
|
|
480
|
+
* (which is already in the effort). `1` turns it off and ranks by effort
|
|
481
|
+
* alone; a value below `1` is treated as `1`. It only affects which instance
|
|
482
|
+
* is chosen — never a route.
|
|
483
|
+
*
|
|
484
|
+
* For scale: at the Las Vegas VA the nearest other-floor Lactation Pod costs
|
|
485
|
+
* ~400 ft-equivalent against ~530 for the one on the kiosk's floor, so it
|
|
486
|
+
* takes a value above ~1.32 to keep the visitor on their floor.
|
|
487
|
+
*/
|
|
488
|
+
otherFloorPenalty?: number;
|
|
446
489
|
boundsPadding?: BoundsPadding;
|
|
447
490
|
/**
|
|
448
491
|
* Caps how far a visitor can pan/zoom out. By default the SDK derives this
|
|
449
492
|
* from the venue's own bounds, scaled to 3x its width/height around the
|
|
450
493
|
* same center — enough room to pan around the building without drifting
|
|
451
|
-
* into an empty, un-tiled region.
|
|
494
|
+
* into an empty, un-tiled region. The default box is never smaller than
|
|
495
|
+
* ~3.7 km a side, so a small venue isn't forced to zoom in tighter than a
|
|
496
|
+
* large one. Pass a number to use a different
|
|
452
497
|
* multiplier (e.g. `1.5` for a tighter leash), explicit `[[west, south],
|
|
453
498
|
* [east, north]]` bounds to override entirely, or `false` to disable
|
|
454
499
|
* max-bounds clamping.
|
|
@@ -474,6 +519,16 @@ interface SDKOptions {
|
|
|
474
519
|
* massing/region. `0` locks zoom-out exactly to the opening view.
|
|
475
520
|
*/
|
|
476
521
|
minZoomBelowInitialFit?: number;
|
|
522
|
+
/**
|
|
523
|
+
* Zoom-out floor expressed as ground scale: the most metres one CSS pixel
|
|
524
|
+
* may span. The SDK converts it to a `minZoom` at the venue's latitude, so
|
|
525
|
+
* every venue shows the same amount of surrounding map when fully zoomed
|
|
526
|
+
* out — a plain zoom number doesn't, because Web Mercator shows less ground
|
|
527
|
+
* per zoom level the further a venue is from the equator. Takes precedence
|
|
528
|
+
* over `minZoomBelowInitialFit`. For scale, `1.207` is zoom 15.8 at Orlando
|
|
529
|
+
* (about 2.3 km x 1.3 km on a 1920x1080 screen).
|
|
530
|
+
*/
|
|
531
|
+
minZoomMetersPerPixel?: number;
|
|
477
532
|
/**
|
|
478
533
|
* Override the colour the SDK recolours every amenity SVG to before it
|
|
479
534
|
* composites the badge. `none` / `transparent` fills are preserved so
|
|
@@ -519,6 +574,22 @@ interface SDKOptions {
|
|
|
519
574
|
* (matches `informationBadge`'s default green disc).
|
|
520
575
|
*/
|
|
521
576
|
informationIconColor?: string;
|
|
577
|
+
/**
|
|
578
|
+
* Badge for the end-of-route flag (`poi-route-end-flag`) shown in place of a
|
|
579
|
+
* destination's dot while a route to it is displayed. Has its own defaults
|
|
580
|
+
* (green disc, white ring) that don't follow `amenityBadge`. Pass an object
|
|
581
|
+
* to tune the disc / ring, or `false` for the bare flag glyph with no badge.
|
|
582
|
+
* When `amenityBadge` is `false`, the flag is badge-less too unless this is
|
|
583
|
+
* set explicitly. Under the high-contrast theme the disc colour is forced to
|
|
584
|
+
* the high-contrast amenity yellow, like the amenity and connector badges.
|
|
585
|
+
*/
|
|
586
|
+
routeEndBadge?: AmenityBadgeStyle | false;
|
|
587
|
+
/**
|
|
588
|
+
* Flag glyph colour on the end-of-route badge. Default white (contrasts the
|
|
589
|
+
* default green disc); doesn't follow `amenityIconColor`. Ignored under the
|
|
590
|
+
* high-contrast theme, which forces its own glyph colour.
|
|
591
|
+
*/
|
|
592
|
+
routeEndIconColor?: string;
|
|
522
593
|
styleMode?: 'venueStyleUrl' | 'sdkTemplate';
|
|
523
594
|
templateOverrideMode?: 'colorsOnly' | 'colorsAndConstants' | 'all';
|
|
524
595
|
}
|
|
@@ -1044,11 +1115,15 @@ declare class MinuteMaps {
|
|
|
1044
1115
|
private debugGlobalKey;
|
|
1045
1116
|
private defaultCamera;
|
|
1046
1117
|
/** This venue's opening zoom, captured once after the initial fit resolves.
|
|
1047
|
-
* Anchors
|
|
1048
|
-
*
|
|
1049
|
-
* MapLibre zoom
|
|
1050
|
-
* `setStyle({ diff: false })` recreates layers from the pristine theme. */
|
|
1118
|
+
* Anchors the pinned zoom profile's icon/label reveal thresholds (idle
|
|
1119
|
+
* spotlight, active route) to this venue's own opening view rather than an
|
|
1120
|
+
* absolute MapLibre zoom, and the roof fill's fade-in. See `zoomViews`. */
|
|
1051
1121
|
private iconZoomBase;
|
|
1122
|
+
/** Which layers show at which zoom: the Campus / Building / Kiosk views, or
|
|
1123
|
+
* the pinned profile while the idle spotlight or a route is up. Re-applied
|
|
1124
|
+
* after every `setTheme()` swap, since `setStyle({ diff: false })`
|
|
1125
|
+
* recreates layers from the pristine theme. */
|
|
1126
|
+
private zoomViews;
|
|
1052
1127
|
private viewModes;
|
|
1053
1128
|
/** Mirror of `config.options.reducedMotion`, mutable via `setReducedMotion`. */
|
|
1054
1129
|
private reducedMotion;
|
|
@@ -1081,6 +1156,14 @@ declare class MinuteMaps {
|
|
|
1081
1156
|
* *previous* filters, not the ids) so `setTheme` can re-apply the same focus
|
|
1082
1157
|
* to the new style's layers after a swap discards the old ones. */
|
|
1083
1158
|
private destFocusIds;
|
|
1159
|
+
/** The predicate currently narrowing the POI marker layers to a curated set,
|
|
1160
|
+
* or `null` when no spotlight is active. See `setPOISpotlight`. Held as the
|
|
1161
|
+
* predicate, not a resolved id list, so a floor change or locale redraw can
|
|
1162
|
+
* re-resolve it against the POIs now on screen. */
|
|
1163
|
+
private poiSpotlight;
|
|
1164
|
+
/** Layer filters as they were before the spotlight narrowed them, put back
|
|
1165
|
+
* verbatim when it releases. `null` when no spotlight filter is applied. */
|
|
1166
|
+
private poiSpotlightRestore;
|
|
1084
1167
|
/** Coordinates of the current tap/Info selection, or `null` when nothing is
|
|
1085
1168
|
* selected. `easeToSelection` reads `getBoundsPadding()` at the moment a
|
|
1086
1169
|
* selection is made, which is often *before* the consumer's info card has
|
|
@@ -1133,7 +1216,20 @@ declare class MinuteMaps {
|
|
|
1133
1216
|
* `poi-highlight-*` layers — are intentionally unaffected; they're
|
|
1134
1217
|
* anchors or transient focus state, not categorical content. */
|
|
1135
1218
|
private static readonly POI_CATEGORY_LAYERS;
|
|
1219
|
+
/** Marker layers `setPOISpotlight` narrows. Every categorical POI layer
|
|
1220
|
+
* except `poi-other-amenity-icons`, whose filter the restroom-group manager
|
|
1221
|
+
* and the zoom-range pass rewrite as the camera moves — a spotlight
|
|
1222
|
+
* narrowing would be silently overwritten mid-orbit — plus the per-instance
|
|
1223
|
+
* amenity label, which is a marker in every sense but isn't a category. */
|
|
1224
|
+
private static readonly POI_SPOTLIGHT_LAYERS;
|
|
1136
1225
|
private poiVisibleTypes;
|
|
1226
|
+
/** Independent show/hide state for destination dots and name labels, set
|
|
1227
|
+
* by `setDestinationCirclesVisible`/`setDestinationLabelsVisible`. Kept
|
|
1228
|
+
* separate from `poiVisibleTypes` so the two controls compose instead of
|
|
1229
|
+
* clobbering each other — `applyPOIFilter` and `applyDestinationDisplay`
|
|
1230
|
+
* each own one paint/layout axis of the same layers. */
|
|
1231
|
+
private destinationCirclesVisible;
|
|
1232
|
+
private destinationLabelsVisible;
|
|
1137
1233
|
constructor(config: SDKConfig);
|
|
1138
1234
|
init(): Promise<void>;
|
|
1139
1235
|
/**
|
|
@@ -1463,8 +1559,14 @@ declare class MinuteMaps {
|
|
|
1463
1559
|
* `{ id, mapId? }` shape. Returns `null` when the kiosk isn't anchored,
|
|
1464
1560
|
* the target waypoint isn't on the graph, or no path resolves.
|
|
1465
1561
|
*
|
|
1466
|
-
* Walking speed defaults to
|
|
1467
|
-
* `
|
|
1562
|
+
* Walking speed defaults to 2.953 ft/s (0.9 m/s, average adult walking speed —
|
|
1563
|
+
* PMC2967707). Pass `walkingSpeedFps` to estimate for accessibility (e.g. 2).
|
|
1564
|
+
*
|
|
1565
|
+
* `feet` / `seconds` are the *physical* walk — horizontal legs only, what a
|
|
1566
|
+
* visitor is shown. `effortSeconds` adds the router's charge for each floor
|
|
1567
|
+
* change (the elevator wait) and is what to *rank* candidates by; see
|
|
1568
|
+
* `findClosestByWalkTime`. Pass `avoidStairs` to price the path as a route
|
|
1569
|
+
* with that option would be.
|
|
1468
1570
|
*/
|
|
1469
1571
|
getWalkTimeFromKiosk(target: number | string | {
|
|
1470
1572
|
id?: number | string;
|
|
@@ -1474,10 +1576,12 @@ declare class MinuteMaps {
|
|
|
1474
1576
|
id?: number | string;
|
|
1475
1577
|
}>;
|
|
1476
1578
|
}, opts?: {
|
|
1477
|
-
|
|
1579
|
+
walkingSpeedFps?: number;
|
|
1580
|
+
avoidStairs?: boolean;
|
|
1478
1581
|
}): {
|
|
1479
|
-
|
|
1582
|
+
feet: number;
|
|
1480
1583
|
seconds: number;
|
|
1584
|
+
effortSeconds: number;
|
|
1481
1585
|
pathNodeCount: number;
|
|
1482
1586
|
} | null;
|
|
1483
1587
|
/**
|
|
@@ -1562,6 +1666,18 @@ declare class MinuteMaps {
|
|
|
1562
1666
|
private writeActiveStepHighlight;
|
|
1563
1667
|
private clearActiveStepHighlight;
|
|
1564
1668
|
clearRoute(): void;
|
|
1669
|
+
/**
|
|
1670
|
+
* Put the end-of-route marker on `poi`, or take it down (`null`).
|
|
1671
|
+
*
|
|
1672
|
+
* A destination gets a flag in place of its dot; an amenity instance gets an
|
|
1673
|
+
* enlarged copy of its own icon (`map/routeEnd.ts`). Both are drawn from a
|
|
1674
|
+
* source of their own, so this never touches the POI layers — clearing the
|
|
1675
|
+
* route empties the source and the ordinary dot / icon are what remain.
|
|
1676
|
+
*
|
|
1677
|
+
* The routed restroom is also kept out of restroom grouping while the marker
|
|
1678
|
+
* is up; see `RestroomGroupManager.setExcludedKey`.
|
|
1679
|
+
*/
|
|
1680
|
+
private setRouteEnd;
|
|
1565
1681
|
/**
|
|
1566
1682
|
* Highlight a single POI on the map — a pulsing ring — and bring it into
|
|
1567
1683
|
* view. Resolves the POI across all floors, switching the active floor if
|
|
@@ -1641,6 +1757,25 @@ declare class MinuteMaps {
|
|
|
1641
1757
|
* survive.
|
|
1642
1758
|
*/
|
|
1643
1759
|
private setDestinationFocus;
|
|
1760
|
+
/**
|
|
1761
|
+
* Select every destination inside a tapped cluster bubble, so a consumer's
|
|
1762
|
+
* multi-place card lists them — the same `poiSelected` a tap on stacked pins
|
|
1763
|
+
* emits.
|
|
1764
|
+
*
|
|
1765
|
+
* Unlike `emitPoiSelected` this raises no room and narrows no markers. A
|
|
1766
|
+
* cluster spans rooms, so there is no one unit to raise or dim around, and
|
|
1767
|
+
* the destination focus would filter out the bubble that was just tapped
|
|
1768
|
+
* (its features carry no `id`) and the members hidden inside it with it.
|
|
1769
|
+
* Any earlier selection is cleared first, so a room left raised by the last
|
|
1770
|
+
* tap doesn't outlive this one. `clearHighlight` afterwards is a harmless
|
|
1771
|
+
* no-op for the consumer to call on dismiss.
|
|
1772
|
+
*
|
|
1773
|
+
* The leaves are read back from the cluster source (`getClusterLeaves`: a
|
|
1774
|
+
* promise on MapLibre v5, a callback on v4 — `peerDependencies` allows both)
|
|
1775
|
+
* and resolved against the floor's POIs, since a source feature only carries
|
|
1776
|
+
* enough identity to look the full POI (with its waypoint) back up.
|
|
1777
|
+
*/
|
|
1778
|
+
private selectCluster;
|
|
1644
1779
|
/** Gentle pan so the selection sits in the centre of the map area MapLibre
|
|
1645
1780
|
* frames within `boundsPadding` (which the consumer sets to reserve for its
|
|
1646
1781
|
* bottom-docked chrome / info card). A straight `easeTo`, current zoom kept,
|
|
@@ -1661,7 +1796,69 @@ declare class MinuteMaps {
|
|
|
1661
1796
|
setPOIFilter(types: Array<'amenity' | 'destination'>): void;
|
|
1662
1797
|
/** Restore the default — every POI category renders. */
|
|
1663
1798
|
clearPOIFilter(): void;
|
|
1799
|
+
/**
|
|
1800
|
+
* Narrow the POI markers to a curated set: only POIs for which `match`
|
|
1801
|
+
* returns true keep their icon and label, every other pin on the categorical
|
|
1802
|
+
* marker layers (destinations, entrances, parking, bus, connectors,
|
|
1803
|
+
* information, and the per-instance amenity names) is filtered out. Built for
|
|
1804
|
+
* an attract loop that wants a few chosen places on screen instead of either
|
|
1805
|
+
* every marker or none.
|
|
1806
|
+
*
|
|
1807
|
+
* `match` runs against the current floor's POIs — the same objects
|
|
1808
|
+
* `getAllPOIs()` returns, `instanceName` and `amenityCategory` included — and
|
|
1809
|
+
* is re-run on every floor change, theme swap and locale redraw, so the
|
|
1810
|
+
* spotlight follows the map rather than the floor it was set on. Kiosk
|
|
1811
|
+
* "You are here" is never touched.
|
|
1812
|
+
*
|
|
1813
|
+
* Two things it deliberately leaves alone:
|
|
1814
|
+
* - `poi-other-amenity-icons` and the restroom badge. Their filters are owned
|
|
1815
|
+
* by the restroom-group manager and rewritten as the camera moves, so a
|
|
1816
|
+
* narrowing there would not survive a frame. Hide them with `hideLayers`
|
|
1817
|
+
* if the spotlight should exclude them.
|
|
1818
|
+
* - `setPOIFilter`'s category visibility, which composes: a category the
|
|
1819
|
+
* filter hides stays hidden whatever `match` says.
|
|
1820
|
+
*
|
|
1821
|
+
* Selecting a place (`selectPOI`, a map tap) releases the spotlight. Pass
|
|
1822
|
+
* `null` — or call `clearPOISpotlight()` — to restore every marker.
|
|
1823
|
+
*/
|
|
1824
|
+
setPOISpotlight(match: ((poi: POI) => boolean) | null): void;
|
|
1825
|
+
/** Re-apply the zoom profile if the idle spotlight or a route just changed
|
|
1826
|
+
* which one is in force, and refresh what hangs off it. */
|
|
1827
|
+
private syncZoomViews;
|
|
1828
|
+
/** Restore every POI marker narrowed by `setPOISpotlight`. */
|
|
1829
|
+
clearPOISpotlight(): void;
|
|
1830
|
+
private applyPOISpotlight;
|
|
1664
1831
|
private applyPOIFilter;
|
|
1832
|
+
/**
|
|
1833
|
+
* Show or hide destination dots, independently of their name labels and of
|
|
1834
|
+
* `setPOIFilter`'s combined `'destination'` category (which still toggles
|
|
1835
|
+
* both together). Affects every destination dot — both the dot+label
|
|
1836
|
+
* marker on `poi-destination-labels` and the dot-only fallback on
|
|
1837
|
+
* `poi-destination-circles` that a `showLabel: false` POI renders on.
|
|
1838
|
+
*
|
|
1839
|
+
* Implemented as `icon-opacity`, not a layer swap: dot and label are
|
|
1840
|
+
* placed as one collision unit on `poi-destination-labels` (`icon-optional:
|
|
1841
|
+
* false` / `text-optional: true`), which is what guarantees a label never
|
|
1842
|
+
* renders without a dot beneath it. Splitting them into independently
|
|
1843
|
+
* *placed* layers would let MapLibre's collision index resolve each half
|
|
1844
|
+
* on its own, so a label could win placement while its dot lost — the
|
|
1845
|
+
* "floating name" bug this theme's combined layer was built to fix (see
|
|
1846
|
+
* `themes.test.ts` :: "a destination is one marker").
|
|
1847
|
+
*/
|
|
1848
|
+
setDestinationCirclesVisible(visible: boolean): void;
|
|
1849
|
+
/**
|
|
1850
|
+
* Show or hide destination name labels, independently of their dots. See
|
|
1851
|
+
* `setDestinationCirclesVisible` for why this is an opacity toggle on the
|
|
1852
|
+
* shared marker layer rather than a separate label layer.
|
|
1853
|
+
*
|
|
1854
|
+
* `visible: true` (the default) doesn't mean "always on" — labels still
|
|
1855
|
+
* fade in only once the visitor has zoomed in past the venue's opening
|
|
1856
|
+
* view (`DESTINATION_LABEL_REVEAL_OFFSET` in `iconZoomRanges.ts`), so a
|
|
1857
|
+
* zoomed-out visitor sees dots without the screen filling with names. Pass
|
|
1858
|
+
* `false` to suppress labels outright regardless of zoom.
|
|
1859
|
+
*/
|
|
1860
|
+
setDestinationLabelsVisible(visible: boolean): void;
|
|
1861
|
+
private applyDestinationDisplay;
|
|
1665
1862
|
/**
|
|
1666
1863
|
* Return the waypoint in `waypoints` closest to `from`. Useful for
|
|
1667
1864
|
* "route to the nearest X" against a venue-wide amenity record that has
|
|
@@ -1672,24 +1869,48 @@ declare class MinuteMaps {
|
|
|
1672
1869
|
* single-venue scale, and avoids a turf dependency on the hot path.
|
|
1673
1870
|
*/
|
|
1674
1871
|
findClosestWaypoint(waypoints: Waypoint[], from?: [number, number]): Waypoint | null;
|
|
1872
|
+
/**
|
|
1873
|
+
* Pick the candidate cheapest to reach from the kiosk — the one rule for
|
|
1874
|
+
* "closest instance of an amenity". `navigateFromKioskToClosestAmenity` and
|
|
1875
|
+
* `highlightAmenity` use it, and a consumer collapsing a venue-wide amenity
|
|
1876
|
+
* to a single search row should too, so a tap and a search result can never
|
|
1877
|
+
* resolve the same amenity to different floors.
|
|
1878
|
+
*
|
|
1879
|
+
* Each candidate is scored by `getWalkTimeFromKiosk().effortSeconds` — walk
|
|
1880
|
+
* time over the JACS path graph **plus the elevator wait** for any floor
|
|
1881
|
+
* change — and a candidate on a *different floor* from the kiosk has that
|
|
1882
|
+
* score multiplied by `options.otherFloorPenalty` (default `1.5`; `1`
|
|
1883
|
+
* disables it). The wait is the physical cost of leaving the floor; the
|
|
1884
|
+
* multiplier is a preference for not making the visitor do it, and only
|
|
1885
|
+
* applies here — it never changes a route.
|
|
1886
|
+
*
|
|
1887
|
+
* `toWaypoint` maps a candidate to the waypoint it stands for (identity for
|
|
1888
|
+
* a `Waypoint[]`, `poi => poi.waypoint` for a `POI[]`). Candidates whose
|
|
1889
|
+
* waypoint is missing or has no coordinates are ignored, as are waypoints
|
|
1890
|
+
* the graph can't reach from the kiosk. If none resolve a cost, falls back
|
|
1891
|
+
* to the planar `findClosestWaypoint`, **restricted to the kiosk's floor
|
|
1892
|
+
* when any candidate is on it** (planar distance is meaningless across
|
|
1893
|
+
* overlaid floors). Returns `null` for no usable candidate. Pass the same
|
|
1894
|
+
* `avoidStairs` the route will use so the pick and the route agree.
|
|
1895
|
+
*/
|
|
1896
|
+
findClosestByWalkTime<T>(items: readonly T[], toWaypoint: (item: T) => Waypoint | null | undefined, opts?: {
|
|
1897
|
+
avoidStairs?: boolean;
|
|
1898
|
+
}): T | null;
|
|
1675
1899
|
/**
|
|
1676
1900
|
* Route from the kiosk to the closest physical instance of an amenity.
|
|
1677
1901
|
* Resolves the amenity venue-wide, picks the instance with the smallest
|
|
1678
|
-
* path-graph
|
|
1679
|
-
*
|
|
1902
|
+
* path-graph cost from the kiosk (`findClosestByWalkTime`: walk time plus
|
|
1903
|
+
* the elevator wait, with a preference for the kiosk's floor; falling back
|
|
1904
|
+
* to planar Euclidean when the walk-time graph can't resolve any waypoint), switches the
|
|
1680
1905
|
* active floor if needed, and routes via the same plumbing as
|
|
1681
1906
|
* `navigateFromKioskToPOI` — so step-by-step directions, the
|
|
1682
1907
|
* `routeReady` event, and the active-floor camera fit all "just work."
|
|
1683
1908
|
*
|
|
1684
1909
|
* Pass `avoidStairs` to hard-filter stairs from the *route* (the SDK's
|
|
1685
1910
|
* routing engine reads it per call; the CMS's per-path-type weight
|
|
1686
|
-
* otherwise handles accessibility preference automatically).
|
|
1687
|
-
* closest-instance
|
|
1688
|
-
*
|
|
1689
|
-
* pixel-length only. In practice this matters when an amenity has
|
|
1690
|
-
* multiple instances and the geometrically closest is reachable only
|
|
1691
|
-
* via stairs; the picked instance won't change today, but the *route*
|
|
1692
|
-
* to it will avoid stairs (or fail gracefully) if `avoidStairs` is set.
|
|
1911
|
+
* otherwise handles accessibility preference automatically). The same
|
|
1912
|
+
* flag is passed to the closest-instance pick, so an instance reachable
|
|
1913
|
+
* only by stairs is skipped in favour of one the route can actually reach.
|
|
1693
1914
|
*/
|
|
1694
1915
|
navigateFromKioskToClosestAmenity(amenityId: string | number, options?: {
|
|
1695
1916
|
avoidStairs?: boolean;
|
|
@@ -1712,6 +1933,32 @@ declare class MinuteMaps {
|
|
|
1712
1933
|
private findFloorForWaypoint;
|
|
1713
1934
|
getCameraPosition(): CameraState | null;
|
|
1714
1935
|
getMap(): Map | null;
|
|
1936
|
+
/**
|
|
1937
|
+
* Hide one or more layers by id — a public, always-live counterpart to
|
|
1938
|
+
* `debug.hide()` for consumers that want to toggle arbitrary layers
|
|
1939
|
+
* without reaching into the console-facing debug API. Sticky: the
|
|
1940
|
+
* override is re-asserted across floor changes, `setPOIFilter`, view-mode
|
|
1941
|
+
* toggles and theme swaps until `showLayers` undoes it. Ids absent from
|
|
1942
|
+
* the active style are skipped silently. Returns the ids actually found
|
|
1943
|
+
* and hidden.
|
|
1944
|
+
*/
|
|
1945
|
+
hideLayers(layerIds: string[]): string[];
|
|
1946
|
+
/**
|
|
1947
|
+
* Undo `hideLayers` for these ids. Each layer returns to whatever
|
|
1948
|
+
* visibility the SDK's own state — current floor, POI filter, view mode —
|
|
1949
|
+
* says it should have; it is **not** forced to `visible`. A layer the SDK
|
|
1950
|
+
* is independently keeping hidden (another floor's layers, an
|
|
1951
|
+
* off-view-mode extrusion) stays hidden rather than being force-revealed.
|
|
1952
|
+
* This is the correct inverse of `hideLayers` (mirrors `debug.restore()` —
|
|
1953
|
+
* see `debugLayers.ts` for why a blanket "show" is usually the wrong
|
|
1954
|
+
* undo). Returns the ids that actually had an override to release.
|
|
1955
|
+
*/
|
|
1956
|
+
showLayers(layerIds: string[]): string[];
|
|
1957
|
+
/**
|
|
1958
|
+
* Whether a layer is currently rendering (`visibility !== 'none'`).
|
|
1959
|
+
* `false` for a layer absent from the active style.
|
|
1960
|
+
*/
|
|
1961
|
+
isLayerVisible(layerId: string): boolean;
|
|
1715
1962
|
/**
|
|
1716
1963
|
* Put this instance on `window` so a kiosk running in a browser can be
|
|
1717
1964
|
* driven from devtools — `mm.debug.help()`, `mm.getMap()`, `mm.setTheme(…)`.
|
|
@@ -1760,6 +2007,12 @@ declare class MinuteMaps {
|
|
|
1760
2007
|
* disables it, explicit bounds pass through as-is, and a number (or the
|
|
1761
2008
|
* unset default of 3) scales the venue's own bounds outward around its
|
|
1762
2009
|
* center — see `scaleBounds`.
|
|
2010
|
+
*
|
|
2011
|
+
* The unset default is also floored at `DEFAULT_MIN_MAX_BOUNDS_SPAN_M` per
|
|
2012
|
+
* side. MapLibre won't zoom out past the point where `maxBounds` fills the
|
|
2013
|
+
* viewport, so a small venue's 3x box would otherwise raise the effective
|
|
2014
|
+
* zoom-out floor above `minZoom` and show far less surrounding map than a
|
|
2015
|
+
* large venue does. An explicit number is a deliberate leash and is left as-is.
|
|
1763
2016
|
*/
|
|
1764
2017
|
private getMaxBounds;
|
|
1765
2018
|
/**
|