Okie..i know what's happening. You must retain webmap so the instance remain around until web map finish loading and then you can open into mapView. Here is the code you should try..ViewController.h#import <UIKit/UIKit.h>
#import "ArcGis.h"
@interface <Classname> : UIViewController <AGSWebMapDelegate>
@interface ViewController : UIViewController
@property (retain, nonatomic) IBOutlet AGSMapView *mapView;
@property (retain, nonatomic) AGSWebmap *webmap;
@end
ViewController.m- (void)viewDidLoad {
AGSCredential* credential = [[[AGSCredential alloc] initWithUser:@"<my_user_name>" password:@"<My_passdword>"] autorelease];
credential.authType = AGSAuthenticationTypeToken;
self.webmap = [[AGSWebMap alloc] initWithItemId:@"e20f2f98b35c4963a5e124bf43c1d74a" credential:credential];
self.webmap.delegate = self
}
#pragma mark AGSWebMapDelegate
- (void)webMapDidLoad:(AGSWebMap *)webMap {
NSLog(@"delegate webMapDidLoad");
//open webmap in mapview
[self.webMap openIntoMapView:self.mapView];
}
-(void)didOpenWebMap:(AGSWebMap*)webMap intoMapView:(AGSMapView*)mapView {
NSLog(@"delegate didOpenWebMap");
}
Even though, the web map is public you must use the complete method..self.webmap = [[AGSWebMap alloc] initWithItemId:@"itemid" credential:nil];Regards,Nimesh