Avoid
Avoid defines routing restrictions for route planning input.
Constructor
Signature: new Avoid(raw?: AvoidData)
Creates an avoid rule. If raw is omitted, values is initialized as an empty array.
Methods
| Method | Signature | Purpose |
|---|---|---|
getRaw |
getRaw(): AvoidData |
Return current avoid payload |
setRaw |
setRaw(value: AvoidData): this |
Replace avoid payload |
setType |
setType(type: AvoidType): this |
Set avoid type |
addValue |
addValue(lon: number, lat: number): this |
Add avoid coordinate |
getRaw()
Returns current AvoidData.
setRaw(value)
Replaces full avoid payload.
setType(type)
Sets avoid category (tolls, highways, ferries, locations, ...).
addValue(lon, lat)
Adds one coordinate value (typically for type: 'locations').
Example
import { Avoid } from '@geoapify/route-planner-sdk';
const avoid = new Avoid()
.setType('locations')
.addValue(13.41, 52.52)
.addValue(13.37, 52.50);
AvoidData Interface
This is the original plain data object shape used in API payloads (request/response), not the SDK wrapper class.
Referenced nested interface: CoordinatesData.