LiveFlightQuery
public struct LiveFlightQuery
Use LiveFlightQuery
to get filtered data as an array of LiveFlight
objects or a GeoJSON string.
It will query locally cached data received previously.
Used in SkyPath.liveFlights(with:)
.
-
An altitude range to query. Should be round to a thousand feet.
The default is 0…52000. Measured in feet.
Declaration
Swift
public var altRange: ClosedRange<Double>?
-
How to provide queried data. The default is
items
.Declaration
Swift
public var resultOptions: LiveFlightResultOptions
-
Polygon is a geo-fence area to fetch data inside only.
Should be a closed ring. By default, it uses
DataQuery.polygon
. Typically you don’t need to set it. Optional.It is possible to set a custom polygon but the query is made among the locally stored data received by
DataQuery
configuration. So if the polygons are different there could be no data available locally.Declaration
Swift
public var polygon: [CLLocationCoordinate2D]?
-
Live flights are fetched periodically from the server, typically every minute, so the position could be outdated.
Use it to calculate a predicted location based on the last known location, speed, and course.
Declaration
Swift
public var predict: Bool
-
Default initializer.
Declaration
Swift
public init(altRange: ClosedRange<Double>? = nil, resultOptions: LiveFlightResultOptions = .items, polygon: [CLLocationCoordinate2D]? = nil, predict: Bool = false)
Parameters
altRange
When it’s
nil
all altitudes are used. Measured in feet. Optional.resultOptions
See
LiveFlightResultOptions
for available options. The default isitems
.tiles
Array of tile keys generated by
Tile.key
orTile.keyByCoord
. Use it to query items in the specific tiles. Optional.polygon
Geo-fence area to fetch data inside only. Optional.
predict
If calculate predicted current location of the flight based on last received data. Optional.
false
by default.