Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / DirectionOptions

Interface: DirectionOptions

Defined in: packages/wayfinding/src/types.ts:346

Properties

accessible?

optional accessible?: boolean

Defined in: packages/wayfinding/src/types.ts:348

When true, stairs and escalator edges receive weight Infinity


avoidanceZones?

optional avoidanceZones?: AvoidanceZone[]

Defined in: packages/wayfinding/src/types.ts:359

Zones of units to avoid. Edges leading into these units have their weight multiplied by the zone's costMultiplier (default 10). The path is not blocked — traversal through the zone is still possible if no alternate route exists.


currentLocationId?

optional currentLocationId?: string | null

Defined in: packages/wayfinding/src/types.ts:371

Current-location start resolution (issue #470): when origin is null, getDirections/getDirectionsMultiDestination resolve the start node from this caller-supplied chain, tried in order:

  1. currentLocationId — an injected blue-dot/RTLS position, already snapped to a graph node id.
  2. youAreHereMarkerId — a configured "you-are-here" kiosk marker id, used when no live position is available. If neither resolves to a node in the graph, the result is { ok: false, reason: 'no-start' }.

engine?

optional engine?: "grid" | "graph"

Defined in: packages/wayfinding/src/types.ts:409

Which routing engine produces the route (issue #483):

  • 'grid' (default as of this release): the HEB-style occupancy-grid engine (rasterize → Jump Point Search → string-pull, with the constraint-relaxation ladder and portal-variation cross-floor branching from issues #472/#477/#482). Routes hug real wall/opening geometry — segments never cross a wall — and choose cross-floor portals by actual routed distance.
  • 'graph': the legacy centroid-graph engine (one node per IMDF unit at its display_point/centroid; straight centroid→door-midpoint→centroid edges). Kept selectable, and functionally unchanged, for one release.

Migration note: before this release the only engine was the legacy centroid-graph path (what 'graph' now selects explicitly). Consumers that depend on the exact coordinate shape of previously-returned routes (e.g. snapshot-testing rendered polylines, or code that assumes one vertex per IMDF unit) should pass engine: 'graph' to keep the old path shape until they can move off it; the grid engine's paths are geometrically different (and more accurate — they route through real corridors and doorways instead of straight centroid-to-centroid jumps).

Other DirectionOptions fields that behave differently under 'grid' (beyond coordinate shape) — check these if a consumer's routes change behaviour after the default flip, not just their rendered geometry:

  • smoothing: the grid engine always string-pulls its path into straight, wall-respecting segments; there is no separate on/off smoothing pass, so smoothing: false (which the legacy engine honours) has no effect here.
  • avoidanceZones: the legacy engine treats a zone as a soft cost multiplier (the route can still cross it if no cheaper alternative exists); the grid engine treats it as a hard block on the strictest relaxation rungs, only relaxed if every rung fails to find a route at all (issue #477's ladder semantics). A consumer relying on "never fully blocked, just discouraged" should pass engine: 'graph'.
  • excludedConnectionIds: legacy-engine-only (blocks specific graph edges by id); the grid engine has no edge-id concept and ignores it.

excludedConnectionIds?

optional excludedConnectionIds?: string[]

Defined in: packages/wayfinding/src/types.ts:352

Edge IDs to block completely


landmarkRadiusM?

optional landmarkRadiusM?: number

Defined in: packages/wayfinding/src/types.ts:417

Radius in metres within which a turn instruction's nearest named IMDF unit/amenity qualifies it as a landmark (issue #485 AC3, e.g. "Turn left at Cafeteria"). Grid-engine only — see enrichInstructionsWithLandmarks (landmarks.ts). Default DEFAULT_LANDMARK_RADIUS_M (8m, per docs/plans/wayfinding-v2.md §4 Phase 3 item 3).


now?

optional now?: Date

Defined in: packages/wayfinding/src/types.ts:437

Evaluation instant for restrictionSchedule (issue #473). Defaults to new Date() at call time. Exposed so callers/tests can pin a specific moment rather than depending on wall-clock time.


restrictionSchedule?

optional restrictionSchedule?: RestrictionSchedule

Defined in: packages/wayfinding/src/types.ts:431

Venue-profile after-hours/restricted-hours schedule (issue #473). When supplied, a unit's IMDF restriction only counts as an active block while now falls inside one of restrictionSchedule.closedWindows (see schedule.ts's isRestrictionActiveNow) — outside those windows a restricted unit routes normally. Omitted (the default): unchanged pre-#473 behaviour, where any non-null restriction always counts as blockable on the relaxation ladder's strict rungs, with no time component. Grid engine only — the legacy 'graph' engine has never consulted restriction for blocking and continues not to; this option is a no-op there (see DirectionOptions.engine's migration note for the general pattern of engine-specific options).


smoothing?

optional smoothing?: boolean

Defined in: packages/wayfinding/src/types.ts:350

Apply Chaikin smoothing to route coordinates. Defaults to true (issue #470).


youAreHereMarkerId?

optional youAreHereMarkerId?: string

Defined in: packages/wayfinding/src/types.ts:373

Fallback "you-are-here" marker node id — see currentLocationId.

Released under commercial licensing.