PolygonAnnotation

public struct PolygonAnnotation : 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 polygon backing this annotation

    Declaration

    Swift

    public var polygon: Polygon
  • 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 polygon annotation with a Polygon and an optional identifier.

    Declaration

    Swift

    public init(id: String = UUID().uuidString, polygon: Polygon, isSelected: Bool = false, isDraggable: Bool = false)
  • Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

    Declaration

    Swift

    public var fillSortKey: Double?
  • The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color’s opacity will not affect the opacity of the 1px stroke, if it is used.

    Declaration

    Swift

    public var fillColor: StyleColor?
  • The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1px stroke around the fill, if the stroke is used.

    Declaration

    Swift

    public var fillOpacity: Double?
  • The outline color of the fill. Matches the value of fill-color if unspecified.

    Declaration

    Swift

    public var fillOutlineColor: StyleColor?
  • Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, …, 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

    Declaration

    Swift

    public var fillPattern: String?
  • Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func fillSortKey(_ newValue: Double) -> PolygonAnnotation
  • The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color’s opacity will not affect the opacity of the 1px stroke, if it is used.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func fillColor(_ newValue: StyleColor) -> PolygonAnnotation
  • The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1px stroke around the fill, if the stroke is used.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func fillOpacity(_ newValue: Double) -> PolygonAnnotation
  • The outline color of the fill. Matches the value of fill-color if unspecified.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func fillOutlineColor(_ newValue: StyleColor) -> PolygonAnnotation
  • Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, …, 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

    Declaration

    Swift

    @_documentation(visibility: public)
    public func fillPattern(_ newValue: String) -> PolygonAnnotation
  • 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) -> PolygonAnnotation
  • 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) -> PolygonAnnotation
  • 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) -> PolygonAnnotation
  • 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) -> PolygonAnnotation