You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the profileIdentifier on the NavigationRouteOptions object to .cycling. The following code snippet was originally pulled from this docs page and modified in my own project slightly in order to work.
let routeOptions = NavigationRouteOptions(waypoints: [
Waypoint(coordinate: CLLocationCoordinate2D(latitude: 37.77766, longitude: -122.43199)),
Waypoint(coordinate: CLLocationCoordinate2D(latitude: 37.77609, longitude: -122.43292)),
Waypoint(coordinate: CLLocationCoordinate2D(latitude: 37.77536, longitude: -122.43494)),
])
// error is here - works when using .walking, .automobile, or .automobileAvoidingTraffic
routeOptions.profileIdentifier = .cycling
Directions.shared.calculate(routeOptions) { [weak self] (session, result) in
switch result {
case .failure(let error):
print(error.localizedDescription)
case .success(let response):
guard let route = response.routes?.first, let strongSelf = self else {
return
}
let navigationService = MapboxNavigationService(route: route, routeIndex: 0, routeOptions: routeOptions, simulating: .always)
let navigationOptions = NavigationOptions(navigationService: navigationService)
let navigationViewController = NavigationViewController(for: route, routeIndex: 0, routeOptions: routeOptions, navigationOptions: navigationOptions)
navigationViewController.delegate = strongSelf
strongSelf.present(navigationViewController, animated: true, completion: nil)
}
}
Expected behavior
The NavigationViewController is expected to present and start simulating route navigation.
Actual behavior
Log in the console:
The operation couldn’t be completed. annotations value must be one of duration, distance, speed, maxspeed, congestion
Is this a one-time issue or a repeatable issue?
repeatable
The text was updated successfully, but these errors were encountered:
Mapbox Navigation SDK version
2.17.0
Steps to reproduce
Set the
profileIdentifier
on theNavigationRouteOptions
object to.cycling
. The following code snippet was originally pulled from this docs page and modified in my own project slightly in order to work.Expected behavior
The
NavigationViewController
is expected to present and start simulating route navigation.Actual behavior
Log in the console:
The operation couldn’t be completed. annotations value must be one of duration, distance, speed, maxspeed, congestion
Is this a one-time issue or a repeatable issue?
repeatable
The text was updated successfully, but these errors were encountered: