init(minCenterCoordinateDistance:)
Create a camera zoom range by specifying the minimum distance from your map view’s center coordinate, measured in meters.
Declaration
convenience init?(minCenterCoordinateDistance minDistance: CLLocationDistance)Parameters
- minDistance:
The minimum distance the user can zoom in on a map based on its center point, measured in meters.
To increase how far in the user can zoom, use a shorter distance value. To decrease how far in the user can zoom, use a larger distance value.
Discussion
To specify MapKit’s default minimum distance from the center coordinate, use the MKMapCameraZoomDefault constant, that allows the user to zoom to any level that MapKit supports.
The following example prevents the user from zooming closer than 1000 meters from the map’s center coordinate:
MKMapView.CameraZoomRange(
minCenterCoordinateDistance: 1000
)