The route, with its importantRoadStretch sections.
Where to look along the route, and how much of a road to require.
The roads in order along the route, each once however many stretches it has.
index, as a road with no name to print.importantRoadStretch sections, which calculateRoute returns unless its
sectionTypes leaves them out. A route without them has no important roads.sections only hold its stretches within within, whole, so they suit
RoutingModule.setSectionFocus on the routes shown.sections.distinct as within for the roads that set a route apart from its alternatives.const routes = await calculateRoute({ locations, maxAlternatives: 2 });
routes.features.forEach((route) => {
const roads = getImportantRoads(route, { within: route.properties.sections.distinct, minLengthInMeters: 5000 });
console.log(`via ${roads.map((road) => road.name).filter(Boolean).join(', ')}`);
});
Lists the important roads a route takes: the motorways and main roads that identify its course, which tell it apart from its alternatives.