I'm trying to find out the size of an MKMapRect in points (i.e. 320x568 points for iPhone).
Is there something similar to converting co-ordinates to points? i.e.
[self.mapView convertCoordinate:coordinate1 toPointToView:self.view];
I'm trying to find out the size of an MKMapRect in points (i.e. 320x568 points for iPhone).
Is there something similar to converting co-ordinates to points? i.e.
[self.mapView convertCoordinate:coordinate1 toPointToView:self.view];
Copyright © 2021 Jogjafile Inc.
The map view has the
convertRegion:toRectToView:method which takes anMKCoordinateRegionand converts it to aCGRectrelative to the specified view.If you have an
MKMapRect, first convert it to anMKCoordinateRegionusing theMKCoordinateRegionForMapRectfunction and then callconvertRegion:toRectToView:.Example:
Remember that although the
MKMapRectfor some fixed area will not change as the map is zoomed or panned, the correspondingCGRectwill vary in itsoriginandsize.