![]() |
OCMapView 1.0
Simple and easy to use clustering mapView.
|
Class containing clustering algorithms. More...
#import <OCAlgorithms.h>
Static Public Member Functions | |
(NSArray *) | + bubbleClusteringWithAnnotations:andClusterRadius:grouped: |
Bubble clustering with iteration. | |
(NSArray *) | + gridClusteringWithAnnotations:andClusterRect:grouped: |
Grid clustering with predefined size. | |
Protected Attributes | |
id< OCAlgorithmDelegate > | delegate |
Delegate for notifying on finished tasks. |
Class containing clustering algorithms.
The first release of OCMapView brings two different algorithms. This class is supposed to hold those algorithms. More algorithms are planned for future releases of OCMapView.
Note for OCMapView developers: Every algorithm has to be a class method which returns an array of OCAnnotations or a subclass of it. OR for future releases They can be instance methods if they run asynchronously. The instance holder needs to implement the delegate protocol and the method needs to call the delegate.
Definition at line 43 of file OCAlgorithms.h.
+ (NSArray *) bubbleClusteringWithAnnotations: | (NSArray *) | annotationsToCluster | |
andClusterRadius: | (CLLocationDistance) | radius | |
grouped: | (BOOL) | grouped | |
Bubble clustering with iteration.
This algorithm creates clusters based on the distance between single annotations.
annotationsToCluster | contains the Annotations that should be clustered |
radius | represents the cluster size. |
It iterates through all annotations in the array and compare their distances. If they are near engough, they will be clustered.
Definition at line 19 of file OCAlgorithms.m.
+ (NSArray *) gridClusteringWithAnnotations: | (NSArray *) | annotationsToCluster | |
andClusterRect: | (MKCoordinateSpan) | tileRect | |
grouped: | (BOOL) | grouped | |
Grid clustering with predefined size.
This algorithm creates clusters based on a defined grid.
annotationsToCluster | contains the Annotations that should be clustered |
tileRect | represents the size of a grid tile. |
It iterates through all annotations in the array and puts them into a grid tile based on their location.
Definition at line 97 of file OCAlgorithms.m.
- (id<OCAlgorithmDelegate>) delegate [protected] |
Delegate for notifying on finished tasks.
NOT USED YET. Just reserved for future usage.
Definition at line 47 of file OCAlgorithms.h.