How to get to the maximum scalable level on iOS MKMapView

One of my applications uses MKMapView with a very high (max) zoomLevel (map with high detail). With the introduction of iOS7 I can’t get closer to the map as before.

I am using the mapView setRegion: method for this.

I ran tests and these are the results:

covers iOS versions in full screen view:

iOS 5.1: 140 meters iOS 6.1: 70 meters iOS 7.0.3: 281 meters iOS 7.0.3: 160 meters (if pinched manually!!) 

Is there a way to reach 160 m (maximum scale) programmatically on iOS 7.0.3

(I know that the horizontal interval depends on the power, so the number of meters is only an indicator of the proportion)

+7
ios7 mapkit mkmapview zoom region
source share
1 answer

Credits for this solution go to YUF in this thread on the Apple Developer Forum:

It uses MKMapCamera to determine the zoom level, not setRegion.

 MKMapCamera* camera = [MKMapCamera cameraLookingAtCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate fromEyeCoordinate:(CLLocationCoordinate2D)eyeCoordinate eyeAltitude:(CLLocationDistance)eyeAltitude]; [mapView setCamera:camera animated:NO]; 

If you keep centerCoordinate and eyeCoordinate the same, the camera will look straight down. Height allows you to control the scale. It will not go at full speed to zero, but it will give equivalent zoom levels, as in previous versions of iOS.

+14
source share

All Articles