Skip to content

spatial-monorepo


spatial-monorepo / ui/src / WayfindingPanelProps

Interface: WayfindingPanelProps

Defined in: packages/ui/src/WayfindingPanel.tsx:11

Properties

destination?

optional destination?: string

Defined in: packages/ui/src/WayfindingPanel.tsx:12


droppedPinCoordinate?

optional droppedPinCoordinate?: Position2D | null

Defined in: packages/ui/src/WayfindingPanel.tsx:15

Map-click coordinate for Dropped Pin mode (managed externally by map event handler).


findRoute?

optional findRoute?: (origin, destination, opts?) => Promise`<DirectionsResult | null>`

Defined in: packages/ui/src/WayfindingPanel.tsx:26

Override for graph lookups. useWayfindingWorker() keeps its graph in a per-hook-instance ref, so a panel spawned separately from wherever the app builds its graph never sees it — pass the app's findRoute through so this panel resolves against the same graph (issue #816).

Find a route between origin and destination. Each accepts a single node id or an array (nearest-of-many by graph cost); origin also accepts null (resolved via opts.currentLocationId/opts.youAreHereMarkerId). Resolves the typed DirectionsResult union — null only when no graph has been built yet (issue #470).

Parameters

origin

string | string[] | null

destination

string | string[]

opts?

DirectionOptions

Returns

Promise`<DirectionsResult | null>`


gpsCoordinate?

optional gpsCoordinate?: Position2D | null

Defined in: packages/ui/src/WayfindingPanel.tsx:17

GPS coordinate for Nearest Entrance mode.


onClear?

optional onClear?: () => void

Defined in: packages/ui/src/WayfindingPanel.tsx:18

Returns

void


onRoute?

optional onRoute?: (route) => void

Defined in: packages/ui/src/WayfindingPanel.tsx:19

Parameters

route

Route

Returns

void


position?

optional position?: ControlPosition

Defined in: packages/ui/src/WayfindingPanel.tsx:13


snapToEntrance?

optional snapToEntrance?: (pt) => Promise`<string | null>`

Defined in: packages/ui/src/WayfindingPanel.tsx:30

Same override as findRoute, forwarded to the Nearest Entrance origin tab (issue #816).

Snap a [lng, lat] coordinate to the nearest entrance node id.

Parameters

pt

Position2D

Returns

Promise`<string | null>`


snapToWalkable?

optional snapToWalkable?: (pt) => Promise`<string | null>`

Defined in: packages/ui/src/WayfindingPanel.tsx:28

Same override as findRoute, forwarded to the Drop Pin origin tab (issue #816).

Snap a [lng, lat] coordinate to the nearest walkable node id.

Parameters

pt

Position2D

Returns

Promise`<string | null>`

Released under commercial licensing.