- (void) webMapDidLoad:(AGSWebMap*) webMap {
//webmap data was retrieved successfully
NSLog(@"load successfully");
[self.webmap openIntoMapView:self.mapView];
[self.mapView setNeedsDisplay];
}
- (void) webMap:(AGSWebMap *)webMap didFailToLoadWithError:(NSError *)error {
//webmap data was not retrieved
//alert the user
NSLog(@"Error while loading webmap: %@",[error localizedDescription]);
}
-(void)didOpenWebMap:(AGSWebMap*)webMap intoMapView:(AGSMapView*)mapView{
//web map finished opening
NSLog(@"delegate method: didOpenWebMap:(AGSWebMap*)webMap intoMapView:(AGSMapView*)mapView");
}
-(void)didLoadLayer:(AGSLayer*)layer{
//layer in web map loaded properly
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *mapId = @"49c555e22cdf480181153f35d18f8863";//1d105a71e3eb499383e4b7556f0bbc34
self.webmap = [[AGSWebMap alloc] initWithItemId:mapId credential:nil];
self.webmap.delegate = self;
}
-(void)didFailToLoadLayer:(NSString*)layerTitle url:(NSURL*)url baseLayer:(BOOL)baseLayer withError:(NSError*)error
{
NSLog(@"Error while loading layer: %@",[error localizedDescription]);
}
- (void)viewDidUnload
{
[self setMapView:nil];
self.webmap = nil;
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
console output:GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011)Copyright 2004 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you arewelcome to change it and/or distribute copies of it under certain conditions.Type "show copying" to see the conditions.There is absolutely no warranty for GDB. Type "show warranty" for details.This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules allAttaching to process 1092.2012-02-11 15:38:32.540 HelloArcGis[1092:f203] load successfully2012-02-11 15:38:32.544 HelloArcGis[1092:f203] delegate method: didOpenWebMap:(AGSWebMap*)webMap intoMapView:(AGSMapView*)mapView