Skip to main content

Class: NearestIntersectionSubscription

A nearest search subscription for intersection facilites.

Hierarchy

Constructors

constructor

new NearestIntersectionSubscription(facilityLoader, filterCb?, filterDupTerminal?): NearestIntersectionSubscription

Creates a new NearestIntersectionSubscription.

Parameters

NameTypeDefault valueDescription
facilityLoaderFacilityLoaderundefinedThe facility loader to use with this instance.
filterCb?(facility: IntersectionFacility) => booleanundefinedA 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.
filterDupTerminalbooleanfalseWhether to filter out terminal intersections if their non-terminal counterparts are also present in the subscription's results. Defaults to false.

Returns

NearestIntersectionSubscription

Overrides

NearestWaypointSubscription\<IntersectionFacility\>.constructor

Defined in

src/sdk/navigation/NearestSubscription.ts:334

Properties

facilities

Protected Readonly facilities: IntersectionFacility[] = []

Inherited from

NearestWaypointSubscription.facilities

Defined in

src/sdk/navigation/NearestSubscription.ts:58


facilityCache

Protected Readonly facilityCache: Map<string, IntersectionFacility>

Inherited from

NearestWaypointSubscription.facilityCache

Defined in

src/sdk/navigation/NearestSubscription.ts:210


facilityIndex

Protected Readonly facilityIndex: Map<string, IntersectionFacility>

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: IntersectionFacility) => boolean

Type declaration

▸ (facility): boolean

Parameters
NameType
facilityIntersectionFacility
Returns

boolean

Inherited from

NearestWaypointSubscription.filterCb

Defined in

src/sdk/navigation/NearestSubscription.ts:209


filterDupTerminal

Protected filterDupTerminal: boolean

Defined in

src/sdk/navigation/NearestSubscription.ts:324


initialNotifyFunc

Protected Readonly initialNotifyFunc: (sub: HandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>) => void

A function which sends initial notifications to subscriptions.

Type declaration

▸ (sub): void

A function which sends initial notifications to subscriptions.

Parameters
NameType
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>
Returns

void

Inherited from

NearestWaypointSubscription.initialNotifyFunc

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:20


nonTerminalIcaosToFilter

Protected Readonly nonTerminalIcaosToFilter: Set<string>

Defined in

src/sdk/navigation/NearestSubscription.ts:322


notifyDepth

Protected notifyDepth: number = 0

Inherited from

NearestWaypointSubscription.notifyDepth

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:17


onSubDestroyedFunc

Protected Readonly onSubDestroyedFunc: (sub: HandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>) => 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
NameType
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>
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<IntersectionFacility>>

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<IntersectionFacility>>[]

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

NameTypeDescription
facilityIntersectionFacilityThe facility to add.
keystringThe 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

NameTypeDescription
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>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

NameTypeDescription
latnumberThe latitude of the current search position.
lonnumberThe longitude of the current search position.
radiusnumberThe radius of the search, in meters.
maxItemsnumberThe 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): IntersectionFacility

Gets an item from the array.

Parameters

NameTypeDescription
indexnumberThex index of the item to get.

Returns

IntersectionFacility

An item.

Throws

Inherited from

NearestWaypointSubscription.get

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:77


getArray

getArray(): readonly IntersectionFacility[]

Returns

readonly IntersectionFacility[]

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

NameTypeDescription
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>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

NameTypeDescription
indexnumberThe index that was changed.
typeSubscribableArrayEventTypeThe type of subject event.
modifiedItem?IntersectionFacility | readonly IntersectionFacility[]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

NameType
resultsNearestSearchResults<string, string>

Returns

Promise<void>

Inherit Doc

Overrides

NearestWaypointSubscription.onResults

Defined in

src/sdk/navigation/NearestSubscription.ts:420


onSubDestroyed

onSubDestroyed(sub): void

Responds to when a subscription to this array is destroyed.

Parameters

NameTypeDescription
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>The destroyed subscription.

Returns

void

Inherited from

NearestWaypointSubscription.onSubDestroyed

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:185


refilter

refilter(): void

Returns

void

Inherit Doc

Overrides

NearestWaypointSubscription.refilter

Defined in

src/sdk/navigation/NearestSubscription.ts:367


removeFacility

removeFacility(key): void

Removes a facility from the collection.

Parameters

NameTypeDescription
keystringThe key of the facility to remove.

Returns

void

Inherited from

NearestWaypointSubscription.removeFacility

Defined in

src/sdk/navigation/NearestSubscription.ts:191


setFilter

setFilter(typeMask, showTerminalWaypoints?): void

Sets the intersection search filter.

Parameters

NameTypeDefault valueDescription
typeMasknumberundefinedA bitmask representing the types of intersections to include in the search.
showTerminalWaypointsbooleantrueWhether to include terminal intersections in the search.

Returns

void

Defined in

src/sdk/navigation/NearestSubscription.ts:345


setFilterCb

setFilterCb(filter): void

Sets this subscription's post-search session filter and refilters this subscription's latest results using the new filter.

Parameters

NameTypeDescription
filterundefined | (facility: IntersectionFacility) => booleanA 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


setFilterDupTerminal

setFilterDupTerminal(filter): void

Sets whether to filter out terminal intersections if their non-terminal counterparts are also present in this subscription's results and refilters this subscription's latest results accordingly.

Parameters

NameTypeDescription
filterbooleanWhether to filter out terminal intersections if their non-terminal counterparts are also present in this subscription's results.

Returns

void

Defined in

src/sdk/navigation/NearestSubscription.ts:357


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

NameTypeDefault value
handlerSubscribableArrayHandler<IntersectionFacility>undefined
initialNotifybooleanfalse
pausedbooleanfalse

Returns

Subscription

Inherit Doc

Inherited from

NearestWaypointSubscription.sub

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:41


tryGet

tryGet(index): undefined | IntersectionFacility

Tries to get the value from the array.

Parameters

NameTypeDescription
indexnumberThe index of the item to get.

Returns

undefined | IntersectionFacility

The value or undefined if not found.

Inherited from

NearestWaypointSubscription.tryGet

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:90


unsub

unsub(handler): void

Parameters

NameType
handlerSubscribableArrayHandler<IntersectionFacility>

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

NameType
latnumber
lonnumber
radiusnumber
maxItemsnumber

Returns

Promise<void>

Inherit Doc

Inherited from

NearestWaypointSubscription.update

Defined in

src/sdk/navigation/NearestSubscription.ts:130