I'm using a MKMapView
inside an iPhone app. When I click a button the zoom level must increase. This is my first approach:
MKCoordinateRegion zoomIn = mapView.region;
zoomIn.span.latitudeDelta *= 0.5;
[mapView setRegion:zoomIn animated:YES];
However, this code had no effect, since I didn't update the longitudeDelta value. So I added this line:
zoomIn.span.longitudeDelta *= 0.5;
Now it works, but only sometimes. The latitudeDelta
and longitudeDelta
don't change in the same way, I mean, their values are not proportional. Any idea how to solve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…