PointAnnotationGroup
@_documentation(visibility: public)
@_spi(Experimental)
public struct PointAnnotationGroup<Data, ID> : PrimitiveMapContent where Data : RandomAccessCollection, ID : Hashable
Displays a group of point annotations.
Always prefer to use annotation group over individual annotation if more than one annotation of the same type is displayed. The annotation group is usually more performant, since only one underlying layer is used to draw multiple annotations.
Annotation group allows to configure group-related options, such as clustering (only for point annotations) and others.
-
Undocumented
Declaration
Swift
@_documentation(visibility: public) public init(_ data: Data, id: KeyPath<Data.Element, ID>, content: @escaping (Data.Element) -> PointAnnotation)
-
Undocumented
Declaration
Swift
@_documentation(visibility: public) public init(_ data: Data, content: @escaping (Data.Element) -> PointAnnotation) where ID == Data.Element.ID, Data.Element : Identifiable
-
If true, the icon will be visible even if it collides with other previously drawn symbols.
Declaration
Swift
@_documentation(visibility: public) public func iconAllowOverlap(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
If true, other symbols can be visible even if they collide with the icon.
Declaration
Swift
@_documentation(visibility: public) public func iconIgnorePlacement(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
If true, the icon may be flipped to prevent it from being rendered upside-down.
Declaration
Swift
@_documentation(visibility: public) public func iconKeepUpright(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
Declaration
Swift
@_documentation(visibility: public) public func iconOptional(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
Size of the additional area around the icon bounding box used for detecting symbol collisions.
Declaration
Swift
@_documentation(visibility: public) public func iconPadding(_ newValue: Double) -> PointAnnotationGroup<Data, ID>
-
Orientation of icon when map is pitched.
Declaration
Swift
@_documentation(visibility: public) public func iconPitchAlignment(_ newValue: IconPitchAlignment) -> PointAnnotationGroup<Data, ID>
-
In combination with
symbol-placement
, determines the rotation behavior of icons.Declaration
Swift
@_documentation(visibility: public) public func iconRotationAlignment(_ newValue: IconRotationAlignment) -> PointAnnotationGroup<Data, ID>
-
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don’t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
Declaration
Swift
@_documentation(visibility: public) public func symbolAvoidEdges(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
Label placement relative to its geometry.
Declaration
Swift
@_documentation(visibility: public) public func symbolPlacement(_ newValue: SymbolPlacement) -> PointAnnotationGroup<Data, ID>
-
Distance between two symbol anchors.
Declaration
Swift
@_documentation(visibility: public) public func symbolSpacing(_ newValue: Double) -> PointAnnotationGroup<Data, ID>
-
Position symbol on buildings (both fill extrusions and models) roof tops. In order to have minimal impact on performance, this is supported only when
fill-extrusion-height
is not zoom-dependent and not edited after initial bucket creation. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building roofs. Symbols are sorted by elevation, except in case whenviewport-y
sorting orsymbol-sort-key
are applied.Declaration
Swift
@_documentation(visibility: public) public func symbolZElevate(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use
symbol-sort-key
.Declaration
Swift
@_documentation(visibility: public) public func symbolZOrder(_ newValue: SymbolZOrder) -> PointAnnotationGroup<Data, ID>
-
If true, the text will be visible even if it collides with other previously drawn symbols.
Declaration
Swift
@_documentation(visibility: public) public func textAllowOverlap(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
Font stack to use for displaying text.
Declaration
Swift
@_documentation(visibility: public) public func textFont(_ newValue: [String]) -> PointAnnotationGroup<Data, ID>
-
If true, other symbols can be visible even if they collide with the text.
Declaration
Swift
@_documentation(visibility: public) public func textIgnorePlacement(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
Declaration
Swift
@_documentation(visibility: public) public func textKeepUpright(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
Maximum angle change between adjacent characters.
Declaration
Swift
@_documentation(visibility: public) public func textMaxAngle(_ newValue: Double) -> PointAnnotationGroup<Data, ID>
-
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
Declaration
Swift
@_documentation(visibility: public) public func textOptional(_ newValue: Bool) -> PointAnnotationGroup<Data, ID>
-
Size of the additional area around the text bounding box used for detecting symbol collisions.
Declaration
Swift
@_documentation(visibility: public) public func textPadding(_ newValue: Double) -> PointAnnotationGroup<Data, ID>
-
Orientation of text when map is pitched.
Declaration
Swift
@_documentation(visibility: public) public func textPitchAlignment(_ newValue: TextPitchAlignment) -> PointAnnotationGroup<Data, ID>
-
In combination with
symbol-placement
, determines the rotation behavior of the individual glyphs forming the text.Declaration
Swift
@_documentation(visibility: public) public func textRotationAlignment(_ newValue: TextRotationAlignment) -> PointAnnotationGroup<Data, ID>
-
To increase the chance of placing high-priority labels on the map, you can provide an array of
text-anchor
locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Usetext-justify: auto
to choose justification based on anchor position. To apply an offset, use thetext-radial-offset
or the two-dimensionaltext-offset
.Declaration
Swift
@_documentation(visibility: public) public func textVariableAnchor(_ newValue: [TextAnchor]) -> PointAnnotationGroup<Data, ID>
-
The property allows control over a symbol’s orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single ‘vertical’ enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either [‘horizontal’, ‘vertical’] or [‘vertical’, ‘horizontal’], the order doesn’t affect the placement.
Declaration
Swift
@_documentation(visibility: public) public func textWritingMode(_ newValue: [TextWritingMode]) -> PointAnnotationGroup<Data, ID>
-
Distance that the icon’s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
Declaration
Swift
@_documentation(visibility: public) public func iconTranslate(_ newValue: [Double]) -> PointAnnotationGroup<Data, ID>
-
Controls the frame of reference for
icon-translate
.Declaration
Swift
@_documentation(visibility: public) public func iconTranslateAnchor(_ newValue: IconTranslateAnchor) -> PointAnnotationGroup<Data, ID>
-
Distance that the text’s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
Declaration
Swift
@_documentation(visibility: public) public func textTranslate(_ newValue: [Double]) -> PointAnnotationGroup<Data, ID>
-
Controls the frame of reference for
text-translate
.Declaration
Swift
@_documentation(visibility: public) public func textTranslateAnchor(_ newValue: TextTranslateAnchor) -> PointAnnotationGroup<Data, ID>
-
Defines point annotation clustering options.
Note
Clustering options aren’t updatable. Only the first value passed to this function set will take effect.Declaration
Swift
@_documentation(visibility: public) public func clusterOptions(_ newValue: ClusterOptions) -> PointAnnotationGroup<Data, ID>
-
Defines relative position of the layers drawing the annotations managed by the current group.
Note
Layer position isn’t updatable. Only the first value passed to this function set will take effect.Declaration
Swift
@_documentation(visibility: public) public func layerPosition(_ newValue: LayerPosition) -> PointAnnotationGroup<Data, ID>