![]() |
OCMapView 1.0
Simple and easy to use clustering mapView.
|
00001 // 00002 // OCMapView.h 00003 // openClusterMapView 00004 // 00005 // Created by Botond Kis on 14.07.11. 00006 // 00007 00008 #import <UIKit/UIKit.h> 00009 #import <MapKit/MapKit.h> 00010 #import "OCDistance.h" 00011 #import "OCAnnotation.h" 00012 #import "OCAlgorithms.h" 00013 00014 #import <dispatch/dispatch.h> 00015 00017 00018 @interface OCMapView : MKMapView{ 00019 // Data 00020 NSMutableSet *allAnnotations; 00021 NSMutableSet *annotationsToIgnore; 00022 00023 // Clustering 00024 // read properties for explanation 00025 BOOL clusteringEnabled; 00026 OCClusteringMethod clusteringMethod; 00027 CLLocationDistance clusterSize; 00028 BOOL clusterByGroupTag; 00029 CLLocationDegrees minLongitudeDeltaToCluster; 00030 00031 // Backround Clustering 00032 dispatch_queue_t backgroundClusterQueue; 00033 } 00034 00035 // ====================================== 00036 // Overwrite the methods of the mapview 00037 00039 00040 - (void)addAnnotation:(id < MKAnnotation >)annotation; 00041 00043 00044 - (void)addAnnotations:(NSArray *)annotations; 00045 00047 00048 - (void)removeAnnotation:(id < MKAnnotation >)annotation; 00049 00051 00052 - (void)removeAnnotations:(NSArray *)annotations; 00053 00054 00055 // ====================================== 00056 // Properties 00057 00058 // 00060 00061 @property(nonatomic, readonly) NSArray *annotations; 00062 - (NSArray *)annotations; 00063 00064 // 00066 00068 @property(nonatomic, retain) NSMutableSet *annotationsToIgnore; 00069 00070 // 00072 00073 @property(nonatomic, readonly) NSArray *displayedAnnotations; 00074 - (NSArray *)displayedAnnotations; 00075 00076 // 00078 00082 @property(nonatomic, assign) BOOL clusteringEnabled; 00083 - (void)setClusteringEnabled:(BOOL)enabled; 00084 00085 // 00087 00090 @property(nonatomic, assign) OCClusteringMethod clusteringMethod; 00091 00092 00093 // 00095 00097 @property(nonatomic, assign) CLLocationDistance clusterSize; 00098 00099 // 00101 00103 @property(nonatomic, assign) BOOL clusterByGroupTag; 00104 00105 // 00107 00109 @property(nonatomic, assign) CLLocationDegrees minLongitudeDeltaToCluster; 00110 00111 // ====================================== 00112 // Clustering 00113 00115 00118 - (void)doClustering; 00119 00120 // ====================================== 00121 // Help Methods 00122 00124 00125 - (NSArray *)filterAnnotationsForVisibleMap:(NSArray *)annotationsToFilter; 00126 00127 @end