How to pause the current state of mapview in iPhone? [closed]
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
开发者_Python百科 Improve this questionI have map application in which I have four buttons for Zoom In, Zoom Out, Play/Pause and Stop buttons. when zooming button is clicked map zoom in and when zoom out button is clicked map zooms out. On clicking play/pause button the user can pause the current journey and the state of the button changes to pause and when user once again clicks on the pause button the state of the button changes to play.
On clicking stop button ,the user can end the current journey. I have done with zoomin and zoomout buttons but I am confused on how to start and stop the current journey of the user.
- (IBAction)pauseButtonPressed
{
if(!isPaused)
{
mapview.showsUserLocation = NO; // if you want to stop showing user location
[yourLocationManager stopUpdatingLocation];// If you use CLLocationManager to get location
isPaused = YES;
}
else
{
mapview.showsUserLocation = YES;
[yourLocationManager startUpdatingLocation];
isPaused = NO;
}
精彩评论