Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ccabanero/5575341 to your computer and use it in GitHub Desktop.
Save ccabanero/5575341 to your computer and use it in GitHub Desktop.
Test - Adding a Cached/Tiled Map Server layer to an AGSMapView. ArcGIS for iOS Runtime SDK.
- (void)viewDidLoad
{
[super viewDidLoad];
//custom navigation bar
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed: @"customNavImage"] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.translucent = YES;
//create an envelope of Seattle
AGSEnvelope *seattleExtent = [AGSEnvelope envelopeWithXmin:-13622101.11 ymin:6038257.54 xmax:-13613501.94 ymax:6043990.32 spatialReference:self.agsMapView.spatialReference];
[self.agsMapView zoomToEnvelope:seattleExtent animated:YES];
//add streets base map layer
NSString *streetURL = @"http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer";
AGSTiledMapServiceLayer *streetLayer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:[NSURL URLWithString:streetURL]];
[self.agsMapView addMapLayer:streetLayer withName:@"streetlayer"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment