Skip to main content
Version: 2.2.0

Location

Overview

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.

Error

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

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.

Pressure Altitude

Enables calculated pressure altitude for self.

SkyPath.shared.useCalculatedPressureAltitudeForSelf = true

When false (default), the iPad's GPS will be used for self-altitude. When true, barometric pressure data will be used to calculate self-altitude. Can be enabled and disabled at any time.

Self-altitude is used for example in Turbulence Notifications to search within the vertical corridor.

Note: when true, baro forecast data will be periodically fetched from the server, and increase network traffic.

Location Injection

When the app has a location from an external source like AID it can inject it into SDK to use in case the device's location is not available.

Inject external location whenever the update is received.

let externalLocation = InjectedLocation(
location: newLocation,
altitude: .gps(altitude: newLocation.altitude))
SkyPath.shared.inject(location: externalLocation)

Note: pass only a real location received from an external source.