Junior — Middle
Have you used different scales when working with MapKit?
sobes.tech AI
Answer from AI
In MapKit for iOS, you can control the map's zoom level using the region property of the MKMapView object. The zoom level is set via MKCoordinateRegion, which includes the center of the map and a radius (latitude and longitude in degrees) of the displayed area. For example, to zoom in and show a more detailed area, you can decrease the radius, and to show a larger area, increase it.
Example of setting the zoom level:
let coordinate = CLLocationCoordinate2D(latitude: 55.751244, longitude: 37.618423) // Moscow
let span = MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05) // small zoom
let region = MKCoordinateRegion(center: coordinate, span: span)
mapView.setRegion(region, animated: true)
Here, latitudeDelta and longitudeDelta determine the level of zoom: the smaller the values, the closer the zoom.