I am working with map. I have a problem. I used following code to Zoom from the reference of this link in stackOverFlow
It's Easy to Zoom map.
But now,
I can't zoom in and out map. it means i cant change or find another place. it's only focus on current location. It's behave like an image Fix are. I can't understand what to do?
Please Help.
My Code as Follow.
- (void) viewDidLoad
{
[self.mapView.userLocation addObserver:self
forKeyPath:@"location"
options:(NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld)
context:nil];
}
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
MKCoordinateRegion region;
region.center = self.mapView.userLocation.coordinate;
MKCoordinateSpan span;
span.latitudeDelta = 1; // Change these values to change the zoom
span.longitudeDelta = 1;
region.span = span;
[self.mapView setRegion:region animated:YES];
}