Skip to content

Commit

Permalink
Support incidents for OSRM responses
Browse files Browse the repository at this point in the history
This parses incidents on the OSRM response route leg, and splits the
incidents across the corresponding route step. Since an incident may
span multiple steps, this will duplicate an incident and adjust the
indices accordingly whenever that happens. Clients can de-duplicate
these if necessary based on the incident identifier.
  • Loading branch information
ahmedre committed Nov 14, 2024
1 parent 61e299a commit 2d1161b
Show file tree
Hide file tree
Showing 17 changed files with 1,145 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class FerrostarCoreTest {
triggerDistanceBeforeManeuver = 42.0)),
spokenInstructions = listOf(),
duration = 0.0,
annotations = null)))
annotations = null,
incidents = listOf())))

@Test
fun test401UnauthorizedRouteResponse() = runTest {
Expand Down
3 changes: 2 additions & 1 deletion apple/Sources/FerrostarCore/Mock/MockNavigationState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public extension NavigationState {
),
],
spokenInstructions: [],
annotations: nil
annotations: nil,
incidents: []
),
],
remainingWaypoints: [],
Expand Down
3 changes: 2 additions & 1 deletion apple/Sources/FerrostarSwiftUI/TestFixtureFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ struct RouteStepFactory: TestFixtureFactory {
instruction: "Walk west on \(roadNameBuilder(n))",
visualInstructions: [visualInstructionBuilder(n)],
spokenInstructions: [],
annotations: nil
annotations: nil,
incidents: []
)
}
}
Expand Down
Loading

0 comments on commit 2d1161b

Please sign in to comment.