I am able to get visible rectangle of map view and also centre point of map view and span deltas are also get from mkmaap view methods:
To get visible are :mapView.vis
With Swift 3.0 you can use extension to simplify your life:
extension MKMapView {
func topCenterCoordinate() -> CLLocationCoordinate2D {
return self.convert(CGPoint(x: self.frame.size.width / 2.0, y: 0), toCoordinateFrom: self)
}
func currentRadius() -> Double {
let centerLocation = CLLocation(coordinate: self.centerCoordinate)
let topCenterCoordinate = self.topCenterCoordinate()
let topCenterLocation = CLLocation(coordinate: topCenterCoordinate)
return centerLocation.distance(from: topCenterLocation)
}
}
With Swift 4.0 :
extension MKMapView {
func topCenterCoordinate() -> CLLocationCoordinate2D {
return self.convert(CGPoint(x: self.frame.size.width / 2.0, y: 0), toCoordinateFrom: self)
}
func currentRadius() -> Double {
let centerLocation = CLLocation(latitude: self.centerCoordinate.latitude, longitude: self.centerCoordinate.longitude)
let topCenterCoordinate = self.topCenterCoordinate()
let topCenterLocation = CLLocation(latitude: topCenterCoordinate.latitude, longitude: topCenterCoordinate.longitude)
return centerLocation.distance(from: topCenterLocation)
}
}