Skip to content

spatial-monorepo


spatial-monorepo / core/src / UseWayfindingWorkerResult

Interface: UseWayfindingWorkerResult

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:81

Methods

buildGraph()

buildGraph(archive): Promise<void>

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:83

Build (or rebuild) the navigation graph from an IMDF archive.

Parameters

archive

IMDFArchive

Returns

Promise<void>


buildSearchIndex()

buildSearchIndex(archive): Promise<void>

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:106

Build (or rebuild) the MiniSearch index.

Parameters

archive

IMDFArchive

Returns

Promise<void>


findRoute()

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

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:91

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>


findRouteMultiDestination()

findRouteMultiDestination(origin, destinations, opts?): Promise<DirectionsResult | null>

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:100

Find a route through multiple destinations, in order. Resolves the typed DirectionsResult union — null only when no graph has been built yet.

Parameters

origin

string | string[] | null

destinations

string[]

opts?

DirectionOptions

Returns

Promise<DirectionsResult | null>


search(query): Promise<SearchIndexDocument[]>

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:108

Search the cached index.

Parameters

query

string

Returns

Promise<SearchIndexDocument[]>


snapToEntrance()

snapToEntrance(pt): Promise<string | null>

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:114

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

Parameters

pt

Position2D

Returns

Promise<string | null>


snapToWalkable()

snapToWalkable(pt): Promise<string | null>

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:112

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

Parameters

pt

Position2D

Returns

Promise<string | null>


updateSearchIndex()

updateSearchIndex(event): Promise<void>

Defined in: packages/core/src/hooks/useWayfindingWorker.ts:110

Patch the cached index for a single mutation event.

Parameters

event

IndexEvent

Returns

Promise<void>

Released under commercial licensing.