PointAnnotation

public struct PointAnnotation : Annotation, Equatable

Undocumented

  • id

    Identifier for this annotation

    Declaration

    Swift

    internal(set) public var id: String { get }
  • The geometry backing this annotation

    Declaration

    Swift

    public var geometry: Geometry { get }
  • The point backing this annotation

    Declaration

    Swift

    public var point: Point
  • Toggles the annotation’s selection state. If the annotation is deselected, it becomes selected. If the annotation is selected, it becomes deselected.

    Declaration

    Swift

    public var isSelected: Bool
  • Property to determine whether annotation can be manually moved around map

    Declaration

    Swift

    public var isDraggable: Bool
  • Handles tap gesture on this annotation.

    Should return true if the gesture is handled, or false to propagate it to the annotations or layers below.

    Declaration

    Swift

    public var tapHandler: ((MapContentGestureContext) -> Bool)? { get set }
  • Handles long press gesture on this annotation.

    Should return true if the gesture is handled, or false to propagate it to the annotations or layers below.

    Declaration

    Swift

    public var longPressHandler: ((MapContentGestureContext) -> Bool)? { get set }
  • Properties associated with the annotation

    Declaration

    Swift

    public var userInfo: [String : Any]? { get set }
  • Create a point annotation with a Point and an optional identifier.

    Declaration

    Swift

    public init(id: String = UUID().uuidString, point: Point, isSelected: Bool = false, isDraggable: Bool = false)
  • Create a point annotation with a coordinate and an optional identifier

    Declaration

    Swift

    public init(id: String = UUID().uuidString, coordinate: CLLocationCoordinate2D, isSelected: Bool = false, isDraggable: Bool = false)

    Parameters

    id

    Optional identifier for this annotation

    coordinate

    Coordinate where this annotation should be rendered

  • Part of the icon placed closest to the anchor.

    Declaration

    Swift

    public var iconAnchor: IconAnchor?
  • Name of image in sprite to use for drawing an image background.

    Declaration

    Swift

    public var iconImage: String?
  • Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of icon-size to obtain the final offset in pixels. When combined with icon-rotate the offset will be as if the rotated direction was up.

    Declaration

    Swift

    public var iconOffset: [Double]?
  • Rotates the icon clockwise.

    Declaration

    Swift

    public var iconRotate: Double?
  • Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by icon-size. 1 is the original size; 3 triples the size of the image.

    Declaration

    Swift

    public var iconSize: Double?
  • Scales the icon to fit around the associated text.

    Declaration

    Swift

    public var iconTextFit: IconTextFit?
  • Size of the additional area added to dimensions determined by icon-text-fit, in clockwise order: top, right, bottom, left.

    Declaration

    Swift

    public var iconTextFitPadding: [Double]?
  • Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When icon-allow-overlap or text-allow-overlap is false, features with a lower sort key will have priority during placement. When icon-allow-overlap or text-allow-overlap is set to true, features with a higher sort key will overlap over features with a lower sort key.

    Declaration

    Swift

    public var symbolSortKey: Double?
  • Part of the text placed closest to the anchor.

    Declaration

    Swift

    public var textAnchor: TextAnchor?
  • Value to use for a text label. If a plain string is provided, it will be treated as a formatted with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.

    Declaration

    Swift

    public var textField: String?
  • Text justification options.

    Declaration

    Swift

    public var textJustify: TextJustify?
  • Text tracking amount.

    Declaration

    Swift

    public var textLetterSpacing: Double?
  • Text leading value for multi-line text.

    Declaration

    Swift

    public var textLineHeight: Double?
  • The maximum line width for text wrapping.

    Declaration

    Swift

    public var textMaxWidth: Double?
  • Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.

    Declaration

    Swift

    public var textOffset: [Double]?
  • Radial offset of text, in the direction of the symbol’s anchor. Useful in combination with text-variable-anchor, which defaults to using the two-dimensional text-offset if present.

    Declaration

    Swift

    public var textRadialOffset: Double?
  • Rotates the text clockwise.

    Declaration

    Swift

    public var textRotate: Double?
  • Font size.

    Declaration

    Swift

    public var textSize: Double?
  • Specifies how to capitalize text, similar to the CSS text-transform property.

    Declaration

    Swift

    public var textTransform: TextTransform?
  • The color of the icon. This can only be used with SDF icons.

    Declaration

    Swift

    public var iconColor: StyleColor?
  • Controls the intensity of light emitted on the source features. This property works only with 3D light, i.e. when lights root property is defined.

    Declaration

    Swift

    public var iconEmissiveStrength: Double?
  • Fade out the halo towards the outside.

    Declaration

    Swift

    public var iconHaloBlur: Double?
  • The color of the icon’s halo. Icon halos can only be used with SDF icons.

    Declaration

    Swift

    public var iconHaloColor: StyleColor?
  • Distance of halo to the icon outline.

    Declaration

    Swift

    public var iconHaloWidth: Double?
  • Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.

    Declaration

    Swift

    public var iconImageCrossFade: Double?
  • The opacity at which the icon will be drawn.

    Declaration

    Swift

    public var iconOpacity: Double?
  • The color with which the text will be drawn.

    Declaration

    Swift

    public var textColor: StyleColor?
  • Controls the intensity of light emitted on the source features. This property works only with 3D light, i.e. when lights root property is defined.

    Declaration

    Swift

    public var textEmissiveStrength: Double?
  • The halo’s fadeout distance towards the outside.

    Declaration

    Swift

    public var textHaloBlur: Double?
  • The color of the text’s halo, which helps it stand out from backgrounds.

    Declaration

    Swift

    public var textHaloColor: StyleColor?
  • Distance of halo to the font outline. Max text halo width is ¼ of the font-size.

    Declaration

    Swift

    public var textHaloWidth: Double?
  • The opacity at which the text will be drawn.

    Declaration

    Swift

    public var textOpacity: Double?
  • Undocumented

    Declaration

    Swift

    public var image: Image? { get set }
  • Undocumented

    See more

    Declaration

    Swift

    public struct Image : Hashable
  • Part of the icon placed closest to the anchor.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconAnchor(_ newValue: IconAnchor) -> PointAnnotation
  • Name of image in sprite to use for drawing an image background.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconImage(_ newValue: String) -> PointAnnotation
  • Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of icon-size to obtain the final offset in pixels. When combined with icon-rotate the offset will be as if the rotated direction was up.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconOffset(_ newValue: [Double]) -> PointAnnotation
  • Rotates the icon clockwise.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconRotate(_ newValue: Double) -> PointAnnotation
  • Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by icon-size. 1 is the original size; 3 triples the size of the image.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconSize(_ newValue: Double) -> PointAnnotation
  • Scales the icon to fit around the associated text.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconTextFit(_ newValue: IconTextFit) -> PointAnnotation
  • Size of the additional area added to dimensions determined by icon-text-fit, in clockwise order: top, right, bottom, left.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconTextFitPadding(_ newValue: [Double]) -> PointAnnotation
  • Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When icon-allow-overlap or text-allow-overlap is false, features with a lower sort key will have priority during placement. When icon-allow-overlap or text-allow-overlap is set to true, features with a higher sort key will overlap over features with a lower sort key.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func symbolSortKey(_ newValue: Double) -> PointAnnotation
  • Part of the text placed closest to the anchor.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textAnchor(_ newValue: TextAnchor) -> PointAnnotation
  • Value to use for a text label. If a plain string is provided, it will be treated as a formatted with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textField(_ newValue: String) -> PointAnnotation
  • Text justification options.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textJustify(_ newValue: TextJustify) -> PointAnnotation
  • Text tracking amount.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textLetterSpacing(_ newValue: Double) -> PointAnnotation
  • Text leading value for multi-line text.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textLineHeight(_ newValue: Double) -> PointAnnotation
  • The maximum line width for text wrapping.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textMaxWidth(_ newValue: Double) -> PointAnnotation
  • Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textOffset(_ newValue: [Double]) -> PointAnnotation
  • Radial offset of text, in the direction of the symbol’s anchor. Useful in combination with text-variable-anchor, which defaults to using the two-dimensional text-offset if present.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textRadialOffset(_ newValue: Double) -> PointAnnotation
  • Rotates the text clockwise.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textRotate(_ newValue: Double) -> PointAnnotation
  • Font size.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textSize(_ newValue: Double) -> PointAnnotation
  • Specifies how to capitalize text, similar to the CSS text-transform property.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textTransform(_ newValue: TextTransform) -> PointAnnotation
  • The color of the icon. This can only be used with SDF icons.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconColor(_ newValue: StyleColor) -> PointAnnotation
  • Controls the intensity of light emitted on the source features. This property works only with 3D light, i.e. when lights root property is defined.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconEmissiveStrength(_ newValue: Double) -> PointAnnotation
  • Fade out the halo towards the outside.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconHaloBlur(_ newValue: Double) -> PointAnnotation
  • The color of the icon’s halo. Icon halos can only be used with SDF icons.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconHaloColor(_ newValue: StyleColor) -> PointAnnotation
  • Distance of halo to the icon outline.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconHaloWidth(_ newValue: Double) -> PointAnnotation
  • Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconImageCrossFade(_ newValue: Double) -> PointAnnotation
  • The opacity at which the icon will be drawn.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func iconOpacity(_ newValue: Double) -> PointAnnotation
  • The color with which the text will be drawn.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textColor(_ newValue: StyleColor) -> PointAnnotation
  • Controls the intensity of light emitted on the source features. This property works only with 3D light, i.e. when lights root property is defined.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textEmissiveStrength(_ newValue: Double) -> PointAnnotation
  • The halo’s fadeout distance towards the outside.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textHaloBlur(_ newValue: Double) -> PointAnnotation
  • The color of the text’s halo, which helps it stand out from backgrounds.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textHaloColor(_ newValue: StyleColor) -> PointAnnotation
  • Distance of halo to the font outline. Max text halo width is ¼ of the font-size.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textHaloWidth(_ newValue: Double) -> PointAnnotation
  • The opacity at which the text will be drawn.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func textOpacity(_ newValue: Double) -> PointAnnotation
  • Sets icon image.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func image(_ image: Image?) -> PointAnnotation
  • Adds a handler for tap gesture on current annotation.

    The handler should return true if the gesture is handled, or false to propagate it to the annotations or layers below.

    Parameters:

    • handler: A handler for tap gesture.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func onTapGesture(handler: @escaping (MapContentGestureContext) -> Bool) -> PointAnnotation
  • Adds a handler for tap gesture on current annotation.

    Parameters:

    • handler: A handler for tap gesture.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func onTapGesture(handler: @escaping () -> Void) -> PointAnnotation
  • Adds a handler for long press gesture on current annotation.

    The handler should return true if the gesture is handled, or false to propagate it to the annotations or layers below.

    Parameters:

    • handler: A handler for long press gesture.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func onLongPressGesture(handler: @escaping (MapContentGestureContext) -> Bool) -> PointAnnotation
  • Adds a handler for long press gesture on current annotation.

    Parameters:

    • handler: A handler for long press gesture.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func onLongPressGesture(handler: @escaping () -> Void) -> PointAnnotation