Skip to content

sbaskaran/clusterlayer-plugin-ios

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clusterlayer-plugin-ios

A cluster layer extension to the ArcGIS Runtime for iOS.

The gridding code is based heavily on Leaflet.markercluster

App

##Usage

  1. Import AGSClusterLayer.h
  2. Add an AGSFeatureLayer to the AGSMapView
  3. Create an AGSClusterLayer with the AGSFeatureLayer and add it to the AGSMapView
#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
}

About

A cluster layer extension to the ArcGIS Runtime for iOS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 100.0%