An annotation that groups two or more distinct annotations into a single entity.


class MKClusterAnnotation : NSObject


A cluster annotation object stands in for the group of annotations. Cluster views promote legibility of the underlying annotations by displaying a single annotation whose title is taken from one annotation and whose subtitle indicates how many additional annotations belong to the group.

MapKit automatically creates cluster annotations when two or more annotation views become grouped too closely together on the map surface. To customize the cluster annotations displayed on your map, implement the mapView(_:clusterAnnotationForMemberAnnotations:) method in your map's delegate.


Creating a Cluster Annotation

init(memberAnnotations: [MKAnnotation])

Initializes the cluster annotations with the specified individual annotations.

Getting the Cluster Attributes

var title: String?

The title string to display for the group of annotations.

var subtitle: String?

The subtitle string to display for the group of annotations.

Getting the Annotations

var memberAnnotations: [MKAnnotation]

The annotations that are grouped together by the cluster.


Inherits From

See Also

Annotation Groups

Decluttering a Map with MapKit Annotation Clustering

Enhance the readability of a map by replacing overlapping annotations with a clustering annotation view.