Class: FacilityLoader
Defined in: src/sdk/navigation/FacilityLoader.ts:195
A class that handles loading facility data from the simulator.
Implements
Constructors
Constructor
new FacilityLoader(
facilityRepo
,onInitialized
,options?
):FacilityLoader
Defined in: src/sdk/navigation/FacilityLoader.ts:234
Creates an instance of the FacilityLoader.
Parameters
Parameter | Type | Description |
---|---|---|
facilityRepo | FacilityRepository | A local facility repository. |
onInitialized | () => void | A callback to call when the facility loader has completed initialization. |
options? | Readonly <FacilityLoaderOptions > | Options with which to configure the loader. |
Returns
FacilityLoader
Properties
onInitialized()
readonly
onInitialized: () =>void
Defined in: src/sdk/navigation/FacilityLoader.ts:236
A callback to call when the facility loader has completed initialization.
Returns
void
Methods
awaitInitialization()
awaitInitialization():
Promise
<void
>
Defined in: src/sdk/navigation/FacilityLoader.ts:277
Waits until this facility loader is initialized.
Returns
Promise
<void
>
A Promise which is fulfilled when this facility loader is initialized.
Implementation of
FacilityClient
.awaitInitialization
findNearestFacilitiesByIdent()
findNearestFacilitiesByIdent<
T
>(filter
,ident
,lat
,lon
,maxItems
):Promise
<SearchTypeMap
[T
][]>
Defined in: src/sdk/navigation/FacilityLoader.ts:889
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 | Default value | Description |
---|---|---|---|
filter | T | undefined | The type of facility to filter by. Selecting ALL will search all facility type ICAOs, except for boundary facilities. |
ident | string | undefined | The exact ident to search for. (ex: DEN, KDEN, ITADO) |
lat | number | undefined | The latitude to find facilities nearest to. |
lon | number | undefined | The longitude to find facilities nearest to. |
maxItems | number | 40 | 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.
Implementation of
FacilityClient
.findNearestFacilitiesByIdent
getAirway()
Call Signature
getAirway(
airwayName
,airwayType
,icao
):Promise
<AirwayData
>
Defined in: src/sdk/navigation/FacilityLoader.ts:542
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.
Implementation of
Call Signature
getAirway(
airwayName
,airwayType
,icao
):Promise
<AirwayData
>
Defined in: src/sdk/navigation/FacilityLoader.ts:544
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.
Implementation of
getFacilities()
getFacilities(
icaos
,airportDataFlags?
):Promise
<(null
|Facility
)[]>
Defined in: src/sdk/navigation/FacilityLoader.ts:305
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.
Implementation of
getFacilitiesOfType()
Call Signature
getFacilitiesOfType<
T
>(type
,icaos
):Promise
<(null
|FacilityTypeMap
[T
])[]>
Defined in: src/sdk/navigation/FacilityLoader.ts:319
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.
Implementation of
FacilityClient
.getFacilitiesOfType
Call Signature
getFacilitiesOfType(
type
,icaos
,airportDataFlags?
):Promise
<(null
|AirportFacility
)[]>
Defined in: src/sdk/navigation/FacilityLoader.ts:321
Retrieves a batch of airport facilities.
Parameters
Parameter | Type | Description |
---|---|---|
type | Airport | 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.
Implementation of
FacilityClient
.getFacilitiesOfType
getFacility()
Call Signature
getFacility<
T
>(type
,icao
,airportDataFlags?
):Promise
<FacilityTypeMap
[T
]>
Defined in: src/sdk/navigation/FacilityLoader.ts:287
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.
Implementation of
Call Signature
getFacility<
T
>(type
,icao
):Promise
<FacilityTypeMap
[T
]>
Defined in: src/sdk/navigation/FacilityLoader.ts:289
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.
Implementation of
getMetar()
Call Signature
getMetar(
airport
):Promise
<undefined
|Metar
>
Defined in: src/sdk/navigation/FacilityLoader.ts:719
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.
Implementation of
Call Signature
getMetar(
ident
):Promise
<undefined
|Metar
>
Defined in: src/sdk/navigation/FacilityLoader.ts:721
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.
Implementation of
getTaf()
Call Signature
getTaf(
airport
):Promise
<undefined
|Taf
>
Defined in: src/sdk/navigation/FacilityLoader.ts:771
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.
Implementation of
Call Signature
getTaf(
ident
):Promise
<undefined
|Taf
>
Defined in: src/sdk/navigation/FacilityLoader.ts:773
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.
Implementation of
searchByIdent()
searchByIdent(
filter
,ident
,maxItems
):Promise
<string
[]>
Defined in: src/sdk/navigation/FacilityLoader.ts:859
Searches for ICAOs by their ident portion only.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
filter | FacilitySearchType | undefined | The type of facility to filter by. Selecting ALL will search all facility type ICAOs. |
ident | string | undefined | The partial or complete ident to search for. |
maxItems | number | 40 | 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.
Implementation of
searchByIdentWithIcaoStructs()
searchByIdentWithIcaoStructs(
filter
,ident
,maxItems
):Promise
<IcaoValue
[]>
Defined in: src/sdk/navigation/FacilityLoader.ts:829
Searches for ICAOs by their ident portion only.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
filter | FacilitySearchType | undefined | The type of facility to filter by. Selecting ALL will search all facility type ICAOs. |
ident | string | undefined | The partial or complete ident to search for. |
maxItems | number | 40 | 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.
Implementation of
FacilityClient
.searchByIdentWithIcaoStructs
searchMetar()
searchMetar(
lat
,lon
):Promise
<undefined
|Metar
>
Defined in: src/sdk/navigation/FacilityLoader.ts:734
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.
Implementation of
searchTaf()
searchTaf(
lat
,lon
):Promise
<undefined
|Taf
>
Defined in: src/sdk/navigation/FacilityLoader.ts:786
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.
Implementation of
startNearestSearchSession()
startNearestSearchSession<
T
>(type
):Promise
<NearestSessionTypeMap
<StringV1
>[T
]>
Defined in: src/sdk/navigation/FacilityLoader.ts:619
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
<NearestSessionTypeMap
<StringV1
>[T
]>
A Promise which will be fulfilled with the new nearest search session.
Deprecated
Please use startNearestSearchSessionWithIcaoStructs()
instead.
Implementation of
FacilityClient
.startNearestSearchSession
startNearestSearchSessionWithIcaoStructs()
startNearestSearchSessionWithIcaoStructs<
T
>(type
):Promise
<NearestSessionTypeMap
<Struct
>[T
]>
Defined in: src/sdk/navigation/FacilityLoader.ts:597
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
<NearestSessionTypeMap
<Struct
>[T
]>
A Promise which will be fulfilled with the new nearest search session.
Implementation of
FacilityClient
.startNearestSearchSessionWithIcaoStructs
tryGetAirway()
tryGetAirway(
airwayName
,airwayType
,icao
):Promise
<null
|AirwayData
>
Defined in: src/sdk/navigation/FacilityLoader.ts:537
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.
Implementation of
tryGetFacility()
tryGetFacility<
T
>(type
,icao
,airportDataFlags?
):Promise
<null
|FacilityTypeMap
[T
]>
Defined in: src/sdk/navigation/FacilityLoader.ts:282
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.
Implementation of
getDatabaseCycles()
static
getDatabaseCycles():FacilityDatabaseCycles
Defined in: src/sdk/navigation/FacilityLoader.ts:966
Gets the AIRAC cycles associated with the facility database.
Returns
an object containing the previous, current, and next cycles. If an error occurs and the MSFS facility cycle cannot be determined, the effective cycle for the current date is used instead.