CLLocation
extension CLLocation
-
Calculates the location coordinate for a given bearing and distance from this location as origin. https://www.movable-type.co.uk/scripts/latlong.html
Declaration
Swift
public func locationCoordinate(withBearing bearingDegrees: Double, distanceMeters: Double) -> CLLocationCoordinate2DParameters
bearingDegreesBearing in degrees
distanceMetersDistance in meters
originCoordinate from which the result is calculated
Return Value
Location coordinate at the bearing and distance from origin coordinate.
-
Calculate the bearing from this location object to another
Declaration
Swift
public func bearing(toLocation: CLLocation) -> CLLocationDirectionParameters
toLocationtarget location
Return Value
Bearing in degrees.
-
Calcualtes the bearing angle from this location object to another with device heading
Declaration
Swift
public func bearingAngleInRadians(toLocation: CLLocation, with heading: CLHeading) -> Double?Parameters
toLocationto location point
headingheading in degrees of device
Return Value
Bearing angle in radians.
-
Undocumented
Declaration
Swift
public func translation(fromLocation location: CLLocation) -> simd_double3
-
Creates a Virtual Contact File (VCF) or vCard for the location.
Declaration
Swift
public func vCard(name: String = "Location") -> URL?Return Value
Local file path URL.
-
Pretty description of a distance from the location to another.
Declaration
Swift
public func prettyDistanceDescription(fromLocation location: CLLocation, locale: Locale = Locale.current) -> StringParameters
locationLocation from which to display distance.
localeLocale to display the units of measurement.
Return Value
A pretty description string of a distance in the specified locale.
View on GitHub
CLLocation Extension Reference