Paul,That method is part of the AGSMapViewDelegate protocol, so you've got to implement that in a different class that uses that AGSMapViewDelegate. You then need to give the delegate to the mapView, but be careful to assign it as the mapViewDelegate and not just the delegate. I have pasted some code below:the map delegate header:#import <UIKit/UIKit.h>
#import "ArcGIS.h"
@interface iLenexaMapsDelegate : UIViewController
<AGSMapViewDelegate, UIScrollViewDelegate>
{}
@end
the map delegate implementation:#import "iLenexaMapsDelegate.h"
#import "iLenexaModel.h"
#import "iLenexaMapView.h"
@implementation iLenexaMapsDelegate
- (void)mapViewDidLoad:(AGSMapView *) mapView{
[mapView.gps start];
mapView.gps.autoPan = YES;
if(!mapView.gps.enabled){
NSLog(@"The GPS is NOT enabled!");
}
else if (mapView.gps.enabled){
NSLog(@"The GPS IS IN FACT enabled...");
}
}
-(void)mapViewDidEndPanning:(AGSMapView *) mapView{
NSLog(@"The map view did end panning");
iLenexaModel *myModel = [iLenexaModel sharedModel];
myModel.currLocation = mapView.gps.currentPoint;
}
-(void)mapViewDidEndZooming:(AGSMapView *) mapView{
NSLog(@"The map view did end zooming");
}
-(void)mapView:(AGSMapView *) mapView didAddLayerView:(id) layerView{
//Need to set the default alpha parameters on each layer...
}
-(void)mapView:(AGSMapView *) mapView didChangeEnvelope:(AGSEnvelope *) envelope{}
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
// Custom initialization
}
return self;
}
*/
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
//return (interfaceOrientation == UIInterfaceOrientationPortrait);
return YES;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end
How to create a mapViewDelegate and assign it to a mapView:// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
mapsDelegate = [[iLenexaMapsDelegate alloc] init];
mapView.mapViewDelegate = mapsDelegate;
//...and so on
}