ClusterManager
open class ClusterManager
Undocumented
-
The current zoom level of the visible map region.
Min value is 0 (max zoom out), max is 20 (max zoom in).
Declaration
Swift
open internal(set) var zoomLevel: Double { get }
-
The maximum zoom level before disabling clustering.
Min value is 0 (max zoom out), max is 20 (max zoom in). The default is 20.
Declaration
Swift
open var maxZoomLevel: Double
-
The minimum number of annotations for a cluster.
The default is 2.
Declaration
Swift
open var minCountForClustering: Int
-
Whether to remove invisible annotations.
The default is true.
Declaration
Swift
open var shouldRemoveInvisibleAnnotations: Bool
-
Whether to arrange annotations in a circle if they have the same coordinate.
The default is true.
Declaration
Swift
open var shouldDistributeAnnotationsOnSameCoordinate: Bool
-
The position of the cluster annotation.
See moreDeclaration
Swift
public enum ClusterPosition
-
The position of the cluster annotation. The default is
.nearCenter
.Declaration
Swift
open var clusterPosition: ClusterManager.ClusterPosition
-
The list of annotations associated.
The objects in this array must adopt the MKAnnotation protocol. If no annotations are associated with the cluster manager, the value of this property is an empty array.
Declaration
Swift
open var annotations: [MKAnnotation] { get }
-
The list of visible annotations associated.
Declaration
Swift
open var visibleAnnotations: [MKAnnotation]
-
The list of nested visible annotations associated.
Declaration
Swift
open var visibleNestedAnnotations: [MKAnnotation] { get }
-
Undocumented
Declaration
Swift
open weak var delegate: ClusterManagerDelegate?
-
Undocumented
Declaration
Swift
public init()
-
Adds an annotation object to the cluster manager.
Declaration
Swift
open func add(_ annotation: MKAnnotation)
Parameters
annotation
An annotation object. The object must conform to the MKAnnotation protocol.
-
Adds an array of annotation objects to the cluster manager.
Declaration
Swift
open func add(_ annotations: [MKAnnotation])
Parameters
annotations
An array of annotation objects. Each object in the array must conform to the MKAnnotation protocol.
-
Removes an annotation object from the cluster manager.
Declaration
Swift
open func remove(_ annotation: MKAnnotation)
Parameters
annotation
An annotation object. The object must conform to the MKAnnotation protocol.
-
Removes an array of annotation objects from the cluster manager.
Declaration
Swift
open func remove(_ annotations: [MKAnnotation])
Parameters
annotations
An array of annotation objects. Each object in the array must conform to the MKAnnotation protocol.
-
Removes all the annotation objects from the cluster manager.
Declaration
Swift
open func removeAll()
-
Reload the annotations on the map view.
Declaration
Swift
open func reload(mapView: MKMapView, completion: @escaping (Bool) -> Void = { finished in })
Parameters
mapView
The map view object to reload.
completion
A closure to be executed when the reload finishes. The closure has no return value and takes a single Boolean argument that indicates whether or not the reload actually finished before the completion handler was called.
-
Undocumented
Declaration
Swift
open func clusteredAnnotations(zoomScale: Double, visibleMapRect: MKMapRect, operation: Operation? = nil) -> (toAdd: [MKAnnotation], toRemove: [MKAnnotation])
-
Undocumented
Declaration
Swift
open func display(mapView: MKMapView, toAdd: [MKAnnotation], toRemove: [MKAnnotation])