Catching map scale changes

606
1
10-06-2011 11:06 AM
MelindaFrost
Occasional Contributor
I have looked at the delegates available on AGSMapView but not seeing anything pop out at me that would help. I see on touch the single tap but that is never called when you do the normal double tap to zoom let alone pinches. Am I missing something?
Thanks
0 Kudos
1 Reply
NimeshJarecha
Esri Regular Contributor
You should listen to the AGSMapView's notifications for this.

Here the doc from above link...

The map component also broadcasts four notifications - MapViewDidLoad, MapTimeExtentChanged, MapDidEndPanning and MapDidEndZooming. Observers interested in these notifications can register for them using the default NSNotificationCenter.


Here is the code...

//add this code line in your viewDidLoad or mapViewDidLoad
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(respondToZoom:) name:@"MapDidEndZooming" object:nil];

//add this to your .m file
- (void)respondToZoom:(NSNotification*)notification { 
 NSLog(@"map scale: %.6f",self.mapView.mapScale);
}


Hope this helps!

Regards,
Nimesh
0 Kudos