Contents

mapView(_:clusterAnnotationForMemberAnnotations:)

Asks the delegate to provide a cluster annotation object for the specified annotations.

Declaration

optional func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [any MKAnnotation]) -> MKClusterAnnotation

Parameters

  • mapView:

    The map view containing the specified annotations.

  • memberAnnotations:

    The annotations for the map to cluster together. The returned Mkclusterannotation object needs to include the specific annotations in this parameter.

Return Value

The cluster annotation object.

Discussion

Use this method to customize the cluster annotations that display on your map. Typically, MapKit creates cluster annotation objects automatically when one or more annotations with the same cluster identifier are too close together. However, you can implement this method and return a custom cluster annotation object for the specified set of annotations.

See Also

Managing annotation views