Class: AirspaceSearcher
Defined in: src/sdk/navigation/AirspaceSearcher.ts:65
A searcher for airspaces.
Constructors
Constructor
new AirspaceSearcher(
cacheSize
):AirspaceSearcher
Defined in: src/sdk/navigation/AirspaceSearcher.ts:79
Constructor.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
cacheSize | number | AirspaceSearcher.DEFAULT_CACHE_SIZE | The maximum size of the Airspace cache. |
Returns
AirspaceSearcher
Properties
cacheSize
readonly
cacheSize:number
=AirspaceSearcher.DEFAULT_CACHE_SIZE
Defined in: src/sdk/navigation/AirspaceSearcher.ts:79
The maximum size of the Airspace cache.
DEFAULT_CACHE_SIZE
readonly
static
DEFAULT_CACHE_SIZE:1000
=1000
Defined in: src/sdk/navigation/AirspaceSearcher.ts:68
SEARCH_TIMEOUT
readonly
static
SEARCH_TIMEOUT:5000
=5000
Defined in: src/sdk/navigation/AirspaceSearcher.ts:67
The amount of time to wait for a search to finish before it times out, in milliseconds.
Methods
isBusy()
isBusy():
boolean
Defined in: src/sdk/navigation/AirspaceSearcher.ts:86
Checks whether this searcher is currently busy with a search.
Returns
boolean
whether this searcher is currently busy with a search.
search()
search(
center
):Promise
<Airspace
[]>
Defined in: src/sdk/navigation/AirspaceSearcher.ts:97
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
Parameter | Type | Description |
---|---|---|
center | GeoPointInterface | The center of the search area. |
Returns
Promise
<Airspace
[]>
a Promise which is fulfilled with an array of airspaces when the search finishes.