Location

public struct Location : Hashable

Describes a location in the world at a given time.

  • The geographic coordinates of the location.

    Declaration

    Swift

    public var coordinates: GeoCoordinates
  • Bearing (also known as course) is the device’s horizontal direction of travel. Starts at 0 in the geographical north and rotates around the compass in a clockwise direction. This means for going north it is equal to 0, for northeast it is 45, for east it is 90 and so on. Note that this may be different from the orientation of the device. If it cannot be determined, the value is nil. Otherwise, it is guaranteed to be in the range [0, 360).

    Declaration

    Swift

    public var bearingInDegrees: Double?
  • Current speed of the device. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var speedInMetersPerSecond: Double?
  • The time at which the location was determined.

    Declaration

    Swift

    public var time: Date?
  • The estimated horizontal accuracy. The actual location will lie within this radius of uncertainty.

    Declaration

    Swift

    public var horizontalAccuracyInMeters: Double?
  • Estimated vertical accuracy. Given that the received Location contains the altitude, the real value of the altitude is estimated to lie within the following range: [altitude - vertical accuracy, altitude + vertical accuracy]. For example, when the altitude is equal to 50 and the vertical accuracy is 8, then the actual value is most likely in the range [42, 58].

    Declaration

    Swift

    public var verticalAccuracyInMeters: Double?
  • Estimated bearing accuracy for this location, in degrees. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var bearingAccuracyInDegrees: Double?
  • Estimated speed accuracy of this location, in meters per second. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var speedAccuracyInMetersPerSecond: Double?
  • The time at which the location was determined, relative to device boot time. This time is monotonic and not affected by leap time or other system time adjustments, so this is the recommended basis for general purpose interval timing between location updates. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var timestampSinceBoot: TimeInterval?
  • Optional technology or provider of this location. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var locationTechnology: LocationTechnology?
  • Optional source of this location. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var source: LocationSource?
  • Optional gnss time at which the location was determined. It is a time interval from the Unix time epoch in milliseconds. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var gnssTime: TimeInterval?
  • Pitch of this location, in degrees. If it cannot be determined, the value is nil.

    Declaration

    Swift

    public var pitchInDegrees: Double?
  • Creates an instance of the class with specified parameters.

    Declaration

    Swift

    public init(coordinates: GeoCoordinates, bearingInDegrees: Double? = nil, speedInMetersPerSecond: Double? = nil, time: Date? = nil, horizontalAccuracyInMeters: Double? = nil, verticalAccuracyInMeters: Double? = nil, bearingAccuracyInDegrees: Double? = nil, speedAccuracyInMetersPerSecond: Double? = nil, timestampSinceBoot: TimeInterval? = nil, locationTechnology: LocationTechnology? = nil, source: LocationSource? = nil, gnssTime: TimeInterval? = nil, pitchInDegrees: Double? = nil)