![]() |
OCMapView 1.0
Simple and easy to use clustering mapView.
|
MapView which should be used instead of MKMapView. More...
#import <OCMapView.h>
Public Member Functions | |
(void) | - addAnnotation: |
Adds the specified annotation to the map view. | |
(void) | - addAnnotations: |
Adds an array of annotations to the map view. | |
(void) | - removeAnnotation: |
Removes the specified annotation object from the map view. | |
(void) | - removeAnnotations: |
Removes the specified annotation objects from the map view. | |
(NSArray *) | - annotations |
(NSArray *) | - displayedAnnotations |
(void) | - setClusteringEnabled: |
(void) | - doClustering |
Start the clustering of annotations. | |
(NSArray *) | - filterAnnotationsForVisibleMap: |
Filters annotations for visibleMapRect. | |
(void) | - initSetUp |
Protected Attributes | |
NSMutableSet * | allAnnotations |
dispatch_queue_t | backgroundClusterQueue |
Properties | |
NSArray * | annotations |
The complete list of annotations associated with the receiver. (read-only) | |
NSMutableSet * | annotationsToIgnore |
List of annotations which will be ignored by the clustering algorithm. | |
NSArray * | displayedAnnotations |
The complete list of annotations displayed on the map including clusters (read-only). | |
BOOL | clusteringEnabled |
enables or disables clustering. | |
OCClusteringMethod | clusteringMethod |
Defines the clustering algorithm which should be used. | |
CLLocationDistance | clusterSize |
Defines the cluster size in units of the map width. | |
BOOL | clusterByGroupTag |
Enables multiple Clusters. | |
CLLocationDegrees | minLongitudeDeltaToCluster |
Defines the "zoom" from where the map should start clustering. |
MapView which should be used instead of MKMapView.
OCMapView works like the standard MKMapView but creates clusters form its containing Annotations.
Definition at line 18 of file OCMapView.h.
- (void) addAnnotation: | (id < MKAnnotation >) | annotation |
Adds the specified annotation to the map view.
The annotation object to add to the receiver. This object must conform to the MKAnnotation protocol.
Definition at line 64 of file OCMapView.m.
- (void) addAnnotations: | (NSArray *) | annotations |
Adds an array of annotations to the map view.
An array of annotation objects. Each object in the array must conform to the MKAnnotation protocol.
Definition at line 69 of file OCMapView.m.
- (NSArray *) annotations |
- (NSArray *) displayedAnnotations |
- (void) doClustering |
Start the clustering of annotations.
Handles the ignoreList of annotations, calls the defined clustering algorithm and adds the clustered annotations to the map.
Definition at line 114 of file OCMapView.m.
- (NSArray *) filterAnnotationsForVisibleMap: | (NSArray *) | annotationsToFilter |
Filters annotations for visibleMapRect.
This method filters the annotations for the visibleMapRect.
Definition at line 173 of file OCMapView.m.
- (void) initSetUp |
- (void) removeAnnotation: | (id < MKAnnotation >) | annotation |
Removes the specified annotation object from the map view.
The annotation object to remove. This object must conform to the MKAnnotation protocol.
Definition at line 74 of file OCMapView.m.
- (void) removeAnnotations: | (NSArray *) | annotations |
Removes the specified annotation objects from the map view.
The array of annotations to remove. Objects in the array must conform to the MKAnnotation protocol.
Definition at line 79 of file OCMapView.m.
- (void) setClusteringEnabled: | (BOOL) | enabled |
Definition at line 106 of file OCMapView.m.
- (NSMutableSet*) allAnnotations [protected] |
Definition at line 20 of file OCMapView.h.
- (dispatch_queue_t) backgroundClusterQueue [protected] |
Definition at line 32 of file OCMapView.h.
- (NSArray *) annotations [read, assign] |
The complete list of annotations associated with the receiver. (read-only)
The objects in this array must adopt the
Definition at line 61 of file OCMapView.h.
- (NSMutableSet *) annotationsToIgnore [read, write, retain] |
List of annotations which will be ignored by the clustering algorithm.
The objects in this array must adopt the
Definition at line 21 of file OCMapView.h.
- (BOOL) clusterByGroupTag [read, write, assign] |
Enables multiple Clusters.
If enabled, tha mapview will generate different clusters for Tags implemented by the OCGrouping protocol. default: NO
Definition at line 28 of file OCMapView.h.
- (BOOL) clusteringEnabled [read, write, assign] |
enables or disables clustering.
Setting this property will automatical call doClustering
default: YES
Definition at line 25 of file OCMapView.h.
- (OCClusteringMethod) clusteringMethod [read, write, assign] |
Defines the clustering algorithm which should be used.
default: OCClusteringMethodBubble
Definition at line 26 of file OCMapView.h.
- (CLLocationDistance) clusterSize [read, write, assign] |
Defines the cluster size in units of the map width.
eg. clusterSize 0.5 is the half of the map. default: 0.2
Definition at line 27 of file OCMapView.h.
- (NSArray *) displayedAnnotations [read, assign] |
The complete list of annotations displayed on the map including clusters (read-only).
The objects in this array must adopt the
Definition at line 73 of file OCMapView.h.
- (CLLocationDegrees) minLongitudeDeltaToCluster [read, write, assign] |
Defines the "zoom" from where the map should start clustering.
If the map is zoomed below this value it won't cluster. default: 0.0 (no min. zoom)
Definition at line 29 of file OCMapView.h.