zoom back and zoom foreward

2668
2
04-13-2012 06:27 AM
LucaAlferi1
New Contributor
Hi
i have a quastion.
How i can create the commands for zoom back and foreward?
some suggestions?
0 Kudos
2 Replies
NimeshJarecha
Esri Regular Contributor
Yes, it is possible to create these commands. Here are the steps you should follow...

1. Create a retain property of NSMutableArray.
2. Listen to the "MapDidEndZooming" notification.
3. Add self.mapView.visibleArea.envelope to the array created in step 1.
4. From "Go Back" and "Go Forward" get the respective extent and zoom.

Regards,
Nimesh
0 Kudos
ChristopherEbright
New Contributor III
There are also methods of the mapView that you can use, for example, i have a project that has buttons for zoom in and zoom out and i set the actions on those as follows:

-(void)didTapZoomInButton:(id)sender {
    
    [self.mapView zoomIn:YES];

}

-(void)didTapZoomOutButton:(id)sender {
    
    [self.mapView zoomOut:YES];
    
}
0 Kudos