I'm trying to show an online map using AGSWebMap and I'm not sure where I'm going wrong.
This is my code: ViewController.h
#import <UIKit/UIKit.h>
#import <ArcGIS/ArcGIS.h>
@interface ViewController : UIViewController <AGSWebMapDelegate>
@property (strong, nonatomic) IBOutlet AGSMapView *mapView;
@property (retain, nonatomic) AGSWebMap *webmap;
@end
This is my code: ViewController.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize mapView;
@synthesize webmap;
- (void)viewDidLoad{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
#pragma mark -
- (void) openIntoMapView: (AGSMapView*) mapView {
self.webmap = [[AGSWebMap alloc] initWithItemId:@"7acfdd8e056240bfaa5ba46db7cdae7d" credential:nil];
self.webmap.delegate = self;
}
- (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");
}
- (void)dealloc {
[mapView release];
[super dealloc];
}
- (void)viewDidUnload {
[self setMapView:nil];
[super viewDidUnload];
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
I keep getting an error on line 19. Saying "use of undeclared identifier 'openIntoMapView'".
could anyone help me out here. Its a public webmap so doesn't need any credentials.