diff --git a/README.md b/README.md index b807e25..73201e5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ clusterlayer-plugin-ios ======================= -A cluster layer extension to the ArcGIS Runtime for iOS. +A cluster layer extension to the [ArcGIS Runtime for iOS](https://developers.arcgis.com/ios/). + +The gridding code is based heavily on [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster/blob/master/src/DistanceGrid.js) + +![App](clusterlayer-ios.png) \ No newline at end of file diff --git a/Source/AGSClusterLayer/AGSClusterLayer.m b/Source/AGSClusterLayer/AGSClusterLayer.m index 67d85e5..a4f3ce3 100644 --- a/Source/AGSClusterLayer/AGSClusterLayer.m +++ b/Source/AGSClusterLayer/AGSClusterLayer.m @@ -120,7 +120,6 @@ -(void)rebuildClusterGrid { for (id feature in self.featureLayer.graphics) { [self.grid addFeature:feature]; } - NSLog(@"Clusters built: %@", self.grid); } -(void) renderClusters { diff --git a/Source/AGSClusterLayer/AGSClusterLayerRenderer.h b/Source/AGSClusterLayer/AGSClusterLayerRenderer.h index 3d3eb2a..4473d27 100644 --- a/Source/AGSClusterLayer/AGSClusterLayerRenderer.h +++ b/Source/AGSClusterLayer/AGSClusterLayerRenderer.h @@ -7,8 +7,11 @@ // #import -@class AGSClusterLayer; +#import "AGSCluster.h" + +typedef AGSSymbol*(^SymbolGeneratorBlock)(AGSCluster *); @interface AGSClusterLayerRenderer : AGSSimpleRenderer -(id)initAsSurrogateFor:(AGSRenderer *)originalRenderer; +-(id)initAsSurrogateFor:(AGSRenderer *)originalRenderer clusterSymbolBlock:(SymbolGeneratorBlock)clusterSymbolGenerator coverageSymbolBlock:(SymbolGeneratorBlock)coverageSymbolGenerator; @end \ No newline at end of file diff --git a/Source/AGSClusterLayer/AGSClusterLayerRenderer.m b/Source/AGSClusterLayer/AGSClusterLayerRenderer.m index 3170492..ed7ca18 100644 --- a/Source/AGSClusterLayer/AGSClusterLayerRenderer.m +++ b/Source/AGSClusterLayer/AGSClusterLayerRenderer.m @@ -8,12 +8,9 @@ #import "AGSClusterLayerRenderer.h" #import -#import "AGSCluster.h" #define kClusterPayloadKey @"__cluster" -typedef AGSSymbol*(^SymbolGeneratorBlock)(AGSCluster *); - @interface AGSClusterLayerRenderer () @property (nonatomic, weak) AGSRenderer *originalRenderer; @property (nonatomic, copy) SymbolGeneratorBlock clusterGenBlock; diff --git a/clusterlayer-ios.png b/clusterlayer-ios.png new file mode 100644 index 0000000..bc3ad2a Binary files /dev/null and b/clusterlayer-ios.png differ