Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / buildWalkInstructions

Function: buildWalkInstructions()

buildWalkInstructions(coordinates, opts?): Instruction[]

Defined in: packages/wayfinding/src/instructions.ts:117

Builds turn-by-turn walk instructions for a single leg's routed coordinate path: depart at the first point, a turn-left/turn-right/slight-left/ slight-right instruction at every vertex whose bearing delta clears the slight-turn threshold, and arrive at the last point. distanceM on each instruction is the walking distance from its coordinate to the next instruction's (0 on arrive).

Callers building a multi-leg/multi-floor route (findMultiFloorGridRoute) are expected to replace the leading depart/trailing arrive of non-boundary legs with exit-connection/take-connection steps — this function only knows about one leg's geometry, not the route's floor transitions.

Parameters

coordinates

Position2D[]

opts?

BuildInstructionsOptions = {}

Returns

Instruction[]

Released under commercial licensing.