The route, with its sections.
Where to look along the route, and for which section types.
The types the route has within the spans, each with its sections there and their length.
lengthInMeters. Its shares entry says how much of it
that part is, to prorate a traffic section's delayInSeconds, for example.RoutingModule.setSectionFocus on the routes shown.sections.distinct as within for what sets a route apart from its alternatives.
compareRoutes weighs it against one other route.const routes = await calculateRoute({ locations, maxAlternatives: 2 });
routes.features.forEach((route) => {
const own = getSectionsWithin(route, { within: route.properties.sections.distinct, types: ['ferry', 'toll'] });
if (own.ferry) console.log(`takes a ferry for ${formatDistance(own.ferry.lengthInMeters)}`);
if (own.toll) console.log(`pays ${own.toll.sections.length} tolls of its own`);
});
Lists a route's sections within spans of it, type by type, such as the ferries, tolls and traffic on the roads only that route takes.