CLLocation(AerisCore)
@interface CLLocation (AerisCore)
CLLocation (Aeris) extension
Adds capabilities to measure distance and direction from coordinates and other locations, define bounding boxes and more.
-
Returns the great-circle distance between two coordinates.
Declaration
Objective-C
+ (CLLocationDistance) awf_distanceFromCoordinate:(CLLocationCoordinate2D)fromCoord toCoordinate:(CLLocationCoordinate2D)toCoord;Swift
class func awf_distance(from fromCoord: CLLocationCoordinate2D, to toCoord: CLLocationCoordinate2D) -> CLLocationDistanceParameters
fromCoordThe starting coordinate from which to measure the distance
toCoordThe coordinate to which the distance is measured
Return Value
The distance between the two coordiantes as
CLLocationDistance -
Returns the distance between the location and another coordinate.
Declaration
Objective-C
- (CLLocationDirection)awf_distanceFromCoordinate: (CLLocationCoordinate2D)fromCoord;Swift
func awf_distance(from fromCoord: CLLocationCoordinate2D) -> CLLocationDirectionParameters
fromCoordThe coordinate to which the distance is measured.
Return Value
The distance between the location and the coordinate.
-
Returns a direction (in degrees) between an origin coordinate and a destination coordinate.
Declaration
Objective-C
+ (CLLocationDirection) awf_directionFromCoordinate:(CLLocationCoordinate2D)fromCoord toCoordinate:(CLLocationCoordinate2D)toCoord;Swift
class func awf_direction(from fromCoord: CLLocationCoordinate2D, to toCoord: CLLocationCoordinate2D) -> CLLocationDirectionParameters
fromCoordThe origin coordinate
toCoordThe destination coordinate
Return Value
The direction to the destination coordinate in degrees
-
Returns a direction (in degrees) between the receiver and the given location.
Declaration
Objective-C
- (CLLocationDirection)awf_directionToLocation:(CLLocation *)location;Swift
func awf_direction(to location: CLLocation!) -> CLLocationDirectionParameters
locationThe destination location
Return Value
The direction to the destination location in degrees
-
Returns the coordinate bounding box which contains all of the locations.
Declaration
Objective-C
+ (AWFCoordinateRect)awf_boundingBoxContainingLocations:(NSArray *)locations;Swift
class func awf_boundingBoxContainingLocations(_ locations: [Any]!) -> AWFCoordinateRectParameters
locationsThe array of
CLLocationinstances to be included in the bounding boxReturn Value
The bounding box as
AWFCoordinateRect -
Returns the bounding box of a circle defined by a center coordinate and radius in meters.
Declaration
Objective-C
+ (AWFCoordinateRect)awf_boundingBoxWithCenter: (CLLocationCoordinate2D)centerCoord radius:(CLLocationDistance)radius;Swift
class func awf_boundingBox(withCenter centerCoord: CLLocationCoordinate2D, radius: CLLocationDistance) -> AWFCoordinateRectParameters
centerCoordThe center coordinate of the circle
radiusThe radius of the circle in meters
Return Value
The bounding box containing the circle
View on GitHub
CLLocation(AerisCore) Category Reference