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.

Lifecycle

  • Creates the instance with the instruction distance threshold.

    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.

Public

  • Defines default values for TomTomGuidanceEngine.

    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.

    Declaration

    Swift

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

    Declaration

    Swift

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

    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

    NavigationSnapshotError.unavailableTripSnapshot if there is no route plan available. GuidanceEngineError.noNextInstructions if there are no new instructions.

    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.

    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.

    Declaration

    Swift

    public func reset()