[iOS]如何获取左上、右下像素的latitudes/longitudes?

[iOS]How could I get the latitudes/longitudes of top-left、bottom-right pixel?

当我知道了中心的经纬度,如何得到左上、右上、右下、左下像素的经纬度?

狐狸的例子,就像图片一样:

我该怎么办? 非常感谢!

试试下面的方法。基本思想取自

extension MKMapView {

    func topLeftCoordinate() -> CLLocationCoordinate2D {
        return convert(CGPoint(x: 0, y: 0), toCoordinateFrom: self)
    }

    func topRightCoordinate() -> CLLocationCoordinate2D {
        let x = frame.minX + frame.width
        return convert(CGPoint(x: x, y: 0), toCoordinateFrom: self)
    }
    func bottomLeftCoordinate() -> CLLocationCoordinate2D {
        let y = frame.minY + frame.height
        return convert(CGPoint(x: 0, y: y), toCoordinateFrom: self)
    }

    func bottomRightCoordinate() -> CLLocationCoordinate2D {
        let x = frame.minX + frame.width
        let y = frame.minY + frame.height
        return convert(CGPoint(x: x, y: y), toCoordinateFrom: self)
    }
}