OCMapView 1.0
Simple and easy to use clustering mapView.
Static Public Member Functions | Protected Attributes
OCAlgorithms Class Reference

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< OCAlgorithmDelegatedelegate
 Delegate for notifying on finished tasks.

Detailed Description

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.


Member Function Documentation

+ (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.

Parameters:
annotationsToClustercontains the Annotations that should be clustered
radiusrepresents 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.

Parameters:
annotationsToClustercontains the Annotations that should be clustered
tileRectrepresents 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.


Field Documentation

- (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.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Enumerations Enumerator Properties