Hi,Create a new MapView and inherit from AGSMapView. Now you can Overwrite all 4 touch Functions, but do not forget to call them on super-instance. After you have created the class, change the class of your mapView in InterfaceBuilder / XCode from AGSMapView to your new created class. (see attachement)
//Header file
@interface TouchableMapView : AGSMapView {
...
}
//Mainfile
@implementation TouchableMapView
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];
......
}
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesMoved:touches withEvent:event];
.......
}
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
......
}
-(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesCancelled:touches withEvent:event];
........
}
@end
If you only want to track endpanning and endzooming you can attach your observer-object like this:In this case "self" is an UIViewController which has function mapViewDidEndPanning:(NSNotification *) notification.
//Is called when map did end panning
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mapViewDidEndPanning:) name:@"MapDidEndPanning" object:nil];
//is called when map did end zooming
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mapViewDidEndPanning:) name:@"MapDidEndZooming" object:nil];
handler function:
-(void) mapViewDidEndPanning:(NSNotification *) notification
{
//Check name of notification:
if([[notification name] isEqualToString:@"MapDidEndZooming"])
{
...
}else{
...
}
}