Route
A route from Navigation.requestRoutes, backed by the native SDK route. The getters read a copy taken when the route was created, so they're synchronous. Routes don't survive a JS reload.
Call release() when you're done with it; the garbage collector only releases it eventually. Reading any
property but isReleased after release() throws an error with code: 'route_released'.
Guidance and the route preview keep their own reference, so releasing a route they use doesn't affect them.
Methods
release()
release(): void;
Frees the native route. Calling it again does nothing.
Returns
void
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
distance | readonly | number | Meters. |
expectedTravelTime | readonly | number | Seconds. |
geometry | readonly | LineString | A new object on every read. |
isReleased | readonly | boolean | Whether release() was called. Readable after release. |
legs | readonly | RouteLeg[] | A new array on every read. |