TextStyle

public struct TextStyle

Represents the style used to display safety locations markers.

Important

This stylization API is intended to be used for only the turn-by-turn navigation.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Initializes a new SafetyLocationStyle/TextStyle instance with the specified values.

    Declaration

    Swift

    public init(
        fontURI: String = Defaults.fontURI,
        color: UIColor = Defaults.color,
        size: Double = Defaults.size,
        offset: MarkerLabelOptions.TextOffset = Defaults.offset,
        anchoring: TextAnchoring = Defaults.anchoring
    )

    Parameters

    fontURI

    The font of the speed limit text on the marker. By default, fontURI is used.

    color

    Text color. By default, color is used.

    size

    Text size (in point units). By default, size is used.

    offset

    Double describing the offset that will be used to position the label in the TomTomSDKMapDisplay/Marker. Depending on the anchoring, the point of the label that is anchored varies: - If anchoring is left, the anchor point is the baseline-leftmost pixel of the label. - If anchoring is center, the anchor point is the baseline-center pixel of the label. - If anchoring is right, the anchor point is the baseline-rightmost pixel of the label.

        By default, ``Defaults/offset`` is used.
    
    anchoring

    TomTomSDKMapsDisplay/TextAnchoringdetermining how the label is positioned in the TomTomSDKMapDisplay/Marker. By default, anchoring is used.

  • Provides default values for TextStyle properties.

    Important

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

    Declaration

    Swift

    public enum Defaults
  • The font of the speed limit text on the marker.

    Declaration

    Swift

    public let fontURI: String
  • Text color.

    Declaration

    Swift

    public var color: UIColor
  • Text size (in point units).

    Declaration

    Swift

    public var size: Double
  • Describing the offset that will be used to position the label in the TomTomSDKMapDisplay/Marker. Depending on the anchoring, the point of the label that is anchored varies:

    • If anchoring is left, the anchor point is the baseline-leftmost pixel of the label.
    • If anchoring is center, the anchor point is the baseline-center pixel of the label.
    • If anchoring is right, the anchor point is the baseline-rightmost pixel of the label.

    Declaration

    Swift

    public var offset: MarkerLabelOptions.TextOffset
  • The anchoring that will be used to position the speed limit text. Default value is center.

    Declaration

    Swift

    public var anchoring: TextAnchoring