TextStyle

public class TextStyle
extension MapMarker.TextStyle: NativeBase
extension MapMarker.TextStyle: Hashable

Styling options for the text of a MapMarker.

  • Thrown when a problem occurs while trying to create a MapMarker.TextStyle instance.

    Declaration

    Swift

    public typealias InstantiationError = InstantiationErrorCode
  • Creates a default set of styling options for the text of a MapMarker that consists of the following values:

    Once the resulting TextStyle is applied to a MapMarker, its text will be centered over its image. The font will be 18 pixels wide, colored opaque white and will have no visible outline.

    Declaration

    Swift

    public init()
  • Creates a set of styling options for the text of a MapMarker.

    List of placements is used to specify allowed placement of text relative to the icon. When marker overlapping is allowed as set by MapMarker.isOverlapAllowed, only first placement element is considered. Otherwise the placement value is chosen so that the text does not overlap with other MapMarker instances.

    Placement values are prioritized according to the order in which they appear in the list. Lists with duplicate entries as well as empty lists are not supported.

    Throws

    MapMarker.TextStyle.InstantiationError In case of invalid input parameters.

    Declaration

    Swift

    public init(textSize: Double, textColor: UIColor, textOutlineSize: Double, textOutlineColor: UIColor, placements: [MapMarker.TextStyle.Placement]) throws

    Parameters

    textSize

    The size of the text in pixels. Only positive values are supported.

    textColor

    The text color.

    textOutlineSize

    The size of the text outline in pixels. Only non-negative values are supported.

    textOutlineColor

    The color of the text outline.

    placements

    List of allowed placements of the text relative to the icon of a MapMarker.

  • Creates a set of styling options for the text of a MapMarker.

    Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.

    List of placements is used to specify allowed placement of text relative to the icon. When marker overlapping is allowed as set by MapMarker.isOverlapAllowed, only first placement element is considered. Otherwise the placement value is chosen so that the text does not overlap with other MapMarker instances.

    Placement values are prioritized according to the order in which they appear in the list. Lists with duplicate entries as well as empty lists are not supported.

    Throws

    MapMarker.TextStyle.InstantiationError In case of invalid input parameters.

    Declaration

    Swift

    public init(textSize: Double, textColor: UIColor, textOutlineSize: Double, textOutlineColor: UIColor, placements: [MapMarker.TextStyle.Placement], fontName: String) throws

    Parameters

    textSize

    The size of the text in pixels. Only positive values are supported.

    textColor

    The text color.

    textOutlineSize

    The size of the text outline in pixels. Only non-negative values are supported.

    textOutlineColor

    The color of the text outline.

    placements

    List of allowed placements of the text relative to the icon of a MapMarker.

    fontName

    Font name, registered with AssetsManager.registerFont. If empty string is provided, a default font will be used.

  • The font used in the text style.

    Declaration

    Swift

    public var fontName: String { get }
  • The text size in pixels.

    Declaration

    Swift

    public var textSize: Double { get }
  • The text color.

    Declaration

    Swift

    public var textColor: UIColor { get }
  • The text outline size in pixels.

    Declaration

    Swift

    public var textOutlineSize: Double { get }
  • The text outline color.

    Declaration

    Swift

    public var textOutlineColor: UIColor { get }
  • List of possible text placements relative to the icon of a MapMarker.

    Declaration

    Swift

    public var placements: [MapMarker.TextStyle.Placement] { get }
  • Describes a reason for failing to create a MapMarker.TextStyle.

    See more

    Declaration

    Swift

    public enum InstantiationErrorCode : UInt32, CaseIterable, Codable
    extension MapMarker.TextStyle.InstantiationErrorCode : Error
  • Represents text placement with respect to the icon of a MapMarker.

    See more

    Declaration

    Swift

    public enum Placement : UInt32, CaseIterable, Codable