CCHMapClusterController Class Reference
| Inherits from | NSObject |
| Declared in | CCHMapClusterController.h CCHMapClusterController.m |
Overview
Controller to cluster annotations. Automatically updates clustering when user zooms or pans the map.
Tasks
-
annotationsproperty -
mapViewproperty -
marginFactorproperty -
cellSizeproperty -
debuggingEnabledproperty -
delegateproperty -
clustererproperty -
reuseExistingClusterAnnotationsproperty -
animatorproperty -
– initWithMapView: -
– addAnnotations:withCompletionHandler: -
– removeAnnotations:withCompletionHandler: -
– selectAnnotation:andZoomToRegionWithLatitudinalMeters:longitudinalMeters:
Properties
animator
Delegate to define strategy for animating cluster annotations in and out (default: CCHFadeInOutMapAnimator).
@property (nonatomic, weak) id<CCHMapAnimator> animatorDeclared In
CCHMapClusterController.hannotations
Clustered annotations.
@property (nonatomic, copy, readonly) NSSet *annotationsDeclared In
CCHMapClusterController.hcellSize
Cell size in [points] (default: 60).
@property (nonatomic, assign) double cellSizeDeclared In
CCHMapClusterController.hclusterer
Delegate to define strategy for positioning cluster annotations (default: CCHCenterOfMassMapClusterer).
@property (nonatomic, weak) id<CCHMapClusterer> clustererDeclared In
CCHMapClusterController.hdebuggingEnabled
Displays the grid used for clustering.
@property (nonatomic, assign, getter=isDebuggingEnabled) BOOL debuggingEnabledDeclared In
CCHMapClusterController.hdelegate
Delegate to configure cluster annotations.
@property (nonatomic, weak) id<CCHMapClusterControllerDelegate> delegateDeclared In
CCHMapClusterController.hmapView
Map view to display clustered annotations.
@property (nonatomic, strong, readonly) MKMapView *mapViewDeclared In
CCHMapClusterController.hmarginFactor
Multiplier to extend visible area that’s included for clustering (default: 0.5).
@property (nonatomic, assign) double marginFactorDeclared In
CCHMapClusterController.hreuseExistingClusterAnnotations
Reuse existing cluster annotations for a cell (default: YES).
@property (nonatomic, assign) BOOL reuseExistingClusterAnnotationsDeclared In
CCHMapClusterController.hInstance Methods
addAnnotations:withCompletionHandler:
Adds annotations and immediately updates clustering.
- (void)addAnnotations:(NSArray *)annotations withCompletionHandler:(void ( ^ ) ( ))completionHandlerParameters
- annotations
Annotations to add.
- completionHandler
Called when the clustering finished updating.
Declared In
CCHMapClusterController.hinitWithMapView:
Initializes the cluster controller.
- (id)initWithMapView:(MKMapView *)mapViewParameters
- mapView
MKMapViewto use to display clusters.
Declared In
CCHMapClusterController.hremoveAnnotations:withCompletionHandler:
Removes annotations and immediately updates clustering.
- (void)removeAnnotations:(NSArray *)annotations withCompletionHandler:(void ( ^ ) ( ))completionHandlerParameters
- annotations
Annotations to add.
- completionHandler
Called when the clustering finished updating.
Declared In
CCHMapClusterController.hselectAnnotation:andZoomToRegionWithLatitudinalMeters:longitudinalMeters:
Zooms to the position of the cluster that contains the given annotation and selects the cluster’s annotation view.
- (void)selectAnnotation:(id<MKAnnotation>)annotation andZoomToRegionWithLatitudinalMeters:(CLLocationDistance)latitudinalMeters longitudinalMeters:(CLLocationDistance)longitudinalMetersParameters
- annotation
The annotation to look for. Uses
isEqual:to check for a matching annotation previously added withaddAnnotations:withCompletionHandler:.
- latitudinalMeters
North-to-south distance used for zooming.
- longitudinalMeters
East-to-west distance used for zooming.
Declared In
CCHMapClusterController.h