Class: NearestAirportSubscription
A nearest search subscription for airport facilites.
Hierarchy
NearestWaypointSubscription
<AirportFacility
>↳
NearestAirportSubscription
Constructors
constructor
• new NearestAirportSubscription(facilityLoader
, filterCb?
): NearestAirportSubscription
Creates a new NearestAirportSubscription.
Parameters
Name | Type | Description |
---|---|---|
facilityLoader | FacilityLoader | The facility loader to use with this instance. |
filterCb? | (facility : AirportFacility ) => boolean | A function which filters results after they have been returned by this subscription's search session. If not defined, no post-search session filtering will be performed. |
Returns
Overrides
NearestWaypointSubscription\<AirportFacility\>.constructor
Defined in
src/sdk/navigation/NearestSubscription.ts:289
Properties
facilities
• Protected
Readonly
facilities: AirportFacility
[] = []
Inherited from
NearestWaypointSubscription.facilities
Defined in
src/sdk/navigation/NearestSubscription.ts:58
facilityCache
• Protected
Readonly
facilityCache: Map
<string
, AirportFacility
>
Inherited from
NearestWaypointSubscription.facilityCache
Defined in
src/sdk/navigation/NearestSubscription.ts:210
facilityIndex
• Protected
Readonly
facilityIndex: Map
<string
, AirportFacility
>
Inherited from
NearestWaypointSubscription.facilityIndex
Defined in
src/sdk/navigation/NearestSubscription.ts:59
facilityLoader
• Protected
Readonly
facilityLoader: FacilityLoader
An instance of the facility loader to search with.
Inherited from
NearestWaypointSubscription.facilityLoader
Defined in
src/sdk/navigation/NearestSubscription.ts:75
filterCb
• Protected
Optional
filterCb: (facility
: AirportFacility
) => boolean
Type declaration
▸ (facility
): boolean
Parameters
Name | Type |
---|---|
facility | AirportFacility |
Returns
boolean
Inherited from
NearestWaypointSubscription.filterCb
Defined in
src/sdk/navigation/NearestSubscription.ts:209
initialNotifyFunc
• Protected
Readonly
initialNotifyFunc: (sub
: HandlerSubscription
<SubscribableArrayHandler
<AirportFacility
>>) => void
A function which sends initial notifications to subscriptions.
Type declaration
▸ (sub
): void
A function which sends initial notifications to subscriptions.
Parameters
Name | Type |
---|---|
sub | HandlerSubscription <SubscribableArrayHandler <AirportFacility >> |
Returns
void
Inherited from
NearestWaypointSubscription.initialNotifyFunc
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:20
notifyDepth
• Protected
notifyDepth: number
= 0
Inherited from
NearestWaypointSubscription.notifyDepth
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:17
onSubDestroyedFunc
• Protected
Readonly
onSubDestroyedFunc: (sub
: HandlerSubscription
<SubscribableArrayHandler
<AirportFacility
>>) => void
A function which responds to when a subscription to this subscribable is destroyed.
Type declaration
▸ (sub
): void
A function which responds to when a subscription to this subscribable is destroyed.
Parameters
Name | Type |
---|---|
sub | HandlerSubscription <SubscribableArrayHandler <AirportFacility >> |
Returns
void
Inherited from
NearestWaypointSubscription.onSubDestroyedFunc
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:23
session
• Protected
session: undefined
| NearestSearchSession
<string
, string
>
Inherited from
NearestWaypointSubscription.session
Defined in
src/sdk/navigation/NearestSubscription.ts:61
singletonSub
• Protected
Optional
singletonSub: HandlerSubscription
<SubscribableArrayHandler
<AirportFacility
>>
Inherited from
NearestWaypointSubscription.singletonSub
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:14
startPromiseResolves
• Protected
Readonly
startPromiseResolves: () => void
[] = []
Inherited from
NearestWaypointSubscription.startPromiseResolves
Defined in
src/sdk/navigation/NearestSubscription.ts:63
subs
• Protected
Optional
subs: HandlerSubscription
<SubscribableArrayHandler
<AirportFacility
>>[]
Inherited from
NearestWaypointSubscription.subs
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:16
type
• Protected
Readonly
type: FacilitySearchType
The type of facility to search for.
Inherited from
NearestWaypointSubscription.type
Defined in
src/sdk/navigation/NearestSubscription.ts:75
updatePromiseResolves
• Protected
Readonly
updatePromiseResolves: () => void
[] = []
Inherited from
NearestWaypointSubscription.updatePromiseResolves
Defined in
src/sdk/navigation/NearestSubscription.ts:64
Accessors
length
• get
length(): number
Returns
number
Inherit Doc
Inherited from
NearestWaypointSubscription.length
Defined in
src/sdk/navigation/NearestSubscription.ts:80
started
• get
started(): boolean
Whether or not this subscription has been started.
Returns
boolean
True if started, false otherwise.
Inherited from
NearestWaypointSubscription.started
Defined in
src/sdk/navigation/NearestSubscription.ts:88
Methods
addFacility
▸ addFacility(facility
, key
): void
Adds a facility to the collection.
Parameters
Name | Type | Description |
---|---|---|
facility | AirportFacility | The facility to add. |
key | string | The key to track this facility by. |
Returns
void
Inherited from
NearestWaypointSubscription.addFacility
Defined in
src/sdk/navigation/NearestSubscription.ts:176
addSubscription
▸ addSubscription(sub
): void
Adds a subscription to this array.
Parameters
Name | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <AirportFacility >> | The subscription to add. |
Returns
void
Inherited from
NearestWaypointSubscription.addSubscription
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:29
awaitStart
▸ awaitStart(): Promise
<void
>
Returns
Promise
<void
>
Inherit Doc
Inherited from
NearestWaypointSubscription.awaitStart
Defined in
src/sdk/navigation/NearestSubscription.ts:98
doUpdate
▸ doUpdate(lat
, lon
, radius
, maxItems
): Promise
<void
>
Executes an update of the nearest search subscription.
Parameters
Name | Type | Description |
---|---|---|
lat | number | The latitude of the current search position. |
lon | number | The longitude of the current search position. |
radius | number | The radius of the search, in meters. |
maxItems | number | The maximum number of items to return in the search. |
Returns
Promise
<void
>
Inherited from
NearestWaypointSubscription.doUpdate
Defined in
src/sdk/navigation/NearestSubscription.ts:149
get
▸ get(index
): AirportFacility
Gets an item from the array.
Parameters
Name | Type | Description |
---|---|---|
index | number | Thex index of the item to get. |
Returns
An item.
Throws
Inherited from
NearestWaypointSubscription.get
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:77
getArray
▸ getArray(): readonly AirportFacility
[]
Returns
readonly AirportFacility
[]
Inherit Doc
Inherited from
NearestWaypointSubscription.getArray
Defined in
src/sdk/navigation/NearestSubscription.ts:93
initialNotify
▸ initialNotify(sub
): void
Notifies a subscription of this array's current state.
Parameters
Name | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <AirportFacility >> | The subscription to notify. |
Returns
void
Inherited from
NearestWaypointSubscription.initialNotify
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:176
notify
▸ notify(index
, type
, modifiedItem?
): void
Notifies subscriptions of a change in the array.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index that was changed. |
type | SubscribableArrayEventType | The type of subject event. |
modifiedItem? | AirportFacility | readonly AirportFacility [] | The item modified by the operation. |
Returns
void
Inherited from
NearestWaypointSubscription.notify
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:100
onResults
▸ onResults(results
): Promise
<void
>
Parameters
Name | Type |
---|---|
results | NearestSearchResults <string , string > |
Returns
Promise
<void
>
Inherit Doc
Inherited from
NearestWaypointSubscription.onResults
Defined in
src/sdk/navigation/NearestSubscription.ts:259
onSubDestroyed
▸ onSubDestroyed(sub
): void
Responds to when a subscription to this array is destroyed.
Parameters
Name | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <AirportFacility >> | The destroyed subscription. |
Returns
void
Inherited from
NearestWaypointSubscription.onSubDestroyed
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:185
refilter
▸ refilter(): void
Refilters the latest search results returned from this subscription's nearest search session.
Returns
void
Inherited from
NearestWaypointSubscription.refilter
Defined in
src/sdk/navigation/NearestSubscription.ts:238
removeFacility
▸ removeFacility(key
): void
Removes a facility from the collection.
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the facility to remove. |
Returns
void
Inherited from
NearestWaypointSubscription.removeFacility
Defined in
src/sdk/navigation/NearestSubscription.ts:191
setExtendedFilters
▸ setExtendedFilters(surfaceTypeMask
, approachTypeMask
, toweredMask
, minRunwayLength
): void
Sets the extended airport filters for the airport nearest search.
Parameters
Name | Type | Description |
---|---|---|
surfaceTypeMask | number | A bitmask of allowable runway surface types. |
approachTypeMask | number | A bitmask of allowable approach types. |
toweredMask | number | A bitmask of untowered (1) or towered (2) bits. |
minRunwayLength | number | The minimum allowable runway length, in meters. |
Returns
void
Defined in
src/sdk/navigation/NearestSubscription.ts:311
setFilter
▸ setFilter(showClosed
, classMask
): void
Sets the airport search filter.
Parameters
Name | Type | Description |
---|---|---|
showClosed | boolean | Whether or not to return closed airports in the search. |
classMask | number | A bitmask representing the classes of airports to show. |
Returns
void
Defined in
src/sdk/navigation/NearestSubscription.ts:298
setFilterCb
▸ setFilterCb(filter
): void
Sets this subscription's post-search session filter and refilters this subscription's latest results using the new filter.
Parameters
Name | Type | Description |
---|---|---|
filter | undefined | (facility : AirportFacility ) => boolean | A function which filters results after they have been returned by this subscription's search session, or undefined if no post-search session filtering is to be performed. |
Returns
void
Inherited from
NearestWaypointSubscription.setFilterCb
Defined in
src/sdk/navigation/NearestSubscription.ts:230
start
▸ start(): Promise
<void
>
Returns
Promise
<void
>
Inherit Doc
Inherited from
NearestWaypointSubscription.start
Defined in
src/sdk/navigation/NearestSubscription.ts:107
sub
▸ sub(handler
, initialNotify?
, paused?
): Subscription
Parameters
Name | Type | Default value |
---|---|---|
handler | SubscribableArrayHandler <AirportFacility > | undefined |
initialNotify | boolean | false |
paused | boolean | false |
Returns
Inherit Doc
Inherited from
NearestWaypointSubscription.sub
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:41
tryGet
▸ tryGet(index
): undefined
| AirportFacility
Tries to get the value from the array.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the item to get. |
Returns
undefined
| AirportFacility
The value or undefined if not found.
Inherited from
NearestWaypointSubscription.tryGet
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:90
unsub
▸ unsub(handler
): void
Parameters
Name | Type |
---|---|
handler | SubscribableArrayHandler <AirportFacility > |
Returns
void
Inherit Doc
Inherited from
NearestWaypointSubscription.unsub
Defined in
src/sdk/sub/AbstractSubscribableArray.ts:56
update
▸ update(lat
, lon
, radius
, maxItems
): Promise
<void
>
Parameters
Name | Type |
---|---|
lat | number |
lon | number |
radius | number |
maxItems | number |
Returns
Promise
<void
>
Inherit Doc
Inherited from
NearestWaypointSubscription.update
Defined in
src/sdk/navigation/NearestSubscription.ts:130