Interface: FacilityClient
Defined in: src/sdk/navigation/FacilityClient.ts:217
An interface for loading or searching through navigation data
Methods
awaitInitialization()
awaitInitialization():
Promise
<void
>
Defined in: src/sdk/navigation/FacilityClient.ts:222
Waits until this facility loader is initialized.
Returns
Promise
<void
>
A Promise which is fulfilled when this facility loader is initialized.
findNearestFacilitiesByIdent()
findNearestFacilitiesByIdent<
T
>(filter
,ident
,lat
,lon
,maxItems
):Promise
<SearchTypeMap
[T
][]>
Defined in: src/sdk/navigation/FacilityClient.ts:407
Searches for facilities matching a given ident, and returns the matching facilities, with nearest at the beginning of the array.
Type Parameters
Type Parameter |
---|
T extends FacilitySearchTypeLatLon |
Parameters
Parameter | Type | Description |
---|---|---|
filter | T | The type of facility to filter by. Selecting ALL will search all facility type ICAOs, except for boundary facilities. |
ident | string | The exact ident to search for. (ex: DEN, KDEN, ITADO) |
lat | number | The latitude to find facilities nearest to. |
lon | number | The longitude to find facilities nearest to. |
maxItems | number | The maximum number of matches to return. Defaults to 40. |
Returns
Promise
<SearchTypeMap
[T
][]>
An array of matching facilities, sorted by distance to the given lat/lon, with nearest at the beginning of the array.
getAirway()
Call Signature
getAirway(
airwayName
,airwayType
,icao
):Promise
<AirwayData
>
Defined in: src/sdk/navigation/FacilityClient.ts:308
Retrieves data for an airway.
Parameters
Parameter | Type | Description |
---|---|---|
airwayName | string | The airway name. |
airwayType | number | The airway type. |
icao | IcaoValue | The ICAO value of one intersection in the airway. |
Returns
Promise
<AirwayData
>
The retrieved airway data.
Throws
Error if the specified airway data could not be retrieved.
Call Signature
getAirway(
airwayName
,airwayType
,icao
):Promise
<AirwayData
>
Defined in: src/sdk/navigation/FacilityClient.ts:318
Retrieves data for an airway.
Parameters
Parameter | Type | Description |
---|---|---|
airwayName | string | The airway name. |
airwayType | number | The airway type. |
icao | string | The ICAO string (V1) of one intersection in the airway. |
Returns
Promise
<AirwayData
>
The retrieved airway data.
Throws
Error if the specified airway data could not be retrieved.
Deprecated
Please use the signature that takes an IcaoValue
instead.
getFacilities()
getFacilities(
icaos
,airportDataFlags?
):Promise
<(null
|Facility
)[]>
Defined in: src/sdk/navigation/FacilityClient.ts:267
Retrieves a batch of facilities. The type of each facility to retrieve is inferred from the requested ICAO.
Parameters
Parameter | Type | Description |
---|---|---|
icaos | readonly IcaoValue [] | The ICAO values of facilities to retrieve. |
airportDataFlags? | number | Bitflags describing the requested data to be loaded in the airport facilities to retrieve. The retrieved airport facilities are guaranteed to have at least as much loaded data as requested. Defaults to AirportFacilityDataFlags.All . |
Returns
Promise
<(null
| Facility
)[]>
A Promise which will be fulfilled with an array of the requested facilities. Each position in the
facilities array will contain either the facility for the ICAO at the corresponding position in the ICAO array, or
null
if a facility for that ICAO could not be retrieved.
getFacilitiesOfType()
Call Signature
getFacilitiesOfType<
T
>(type
,icaos
):Promise
<(null
|FacilityTypeMap
[T
])[]>
Defined in: src/sdk/navigation/FacilityClient.ts:277
Retrieves a batch of facilities of a given type.
Type Parameters
Type Parameter |
---|
T extends FacilityType |
Parameters
Parameter | Type | Description |
---|---|---|
type | T | The type of facilities to retrieve. |
icaos | readonly IcaoValue [] | The ICAO values of facilities to retrieve. |
Returns
Promise
<(null
| FacilityTypeMap
[T
])[]>
A Promise which will be fulfilled with an array of the requested facilities. Each position in the
facilities array will contain either the facility for the ICAO at the corresponding position in the ICAO array, or
null
if a facility for that ICAO could not be retrieved.
Call Signature
getFacilitiesOfType(
type
,icaos
,airportDataFlags?
):Promise
<(null
|AirportFacility
)[]>
Defined in: src/sdk/navigation/FacilityClient.ts:289
Retrieves a batch of airport facilities.
Parameters
Parameter | Type | Description |
---|---|---|
type | AirportFacility | The type of facilities to retrieve. |
icaos | readonly IcaoValue [] | The ICAO values of facilities to retrieve. |
airportDataFlags? | number | Bitflags describing the requested data to be loaded in the airport facilities to retrieve. The retrieved airport facilities are guaranteed to have at least as much loaded data as requested. Defaults to AirportFacilityDataFlags.All . |
Returns
Promise
<(null
| AirportFacility
)[]>
A Promise which will be fulfilled with an array of the requested facilities. Each position in the
facilities array will contain either the facility for the ICAO at the corresponding position in the ICAO array, or
null
if a facility for that ICAO could not be retrieved.
getFacility()
Call Signature
getFacility<
T
>(type
,icao
,airportDataFlags?
):Promise
<FacilityTypeMap
[T
]>
Defined in: src/sdk/navigation/FacilityClient.ts:246
Retrieves a facility.
Type Parameters
Type Parameter |
---|
T extends FacilityType |
Parameters
Parameter | Type | Description |
---|---|---|
type | T | The type of facility to retrieve. |
icao | IcaoValue | The ICAO of the facility to retrieve. |
airportDataFlags? | number | Bitflags describing the requested data to be loaded in the airport facility to retrieve. The retrieved airport facility (if any) is guaranteed to have at least as much loaded data as requested. Ignored if type is not FacilityType.Airport . Defaults to AirportFacilityDataFlags.All . |
Returns
Promise
<FacilityTypeMap
[T
]>
A Promise which will be fulfilled with the requested facility, or rejected if the facility could not be retrieved.
Call Signature
getFacility<
T
>(type
,icao
):Promise
<FacilityTypeMap
[T
]>
Defined in: src/sdk/navigation/FacilityClient.ts:255
Retrieves a facility.
Type Parameters
Type Parameter |
---|
T extends FacilityType |
Parameters
Parameter | Type | Description |
---|---|---|
type | T | The type of facility to retrieve. |
icao | string | The ICAO of the facility to retrieve. |
Returns
Promise
<FacilityTypeMap
[T
]>
A Promise which will be fulfilled with the requested facility, or rejected if the facility could not be retrieved.
Deprecated
Please use the signature that takes an IcaoValue
instead.
getMetar()
Call Signature
getMetar(
airport
):Promise
<undefined
|Metar
>
Defined in: src/sdk/navigation/FacilityClient.ts:342
Gets a METAR for an airport.
Parameters
Parameter | Type | Description |
---|---|---|
airport | AirportFacility | An airport. |
Returns
Promise
<undefined
| Metar
>
The METAR for the airport, or undefined if none could be obtained.
Call Signature
getMetar(
ident
):Promise
<undefined
|Metar
>
Defined in: src/sdk/navigation/FacilityClient.ts:348
Gets a METAR for an airport.
Parameters
Parameter | Type | Description |
---|---|---|
ident | string | An airport ident. |
Returns
Promise
<undefined
| Metar
>
The METAR for the airport, or undefined if none could be obtained.
getTaf()
Call Signature
getTaf(
airport
):Promise
<undefined
|Taf
>
Defined in: src/sdk/navigation/FacilityClient.ts:363
Gets a TAF for an airport.
Parameters
Parameter | Type | Description |
---|---|---|
airport | AirportFacility | An airport. |
Returns
Promise
<undefined
| Taf
>
The TAF for the airport, or undefined if none could be obtained.
Call Signature
getTaf(
ident
):Promise
<undefined
|Taf
>
Defined in: src/sdk/navigation/FacilityClient.ts:369
Gets a TAF for an airport.
Parameters
Parameter | Type | Description |
---|---|---|
ident | string | An airport ident. |
Returns
Promise
<undefined
| Taf
>
The TAF for the airport, or undefined if none could be obtained.
searchByIdent()
searchByIdent(
filter
,ident
,maxItems
):Promise
<string
[]>
Defined in: src/sdk/navigation/FacilityClient.ts:396
Searches for ICAOs by their ident portion only.
Parameters
Parameter | Type | Description |
---|---|---|
filter | FacilitySearchType | The type of facility to filter by. Selecting ALL will search all facility type ICAOs. |
ident | string | The partial or complete ident to search for. |
maxItems | number | The maximum number of matches to return. Defaults to 40. |
Returns
Promise
<string
[]>
An array of matched ICAOs. Exact matches are sorted before partial matches.
Deprecated
Please use searchByIdentWithIcaoStruct()
instead.
searchByIdentWithIcaoStructs()
searchByIdentWithIcaoStructs(
filter
,ident
,maxItems
):Promise
<IcaoValue
[]>
Defined in: src/sdk/navigation/FacilityClient.ts:386
Searches for ICAOs by their ident portion only.
Parameters
Parameter | Type | Description |
---|---|---|
filter | FacilitySearchType | The type of facility to filter by. Selecting ALL will search all facility type ICAOs. |
ident | string | The partial or complete ident to search for. |
maxItems | number | The maximum number of matches to return. Defaults to 40. |
Returns
Promise
<IcaoValue
[]>
An array of matched ICAOs. Exact matches are sorted before partial matches.
searchMetar()
searchMetar(
lat
,lon
):Promise
<undefined
|Metar
>
Defined in: src/sdk/navigation/FacilityClient.ts:356
Searches for the METAR issued for the closest airport to a given location.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the center of the search, in degrees. |
lon | number | The longitude of the center of the search, in degrees. |
Returns
Promise
<undefined
| Metar
>
The METAR issued for the closest airport to the given location, or undefined if none could be found.
searchTaf()
searchTaf(
lat
,lon
):Promise
<undefined
|Taf
>
Defined in: src/sdk/navigation/FacilityClient.ts:377
Searches for the TAF issued for the closest airport to a given location.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the center of the search, in degrees. |
lon | number | The longitude of the center of the search, in degrees. |
Returns
Promise
<undefined
| Taf
>
The TAF issued for the closest airport to the given location, or undefined if none could be found.
startNearestSearchSession()
startNearestSearchSession<
T
>(type
):Promise
<NearestSearchSessionTypeMap
<StringV1
>[T
]>
Defined in: src/sdk/navigation/FacilityClient.ts:335
Starts a nearest facilities search session. If the requested session type provides ICAOs as results, then the ICAOs will be provided as ICAO strings (V1).
Type Parameters
Type Parameter |
---|
T extends FacilitySearchType |
Parameters
Parameter | Type | Description |
---|---|---|
type | T | The type of facilities for which to search. |
Returns
Promise
<NearestSearchSessionTypeMap
<StringV1
>[T
]>
A Promise which will be fulfilled with the new nearest search session.
Deprecated
Please use startNearestSearchSessionWithIcaoStructs()
instead.
startNearestSearchSessionWithIcaoStructs()
startNearestSearchSessionWithIcaoStructs<
T
>(type
):Promise
<NearestSearchSessionTypeMap
<Struct
>[T
]>
Defined in: src/sdk/navigation/FacilityClient.ts:326
Starts a nearest facilities search session. If the requested session type provides ICAOs as results, then the
ICAOs will be provided as IcaoValue
objects.
Type Parameters
Type Parameter |
---|
T extends FacilitySearchType |
Parameters
Parameter | Type | Description |
---|---|---|
type | T | The type of facilities for which to search. |
Returns
Promise
<NearestSearchSessionTypeMap
<Struct
>[T
]>
A Promise which will be fulfilled with the new nearest search session.
tryGetAirway()
tryGetAirway(
airwayName
,airwayType
,icao
):Promise
<null
|AirwayData
>
Defined in: src/sdk/navigation/FacilityClient.ts:298
Attempts to retrieve data for an airway.
Parameters
Parameter | Type | Description |
---|---|---|
airwayName | string | The airway name. |
airwayType | number | The airway type. |
icao | IcaoValue | The ICAO value of one intersection in the airway. |
Returns
Promise
<null
| AirwayData
>
The retrieved airway data, or null
if data could not be retrieved.
tryGetFacility()
tryGetFacility<
T
>(type
,icao
,airportDataFlags?
):Promise
<null
|FacilityTypeMap
[T
]>
Defined in: src/sdk/navigation/FacilityClient.ts:234
Attempts to retrieve a facility.
Type Parameters
Type Parameter |
---|
T extends FacilityType |
Parameters
Parameter | Type | Description |
---|---|---|
type | T | The type of facility to retrieve. |
icao | IcaoValue | The ICAO of the facility to retrieve. |
airportDataFlags? | number | Bitflags describing the requested data to be loaded in the airport facility to retrieve. The retrieved airport facility (if any) is guaranteed to have at least as much loaded data as requested. Ignored if type is not FacilityType.Airport . Defaults to AirportFacilityDataFlags.All . |
Returns
Promise
<null
| FacilityTypeMap
[T
]>
A Promise which will be fulfilled with the requested facility, or null
if the facility could not be
retrieved.