TextStyle
Styling options for the text of a MapMarker.
-
Thrown when a problem occurs while trying to create a
MapMarker.TextStyleinstance.Declaration
Swift
public typealias InstantiationError = InstantiationErrorCode -
Creates a default set of styling options for the text of a
MapMarkerthat consists of the following values:- Text size: 18 pixels
- Text color: opaque white
- Text outline size: 0 pixels
- Text outline color: opaque black
- Text placement:
MapMarker.TextStyle.Placement.bottom
Once the resulting
TextStyleis applied to aMapMarker, 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 otherMapMarkerinstances.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.InstantiationErrorIn case of invalid input parameters.Declaration
Parameters
textSizeThe size of the text in pixels. Only positive values are supported.
textColorThe text color.
textOutlineSizeThe size of the text outline in pixels. Only non-negative values are supported.
textOutlineColorThe color of the text outline.
placementsList 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 otherMapMarkerinstances.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.InstantiationErrorIn case of invalid input parameters.Declaration
Parameters
textSizeThe size of the text in pixels. Only positive values are supported.
textColorThe text color.
textOutlineSizeThe size of the text outline in pixels. Only non-negative values are supported.
textOutlineColorThe color of the text outline.
placementsList of allowed placements of the text relative to the icon of a
MapMarker.fontNameFont 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 } -
Describes a reason for failing to create a
See moreMapMarker.TextStyle.