Skip to main content

Class: AirspaceSearcher

A searcher for airspaces.

Constructors

constructor

new AirspaceSearcher(cacheSize?): AirspaceSearcher

Constructor.

Parameters

NameTypeDefault valueDescription
cacheSizenumberAirspaceSearcher.DEFAULT_CACHE_SIZEThe maximum size of the Airspace cache.

Returns

AirspaceSearcher

Defined in

src/sdk/navigation/AirspaceSearcher.ts:79

Properties

cacheSize

Readonly cacheSize: number = AirspaceSearcher.DEFAULT_CACHE_SIZE

The maximum size of the Airspace cache.

Defined in

src/sdk/navigation/AirspaceSearcher.ts:79


DEFAULT_CACHE_SIZE

Static Readonly DEFAULT_CACHE_SIZE: 1000

Defined in

src/sdk/navigation/AirspaceSearcher.ts:68


SEARCH_TIMEOUT

Static Readonly SEARCH_TIMEOUT: 5000

The amount of time to wait for a search to finish before it times out, in milliseconds.

Defined in

src/sdk/navigation/AirspaceSearcher.ts:67

Methods

isBusy

isBusy(): boolean

Checks whether this searcher is currently busy with a search.

Returns

boolean

whether this searcher is currently busy with a search.

Defined in

src/sdk/navigation/AirspaceSearcher.ts:86


search(center): Promise<Airspace[]>

Searches for airspaces around a geographic point. If the searcher is not busy, the search will execute immediately. If the search is busy, the search will be queued. Queued searches will be executed one at a time in FIFO order as searches are finished.

Parameters

NameTypeDescription
centerGeoPointInterfaceThe center of the search area.

Returns

Promise<Airspace[]>

a Promise which is fulfilled with an array of airspaces when the search finishes.

Defined in

src/sdk/navigation/AirspaceSearcher.ts:97