Mapbox Navigation SDK for iOS Docs Navigation SDK for iOS Reference (2.8.1)

View on GitHub

Install in Dash

Mapbox Navigation SDK for iOS Reference Configuration Reference
  • Guides
    • Using Map Matching
    • Reduce Memory Usage
    • Styling the UI
  • Turn-by-turn UI
    • NavigationViewController
    • NavigationViewControllerDelegate
    • RouteVoiceController
    • SpeechSynthesizing
    • SpeechSynthesizingDelegate
    • MapboxSpeechSynthesizer
    • SystemSpeechSynthesizer
    • MultiplexedSpeechSynthesizer
    • SpeechError
    • SpeechFailureAction
    • NavigationOptions
    • NavigationView
  • Core Navigation Logic
    • NavigationService
    • NavigationServiceDelegate
    • MapboxNavigationService
    • – NotificationUserInfoKey
    • Router
    • RouterDataSource
    • RouteController
    • – NotificationUserInfoKey
    • RouterDelegate
    • RouteProgress
    • RouteLegProgress
    • RouteStep
    • RouteStepProgress
    • CongestionLevel
    • VisualInstruction
    • VisualInstructionDelegate
    • NavigationEventsManager
    • ActiveNavigationEventsManagerDataSource
    • PassiveNavigationEventsManagerDataSource
    • NavigationLocationManager
    • ReplayLocationManager
    • SimulatedLocationManager
    • NavigationRouteOptions
    • RouteOptions
    • NavigationMatchOptions
    • SimulationMode
    • PassiveLocationManager
    • – NotificationUserInfoKey
    • HistoryRecording
  • Maps
    • NavigationMapView
    • NavigationMapViewDelegate
    • MapView
    • PassiveLocationProvider
    • NavigationLocationProvider
    • WaypointStyle
    • UserLocationStyle
  • Styling
    • Style
    • StyleManager
    • StyleManagerNotificationUserInfoKey
    • StyleManagerDelegate
    • DayStyle
    • NightStyle
  • Formatters
    • DistanceFormatter
  • UI Components
    • BottomBannerViewController
    • BottomBannerViewControllerDelegate
    • SpeedLimitView
    • UserPuckCourseView
    • UserHaloCourseView
    • CourseUpdatable
    • NavigationComponent
  • Guidance Instruction UI
    • TopBannerViewController
    • InstructionsCardViewController
    • InstructionsCardContainerView
    • InstructionsCardContainerViewDelegate
    • InstructionsBannerView
    • InstructionsBannerViewDelegate
    • BaseInstructionsBannerView
    • ManeuverView
    • JunctionView
    • GenericRouteShield
  • CarPlay
    • CarPlayManager
    • CarPlayManagerDelegate
    • CarPlayNavigationViewController
    • CarPlayNavigationViewControllerDelegate
    • CarPlayActivity
    • CarPlayCompassView
    • CarPlayMapViewController
    • CarPlayMapViewControllerDelegate
    • CarPlaySearchController
    • CarPlaySearchControllerDelegate
    • CarPlayConnectionObserver
    • RecentItem
    • NavigationGeocodedPlacemark
  • Configuration
    • RouteControllerDeadReckoningTimeInterval
    • RouteControllerMediumAlertInterval
    • RouteControllerHighAlertInterval
    • RouteControllerManeuverZoneRadius
    • RouteSnappingMaxManipulatedCourseAngle
    • RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion
    • RouteControllerMaximumDistanceBeforeRecalculating
    • RouteControllerUserLocationSnappingDistance
    • MapOrnamentPosition
    • CongestionAttribute
    • CurrentLegAttribute
    • RouteLineWidthByZoomLevel
    • NavigationMapViewMinimumDistanceForOverheadZooming
    • NavigationViewMinimumVolumeForWarning
    • GradientCongestionFadingDistance
    • RouteControllerIncorrectCourseMultiplier
    • RouteControllerLinkedInstructionBufferMultiplier
    • RouteControllerMaximumSpeedForUsingCurrentStep
    • RouteControllerMinNumberOfInCorrectCourses
    • RouteControllerMinimumBacktrackingDistanceForRerouting
    • RouteControllerMinimumDistanceForContinueInstruction
    • RouteControllerMinimumDurationRemainingForProactiveRerouting
    • RouteControllerMinimumNumberLocationUpdatesBackwards
    • RouteControllerNumberOfSecondsForRerouteFeedback
    • RouteControllerProactiveReroutingInterval
    • RouteSnappingMinimumHorizontalAccuracy
    • RouteSnappingMinimumSpeed
    • NavigationSettings
  • User Feedback
    • FeedbackViewController
    • FeedbackViewControllerDelegate
    • FeedbackItem
    • ActiveNavigationFeedbackType
    • PassiveNavigationFeedbackType
    • PassiveNavigationIncorrectVisualSubtype
    • ConfusingAudioSubtype
    • RouteQualitySubtype
    • IllegalRouteSubtype
    • RoadClosureSubtype
    • FeedbackSource
    • EndOfRouteFeedback
  • Camera
    • NavigationCamera
    • NavigationCameraType
    • NavigationCameraState
    • CameraStateTransition
    • NavigationCameraStateTransition
    • ViewportDataSource
    • NavigationViewportDataSource
    • ViewportDataSourceType
    • ViewportDataSourceDelegate
  • Electronic Horizon
    • ElectronicHorizonOptions
    • RoadGraph
    • – NotificationUserInfoKey
    • – Edge
    • – Path
    • – Position
    • – SubgraphEdge
    • OpenLRIdentifier
    • OpenLROrientation
    • RoadName
    • RoadObject
    • – EdgeLocation
    • – Kind
    • – Location
    • – Position
    • DistancedRoadObject
    • RoadObjectMatcher
    • RoadObjectStore
    • RoadObjectMatcherDelegate
    • RoadObjectStoreDelegate
    • RoadObjectMatcherError
  • Other Classes
    • DispatchTimer
    • – State
    • FeedbackEvent
    • FloatingButton
    • MapboxRoutingProvider
    • – Source
    • – Request
    • PredictiveCacheManager
    • StepInstructionsView
    • StepTableViewCell
    • WayNameLabel
    • WayNameView
  • Other Global Variables
    • CongestionRangeHeavy
    • CongestionRangeLow
    • CongestionRangeModerate
    • CongestionRangeSevere
    • RestrictedRoadClassAttribute
  • Other Enumerations
    • AlternativeRouteError
    • FeedbackScreenshotOption
    • LooksIncorrectSubtype
    • OpenLRSideOfRoad
    • PassiveNavigationRoadIssueSubtype
    • PassiveNavigationWrongTrafficSubtype
    • ReroutingError
    • RoutesPresentationStyle
    • SimulationIntent
    • SimulationState
  • Other Extensions
    • Array
    • Bundle
    • CGPoint
    • CGSize
    • CLLocation
    • CPInterfaceController
    • CameraOptions
    • CongestionRange
    • Dictionary
    • Directions
    • Locale
    • MapboxNavigationNative.RoadObjectMatcherError
    • MapboxStreetsRoadClass
    • Measurement
    • NSAttributedString
    • – Key
    • Notification
    • – Name
    • ResourceOptionsManager
    • RouteLeg
    • String
    • StyleURI
    • TileStore
    • TilesetDescriptorFactory
    • UIApplication
    • – State
    • UIDevice
    • UIEdgeInsets
    • UIFont
    • UIWindow
    • URLSessionDataTask
  • Other Protocols
    • BimodalCache
    • BimodalDataCache
    • BimodalImageCache
    • FeedbackType
    • NavigationMapInteractionObserver
    • NavigationProviderRequest
    • NavigationStatusPresenter
    • PassiveLocationManagerDelegate
    • RouteVoiceControllerDelegate
    • RoutingProvider
    • StepsViewControllerDelegate
    • TopBannerViewControllerDelegate
    • UnimplementedLogging
  • Other Structures
    • AlternativeRoute
    • – RouteInfo
    • AlternativeRouteDetectionStrategy
    • – RefreshOnEmpty
    • BearingSmoothing
    • BorderCrossing
    • FollowingCameraOptions
    • GeometryFramingAfterManeuver
    • IncidentsOptions
    • IndexedRouteResponse
    • IntersectionDensity
    • MapMatchingResult
    • NavigationViewportDataSourceOptions
    • OverviewCameraOptions
    • PitchNearManeuver
    • PredictiveCacheOptions
    • RouteAlert
    • StatusUpdatingSettings
    • TileStoreConfiguration
    • – Location
    • Tunnel
  • Other Type Aliases
    • AdvanceLegCompletionHandler
    • CarPlayUserInfo
    • CongestionRange
    • ContainerViewController
    • RoutingProviderSource
    • UserCourseView

Configuration

RouteController Rerouting logic

  • RouteControllerDeadReckoningTimeInterval

    When calculating whether or not the user is on the route, we look where the user will be given their speed and this variable.

    Declaration

    Swift

    public var RouteControllerDeadReckoningTimeInterval: TimeInterval
    View Source on GitHub
  • RouteControllerMaximumDistanceBeforeRecalculating

    Maximum number of meters the user can travel away from step before RouteControllerShouldReroute is emitted.

    Declaration

    Swift

    public var RouteControllerMaximumDistanceBeforeRecalculating: CLLocationDistance
    View Source on GitHub
  • RouteControllerIncorrectCourseMultiplier

    Given a location update, the horizontalAccuracy is used to figure out how many consective location updates to wait before rerouting due to consecutive incorrect course updates.

    Declaration

    Swift

    public var RouteControllerIncorrectCourseMultiplier: Int
    View Source on GitHub
  • RouteControllerMinNumberOfInCorrectCourses

    Minimum number of consecutive incorrect course updates before rerouting occurs.

    Declaration

    Swift

    public var RouteControllerMinNumberOfInCorrectCourses: Int
    View Source on GitHub
  • RouteControllerMinimumBacktrackingDistanceForRerouting

    The minimum distance in the opposite direction of travel that triggers rerouting.

    Declaration

    Swift

    public var RouteControllerMinimumBacktrackingDistanceForRerouting: CLLocationDistance
    View Source on GitHub
  • RouteControllerMinimumDurationRemainingForProactiveRerouting

    Minimum duration remaining in seconds for proactive rerouting to be active.

    Declaration

    Swift

    public var RouteControllerMinimumDurationRemainingForProactiveRerouting: TimeInterval
    View Source on GitHub
  • RouteControllerMinimumNumberLocationUpdatesBackwards

    Minimum number of consecutive location updates moving backwards before the user is rerouted.

    Declaration

    Swift

    public var RouteControllerMinimumNumberLocationUpdatesBackwards: Int
    View Source on GitHub
  • RouteControllerNumberOfSecondsForRerouteFeedback

    Number of seconds reroute feedback sections are shown in the feedback view after the user is rerouted.

    Declaration

    Swift

    public var RouteControllerNumberOfSecondsForRerouteFeedback: TimeInterval
    View Source on GitHub
  • RouteControllerProactiveReroutingInterval

    The number of seconds between attempts to automatically calculate a more optimal route while traveling.

    In addition to calculating a more optimal route, RouteController also refreshes time-dependent statistics about the route, such as traffic congestion and the remaining duration, as long as DirectionsOptions.profileIdentifier is set to DirectionsProfileIdentifier.automobileAvoidingTraffic and RouteOptions.refreshingEnabled is set to true.

    Declaration

    Swift

    public var RouteControllerProactiveReroutingInterval: TimeInterval
    View Source on GitHub

RouteController Notifications Alerting

  • RouteControllerMediumAlertInterval

    Number of seconds left on step when a AlertLevel.medium alert is emitted.

    Declaration

    Swift

    public var RouteControllerMediumAlertInterval: TimeInterval
    View Source on GitHub
  • RouteControllerHighAlertInterval

    Number of seconds left on step when a AlertLevel.high alert is emitted.

    Declaration

    Swift

    public var RouteControllerHighAlertInterval: TimeInterval
    View Source on GitHub
  • RouteControllerLinkedInstructionBufferMultiplier

    For shorter upcoming steps, we link the AlertLevel.high instruction. If the upcoming step duration is near the duration of RouteControllerHighAlertInterval, we need to apply a bit of a buffer to prevent back to back notifications.

    A multiplier of 1.2 gives us a buffer of 3 seconds, enough time insert a new instruction.

    Declaration

    Swift

    public let RouteControllerLinkedInstructionBufferMultiplier: Double
    View Source on GitHub
  • RouteControllerMinimumDistanceForContinueInstruction

    The minimum distance threshold used for giving a “Continue” type instructions.

    Declaration

    Swift

    public var RouteControllerMinimumDistanceForContinueInstruction: CLLocationDistance
    View Source on GitHub

Tracking RouteController Step Progress

  • RouteControllerManeuverZoneRadius

    Radius in meters the user must enter to count as completing a step. One of two heuristics used to know when a user completes a step, see RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion.

    Declaration

    Swift

    public var RouteControllerManeuverZoneRadius: CLLocationDistance
    View Source on GitHub
  • RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion

    Threshold user must be in within to count as completing a step. One of two heuristics used to know when a user completes a step, see RouteControllerManeuverZoneRadius.

    The users heading and the finalHeading are compared. If this number is within RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion, the user has completed the step.

    Declaration

    Swift

    public var RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion: Double
    View Source on GitHub

Configuring Route Snapping (CLLocation) for RouteController

  • RouteSnappingMaxManipulatedCourseAngle

    Maximum angle the user puck will be rotated when snapping the user’s course to the route line.

    Declaration

    Swift

    public var RouteSnappingMaxManipulatedCourseAngle: CLLocationDirection
    View Source on GitHub
  • RouteControllerUserLocationSnappingDistance

    Accepted deviation excluding horizontal accuracy before the user is considered to be off route.

    Declaration

    Swift

    public var RouteControllerUserLocationSnappingDistance: CLLocationDistance
    View Source on GitHub
  • MapOrnamentPosition

    The position of speed limit view and floating buttons, including the overview, mute and feedback report in a navigation view.

    See more

    Declaration

    Swift

    public enum MapOrnamentPosition
    View Source on GitHub
  • CongestionAttribute

    Attribute name for the route line that is used for identifying different CongestionLevel along the route.

    Declaration

    Swift

    public let CongestionAttribute: String
    View Source on GitHub
  • CurrentLegAttribute

    Attribute name for the route line that is used for identifying whether a RouteLeg is the current active leg.

    Declaration

    Swift

    public let CurrentLegAttribute: String
    View Source on GitHub
  • RouteLineWidthByZoomLevel

    A stop dictionary representing the default line widths of the route line by zoom level when NavigationMapViewDelegate.navigationMapView(_:routeLineLayerWithIdentifier:sourceIdentifier:) is undefined.

    You may use this constant in your implementation of NavigationMapViewDelegate.navigationMapView(_:routeLineLayerWithIdentifier:sourceIdentifier:) if you want to keep the default line widths but customize other aspects of the route line.

    Declaration

    Swift

    public var RouteLineWidthByZoomLevel: [Double : Double]
    View Source on GitHub
  • NavigationMapViewMinimumDistanceForOverheadZooming

    The minimum distance remaining on a route before overhead zooming is stopped.

    Declaration

    Swift

    @available(*, deprecated, message: "This value is no longer used.")
    public var NavigationMapViewMinimumDistanceForOverheadZooming: CLLocationDistance
    View Source on GitHub
  • NavigationViewMinimumVolumeForWarning

    The minimum volume for the device before a gentle warning is emitted when beginning navigation.

    Declaration

    Swift

    public let NavigationViewMinimumVolumeForWarning: Float
    View Source on GitHub
  • GradientCongestionFadingDistance

    The distance of fading color change between two different congestion level segments in meters.

    Declaration

    Swift

    public var GradientCongestionFadingDistance: CLLocationDistance
    View Source on GitHub
  • RouteControllerMaximumSpeedForUsingCurrentStep

    When calculating the user’s snapped location, this constant will be used for deciding upon which step coordinates to include in the calculation.

    Declaration

    Swift

    public var RouteControllerMaximumSpeedForUsingCurrentStep: CLLocationSpeed
    View Source on GitHub
  • RouteSnappingMinimumHorizontalAccuracy

    Minimum Accuracy (maximum deviation, in meters) that the route snapping engine will accept before it stops snapping.

    Declaration

    Swift

    public var RouteSnappingMinimumHorizontalAccuracy: CLLocationAccuracy
    View Source on GitHub
  • RouteSnappingMinimumSpeed

    The minimum speed value before the user’s actual location can be considered over the snapped location.

    Declaration

    Swift

    public var RouteSnappingMinimumSpeed: CLLocationSpeed
    View Source on GitHub
  • NavigationSettings

    Global settings that are used across the SDK for altering navigation behavior.

    Some properties listed in StoredProperty are stored in UserDefaults.standard.

    To specify criteria when calculating routes, use the NavigationRouteOptions class.

    To customize the user experience during a particular turn-by-turn navigation session, use the NavigationOptions class when initializing a NavigationViewController.

    To customize some global defaults use NavigationSettings.initialize(directions:tileStoreConfiguration:routingProviderSource:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:statusUpdatingSettings:) method.

    See more

    Declaration

    Swift

    public class NavigationSettings
    View Source on GitHub

© 2014–2022 Mapbox. See license for more details.

Generated by jazzy ♪♫ v0.14.2, a Realm project.