Here is the problem: I have my MKMapView
with scrollEnabled=YES
and zoomEnabled=YES
, I have a button that sets some certain region to the map and sets scrollEnabled=NO
and zoomEnabled=NO
.
Everything works fine when I simply tap that button. But if I scroll my map a bit so it starts to scroll further 'cause of inertia and tap my button while map continues to scroll I get stuck in the region my map scrolled to during inertia scrolling.
Here's some code if it helps:
- (void)openMap
{
MKMapView * mapView = self.contentView.locationView.mapView;
mapView.scrollEnabled = YES;
mapView.zoomEnabled = YES;
}
- (void)closeMap
{
MKMapView * mapView = self.contentView.locationView.mapView;
mapView.scrollEnabled = NO;
mapView.zoomEnabled = NO;
CLLocationCoordinate2D coord = {self.event.eventLocation.latitude.floatValue, self.event.eventLocation.longitude.floatValue};
mapView.region = MKCoordinateRegionMakeWithDistance(coord, 500, 500);
}
So what I want is to be able to instantly stop that inertia scroll of MKMapView when I press my button.