Skip to content

Commit

Permalink
vk-1114-dangerous-maneuver: renamed route options argument usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Udumft committed Nov 10, 2021
1 parent f0dafc5 commit 81ab813
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public protocol NavigationServiceDelegate: AnyObject, UnimplementedLogging {
/**
Configures distance (in meters) before the first maneuver in requested reroute.
If implemented, this method allows to override set `RouteOptions.avoidManeuversInOriginRadius` value which is useful when adjusting reroute according to current user velocity in order to avoid dangerous maneuvers in the beginning of the route.
If implemented, this method allows to override set `RouteOptions.initialManeuverAvoidanceRadius` value which is useful when adjusting reroute according to current user velocity in order to avoid dangerous maneuvers in the beginning of the route.
This method is called after `navigationService(_:willRerouteFrom:)` is called, and before `navigationService(_:didRerouteAlong:)` is called.
Expand Down
6 changes: 3 additions & 3 deletions Sources/MapboxCoreNavigation/RouterDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Turf
*/
public enum ReroutingManeuverOffset {
/**
Leaves original `RouteOptions.avoidManeuversInOriginRadius` to be used for rerouting attempt.
Leaves original `RouteOptions.initialManeuverAvoidanceRadius` to be used for rerouting attempt.
*/
case `default`
/**
Expand All @@ -18,7 +18,7 @@ public enum ReroutingManeuverOffset {
/**
Sets offset radius (in meters).
Equivalent to setting `RouteOptions.avoidManeuversInOriginRadius` to the same radius at the beginning.
Equivalent to setting `RouteOptions.initialManeuverAvoidanceRadius` to the same radius at the beginning.
*/
case radius(LocationDistance)
}
Expand Down Expand Up @@ -59,7 +59,7 @@ public protocol RouterDelegate: AnyObject, UnimplementedLogging {
/**
Configures distance (in meters) before the first maneuver in requested reroute.
If implemented, this method allows to override set `RouteOptions.avoidManeuversInOriginRadius` value which is useful when adjusting reroute according to current user velocity in order to avoid dangerous maneuvers in the beginning of the route.
If implemented, this method allows to override set `RouteOptions.initialManeuverAvoidanceRadius` value which is useful when adjusting reroute according to current user velocity in order to avoid dangerous maneuvers in the beginning of the route.
This method is called after `router(_:willRerouteFrom:)` is called, and before `router(_:didRerouteAlong:)` is called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public protocol NavigationViewControllerDelegate: VisualInstructionDelegate {
/**
Configures distance (in meters) before the first maneuver in requested reroute.
If implemented, this method allows to override set `RouteOptions.avoidManeuversInOriginRadius` value which is useful when adjusting reroute according to current user velocity in order to avoid dangerous maneuvers in the beginning of the route.
If implemented, this method allows to override set `RouteOptions.initialManeuverAvoidanceRadius` value which is useful when adjusting reroute according to current user velocity in order to avoid dangerous maneuvers in the beginning of the route.
This method is called after `navigationViewController(_:willRerouteFrom:)` is called, and before `navigationViewController(_:didRerouteAlong:)` is called.
Expand Down
6 changes: 3 additions & 3 deletions Tests/MapboxCoreNavigationTests/RouteControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class RouteControllerTests: TestCase {
let directions = DirectionsSpy()

let navOptions = NavigationRouteOptions(coordinates: routeCoordinates)
navOptions.avoidManeuversInOriginRadius = 100
navOptions.initialManeuverAvoidanceRadius = 100

let routeController = RouteController(alongRouteAtIndex: 0,
in: routeResponse,
Expand All @@ -183,8 +183,8 @@ class RouteControllerTests: TestCase {
calculateRouteCalled.assertForOverFulfill = false

directions.onCalculateRoute = { [unowned directions] in
XCTAssertTrue((directions.lastCalculateOptions as? RouteOptions)?.avoidManeuversInOriginRadius == 500)
XCTAssertTrue((directions.lastCalculateOptions as? RouteOptions)?.initialManeuverAvoidanceRadius == 500)

calculateRouteCalled.fulfill()
}

Expand Down

0 comments on commit 81ab813

Please sign in to comment.