TomTomGuidanceEngine

public class TomTomGuidanceEngine : GuidanceEngine

TomTomGuidanceEngine generates Guidance using the list of TomTomSDKRoute.Instructions supplied within NavigationSnapshot.activeRoute.

TomTomGuidanceEngine depends on the TomTomSDKRoute.Announcements included in the supplied TomTomSDKRoute.Instructions. The engine continuously checks the active route progress to provide up-to-date Guidance information. When the vehicle reaches an announcement point, the generated Guidance includes the GuidanceAnnouncement to be announced. Note that the set of supported languages may differ between different GuidanceEngines.

TomTomGuidanceEngine should only be used with the online routing client that uses TomTomSDKRoutePlanner.GuidanceOnlineAPIVersion.v1 as the TomTomSDKRoutePlanner.GuidanceOptions.guidanceVersion. This is because the instructions from offline and the online routing client configured with TomTomSDKRoutePlanner.GuidanceOnlineAPIVersion.v1 are designed to be used by the DynamicGuidanceEngine and do not contain static announcement information.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Creates the instance with the instruction distance threshold.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public convenience init(
        appendInstructionDistanceThreshold: Double = Defaults.appendInstructionDistanceThreshold.tt.meters
    )

    Parameters

    appendInstructionDistanceThreshold

    Distance threshold to be considered when creating the next instruction list. The default value is Defaults.appendInstructionDistanceThreshold.tt.meters.

  • Defines default values for TomTomGuidanceEngine.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum Defaults
  • Default distance threshold that is considered when creating a next instruction list.

    Declaration

    Swift

    @available(*, deprecated, renamed: "TomTomGuidanceEngine.Defaults.appendInstructionDistanceThreshold", message: "This API is deprecated and will be removed with the next major release.")
    public static let defaultAppendInstructionDistanceThreshold: Double
  • Defines whether generation of announcements is enabled.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public var announcementsEnabled: Bool { get set }
  • Defines the AnnouncementMode for this GuidanceEngine.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public var announcementMode: AnnouncementMode { get set }
  • Returns a list of languages (represented as Locale) supported by GuidanceEngine.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public var availableLanguages: [Locale] { get }
  • Generates guidance which might be a new upcoming maneuver or the same with updated distance to next maneuver.

    Throws

    GuidanceEngineError.noTripSnapshot if there is no trip snapshot available. GuidanceEngineError.noNextInstructions if there are no new instructions.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func generateGuidance(navigationSnapshot: NavigationSnapshot) throws -> Guidance

    Parameters

    navigationSnapshot

    The snapshot of the current navigation session.

    Return Value

    Guidance object containing guidance information related to the current position on the route.

  • Generates a lane guidance object related to the current position on the route based on input parameters.

    Note

    LaneGuidanceUpdate is suppressed (set to nil) when none of the lanes are set as recommended.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func generateLaneGuidance(navigationSnapshot: NavigationSnapshot) -> LaneGuidanceUpdate?

    Parameters

    navigationSnapshot

    The snapshot of the current navigation session.

    Return Value

    Lane guidance info object containing lane guidance information related to the current position on the route.

  • Resets the object to the default state.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func reset()