findUpcomingIntersection

fun findUpcomingIntersection(intersections: List<StepIntersection>, upcomingStep: LegStep?, currentIntersection: StepIntersection): StepIntersection?

Based on the current intersection index, add one and try to get the upcoming.

If there is not an upcoming intersection on the step, check for an upcoming step and return the first intersection from the upcoming step.

Return

the upcoming intersection on the step

Since

0.13.0

Parameters

intersections

for the current step

upcomingStep

for the first intersection if needed

currentIntersection

being traveled along