A cluster layer extension to the ArcGIS Runtime for iOS.
The gridding code is based heavily on Leaflet.markercluster
##Usage
- Import
AGSClusterLayer.h
- Add an
AGSFeatureLayer
to theAGSMapView
- Create an
AGSClusterLayer
with theAGSFeatureLayer
and add it to theAGSMapView
#import "AGSClusterLayer.h"
#define kGreyBasemap @"http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"
#define kGreyBasemapRef @"http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer"
- (void)viewDidLoad
{
[super viewDidLoad];
[self.mapView addMapLayer:[AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:[NSURL URLWithString:kGreyBasemap]]];
AGSFeatureLayer *featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:[NSURL URLWithString:kFeatureLayerURL] mode:AGSFeatureLayerModeOnDemand];
[self.mapView addMapLayer:featureLayer];
self.clusterLayer = [AGSClusterLayer clusterLayerForFeatureLayer:featureLayer];
[self.mapView addMapLayer:self.clusterLayer];
self.clusterLayer.showClusterCoverages = self.coverageSwitch.on; // By default, coverages are not shown
}