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

Routes

A route (Route) is a GeoJSON Feature whose LineString geometry is 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. sectionTypes sets which types a calculation returns. 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). These types have more:

Progress

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

The progress utilities interpolate between these points.

Guidance

If you request guidance, each of route.properties.guidance.instructions has:

API reference

Route

Related guides and examples

Related guides

Map integration

Related examples