This is the documentation of version 0.64.0. Go to the latest version, 1.0.0-rc.5.

Routes

A route (Route) is a GeoJSON Feature with LineString geometry: the path. Its properties carry the summary, sections, guidance and progress. calculateRoute returns Routes, a FeatureCollection of the main route and its alternatives.

Where routes are used

Route object structure

Summary

route.properties.summary:

Sections

route.properties.sections groups the stretches of a route by type. Each section spans a range of indices into the route's coordinates. Which types a calculation returns is set by sectionTypes; a requested type appears only where the route has such a stretch (no ferry without a water crossing). The routing module draws them.

Section types

Section properties

Every section has id, startPointIndex and endPointIndex (inclusive). Types with more:

Progress

route.properties.progress gives the cumulative distance and time at points along the path. Present unless the calculation passed extendedRouteRepresentations: [].

The progress utilities interpolate between these points.

Guidance

route.properties.guidance.instructions, when the calculation requested guidance:

API reference

Route

Related guides and examples

Related guides

Map integration

Related examples