SPLocation

public struct SPLocation : Codable

A location object that encapsulates system-provided location and internally calculated values.

While data fetching from the server does not depend much on the location, it is important to have a good location to track turbulence data. Cellular devices have a built-in GPS and can have a stable location without an internet connection, but WiFi-only devices do not and need an internet connection or an external GPS receiver. When a device has poor location data (outdated or invalid) SDK will not track data and show the current position on the map. However, SDK tries to operate with a poor or shaky GPS signal as much as possible. SDK handles all location-related stuff out of the box.

SkyPathDelegate.locationManagerDidFail(withError:) could be called when SDK failed to get a location when, for example, a GPS signal is not available, or location usage permission has not been granted for the app.

Low power mode. SDK tracks the best accuracy location when in flight to correctly track turbulence data. When the location is not needed anymore (when landed) and SDK was not stopped (when the app is left in the background or foreground), SDK can stop location tracking and switch to low power mode to save battery. Location tracking will start for the next flight.

SkyPathDelegate.didUpdateLowPowerMode(_:) notifies that SDK updated the low power mode state. A method is optional. You can use it to notify that location tracking stopped or just do nothing and ignore it.

  • The system provided a location or an external location if available.

    Declaration

    Swift

    public let location: CLLocation?
  • The location state of the currently used location.

    Declaration

    Swift

    public let state: SPLocationState
  • The error from the CLLocationManager if any.

    Declaration

    Swift

    public let error: Error?
  • Rounded calculated pressure altitude. If available. Measured in feet.

    Declaration

    Swift

    public var pressureAlt: Double?
  • Unrounded calculated pressure altitude. If available. Measured in feet.

    Declaration

    Swift

    public var pressureAltRaw: Double?
  • pressureAlt if available otherwise location.altitude. Measured in meters.

    Declaration

    Swift

    public var altitude: CLLocationDistance? { get }
  • Calculated speed based on location coordinates change over time. Measured in meters per second.

    Declaration

    Swift

    public var calculatedSpeed: CLLocationSpeed?
  • Calculated vertical speed based on the altitude change over time. Measured in meters per second.

    Declaration

    Swift

    public var verticalSpeed: CLLocationSpeed?
  • System location instantaneous speed if valid, otherwise calculatedSpeed.

    Declaration

    Swift

    public var speed: CLLocationSpeed? { get }
  • The source of the currently used location. See SPLocationSource for more details.

    Declaration

    Swift

    public var source: SPLocationSource { get }