EventText

public struct EventText : Hashable

Contains all the information regarding the next text announcement.

  • Indicates the type of text announcement

    Declaration

    Swift

    public var type: TextNotificationType
  • Distance in meters to the location of the event for which the text notification is given.

    Note: For greater distances, distance in kilometers is rounded to the nearest digit (0.5 or greater rounds up, else down) to simplify the distance phrase in ManeuverNotifications texts during navigation. Distance in miles is rounded to the nearest 0.5 step. For example, 3.5 kilometers are rounded to 4 kilometers and the notification will begin with After 4 kilometers.... However, 3.5 miles are not rounded up and the notification will begin with After three and a half miles.... Same for 3.7 miles, whereas 3.8 miles are rounded to 4 miles. Note that the measurement units itself are defined in the UnitSystem class.

    Declaration

    Swift

    public var distanceInMeters: Double
  • The text notification instruction. The text is formatted and localized as specified via RouteTextOptions.

    Note: During navigation, the text will be always empty when the Maneuver is taken from the Navigator or VisualNavigator instance via the provided index. The text instruction that can be accessed from the Route instance is meant as preview and it is not necessarily matching the more comprehensive maneuver information you can access during navigation. This information can be enhanced with real-time ManeuverNotifications texts that can be used for spoken text notifications during a trip.

    Declaration

    Swift

    public var text: String
  • Information about the next maneuver. Is non-nil only for EventText.type equals to TextNotificationType.maneuver.

    Declaration

    Swift

    public var maneuverNotificationDetails: ManeuverNotificationDetails?
  • Information for a spatial text notifications. When EventTextOptions.enableSpatialAudio is false, then this attribute will be nil.

    Declaration

    Swift

    public var spatialNotificationDetails: SpatialNotificationDetails?
  • Creates a new instance.

    • Parameters

      • type: Indicates the type of text announcement
      • distanceInMeters: Distance in meters to the location of the event for which the text notification is given.

      Note: For greater distances, distance in kilometers is rounded to the nearest digit (0.5 or greater rounds up, else down) to simplify the distance phrase in ManeuverNotifications texts during navigation. Distance in miles is rounded to the nearest 0.5 step. For example, 3.5 kilometers are rounded to 4 kilometers and the notification will begin with After 4 kilometers.... However, 3.5 miles are not rounded up and the notification will begin with After three and a half miles.... Same for 3.7 miles, whereas 3.8 miles are rounded to 4 miles. Note that the measurement units itself are defined in the UnitSystem class.

      • text: The text notification instruction. The text is formatted and localized as specified via RouteTextOptions.

      Note: During navigation, the text will be always empty when the Maneuver is taken from the Navigator or VisualNavigator instance via the provided index. The text instruction that can be accessed from the Route instance is meant as preview and it is not necessarily matching the more comprehensive maneuver information you can access during navigation. This information can be enhanced with real-time ManeuverNotifications texts that can be used for spoken text notifications during a trip.

    Declaration

    Swift

    public init(type: TextNotificationType, distanceInMeters: Double, text: String, maneuverNotificationDetails: ManeuverNotificationDetails? = nil, spatialNotificationDetails: SpatialNotificationDetails? = nil)