Skip to main content

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​

PropertyModifierTypeDescription
distancereadonlynumberMeters.
expectedTravelTimereadonlynumberSeconds.
geometryreadonlyLineStringA new object on every read.
isReleasedreadonlybooleanWhether release() was called. Readable after release.
legsreadonlyRouteLeg[]A new array on every read.