Route with alternatives

Display route alternatives and what sets each one apart

View on GitHub
SDK 1.0.0-rc.7

Each card says what sets its route apart: how far it drives alone, its main roads and what it adds or avoids against the selected route or the usual one.

  • maxAlternatives gets the alternatives in one request, each with its sections.distinct, so the distance takes no geometry work.
  • getImportantRoads names the roads within those sections, each once.
  • compareRoutes lists the ferries, tolls, jams and closures one route takes and the other doesn’t, the usual route asking for costModel: { traffic: 'historical' }.
  • setSectionFocus rings a route’s own roads, or what a chip names, as you point at it.

Related examples