Show results as they arrive
Keep adding choices
Section titled “Keep adding choices”A search returns one or more result messages. Each contains a trips array. Display the first journeys as soon as they arrive and add later options to the list.
Keep a small Finding more options… indicator until the connection closes successfully.
const results = [];function onResult(result) { results.push(result); render(results); // Update your journey list.}Group useful alternatives
Section titled “Group useful alternatives”Use modifiers to label groups such as Bike First Mile, Rented Bike Last Mile or Direct Car. Use the actual leg modes for each journey’s mode strip.
Use grades to help ordering
Section titled “Use grades to help ordering”Higher grades indicate a better fit. PlanResult.grade compares the result group; TripPattern.grade orders individual trips. Show practical details such as travel time and transfers alongside the grade.
Finish the search
Section titled “Finish the search”When the search completes, stop the loading indicator. If the complete search has no journeys, offer a change of time or travel preferences. If the connection fails, show the error with a retry action.