Convert MKCoordinateRegion to MKMapRect

前端 未结 10 663
南笙
南笙 2020-12-02 10:52

I have a square MKMapView in my app, and I wish to set a center point and the exact height/width of the view in meters.

Creating an MKCoordinateRegion and setting th

10条回答
  •  眼角桃花
    2020-12-02 11:16

    Use the built in function MKCoordinateRegionForMapRect

    MKCoordinateRegion region = MKCoordinateRegionForMapRect(rect);
    

提交回复
热议问题