Created
November 19, 2013 21:54
Revisions
-
joeldrotleff created this gist
Nov 19, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ // // Created by Joel Drotleff on 11/19/13. // Copyright (c) 2013 Joel Drotleff. All rights reserved. // #import <MapKit/MapKit.h> #import <CoreLocation/CoreLocation.h> #import "MKMapView+Utilities.h" @implementation MKMapView (Utilities) - (CLLocationDistance)getRadius { // init center location from center coordinate CLLocation *centerLocation = [[CLLocation alloc] initWithLatitude:self.centerCoordinate.latitude longitude:self.centerCoordinate.longitude]; double topCenterLat = centerLocation.coordinate.latitude-self.region.span.latitudeDelta/2.; CLLocation *topCenterLocation = [[CLLocation alloc] initWithLatitude:topCenterLat longitude:centerLocation.coordinate.longitude]; CLLocationDistance distance = [centerLocation distanceFromLocation:topCenterLocation]; return distance; } @end