Skip to main content

Class: NearestIntersectionSubscription

Defined in: src/sdk/navigation/NearestSubscription.ts:321

A nearest search subscription for intersection facilites.

Extends

Constructors

Constructor

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

Defined in: src/sdk/navigation/NearestSubscription.ts:334

Creates a new NearestIntersectionSubscription.

Parameters

ParameterTypeDefault valueDescription
facilityLoaderFacilityLoaderundefinedThe facility loader to use with this instance.
filterCb?(facility) => 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.
filterDupTerminal?booleanfalseWhether 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

Properties

facilities

protected readonly facilities: IntersectionFacility[] = []

Defined in: src/sdk/navigation/NearestSubscription.ts:58

Inherited from

NearestWaypointSubscription.facilities


facilityCache

protected readonly facilityCache: Map<string, IntersectionFacility>

Defined in: src/sdk/navigation/NearestSubscription.ts:210

Inherited from

NearestWaypointSubscription.facilityCache


facilityIndex

protected readonly facilityIndex: Map<string, IntersectionFacility>

Defined in: src/sdk/navigation/NearestSubscription.ts:59

Inherited from

NearestWaypointSubscription.facilityIndex


facilityLoader

protected readonly facilityLoader: FacilityLoader

Defined in: src/sdk/navigation/NearestSubscription.ts:75

An instance of the facility loader to search with.

Inherited from

NearestWaypointSubscription.facilityLoader


filterCb()?

protected optional filterCb: (facility) => boolean

Defined in: src/sdk/navigation/NearestSubscription.ts:209

Parameters

ParameterType
facilityIntersectionFacility

Returns

boolean

Inherited from

NearestWaypointSubscription.filterCb


filterDupTerminal

protected filterDupTerminal: boolean

Defined in: src/sdk/navigation/NearestSubscription.ts:324


initialNotifyFunc()

protected readonly initialNotifyFunc: (sub) => void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:20

A function which sends initial notifications to subscriptions.

Notifies a subscription of this array's current state.

Parameters

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>The subscription to notify.

Returns

void

Inherited from

NearestWaypointSubscription.initialNotifyFunc


nonTerminalIcaosToFilter

protected readonly nonTerminalIcaosToFilter: Set<string>

Defined in: src/sdk/navigation/NearestSubscription.ts:322


notifyDepth

protected notifyDepth: number = 0

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:17

Inherited from

NearestWaypointSubscription.notifyDepth


onSubDestroyedFunc()

protected readonly onSubDestroyedFunc: (sub) => void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:23

A function which responds to when a subscription to this subscribable is destroyed.

Responds to when a subscription to this array is destroyed.

Parameters

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

Returns

void

Inherited from

NearestWaypointSubscription.onSubDestroyedFunc


session

protected session: undefined | NearestSearchSession<string, string>

Defined in: src/sdk/navigation/NearestSubscription.ts:61

Inherited from

NearestWaypointSubscription.session


singletonSub?

protected optional singletonSub: HandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:14

Inherited from

NearestWaypointSubscription.singletonSub


startPromiseResolves

protected readonly startPromiseResolves: () => void[] = []

Defined in: src/sdk/navigation/NearestSubscription.ts:63

Returns

void

Inherited from

NearestWaypointSubscription.startPromiseResolves


subs?

protected optional subs: HandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>[]

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:16

Inherited from

NearestWaypointSubscription.subs


type

protected readonly type: FacilitySearchType

Defined in: src/sdk/navigation/NearestSubscription.ts:75

The type of facility to search for.

Inherited from

NearestWaypointSubscription.type


updatePromiseResolves

protected readonly updatePromiseResolves: () => void[] = []

Defined in: src/sdk/navigation/NearestSubscription.ts:64

Returns

void

Inherited from

NearestWaypointSubscription.updatePromiseResolves

Accessors

length

Get Signature

get length(): number

Defined in: src/sdk/navigation/NearestSubscription.ts:80

Inherit Doc
Returns

number

Inherited from

NearestWaypointSubscription.length


started

Get Signature

get started(): boolean

Defined in: src/sdk/navigation/NearestSubscription.ts:88

Whether or not this subscription has been started.

Returns

boolean

True if started, false otherwise.

Inherited from

NearestWaypointSubscription.started

Methods

addFacility()

protected addFacility(facility, key): void

Defined in: src/sdk/navigation/NearestSubscription.ts:176

Adds a facility to the collection.

Parameters

ParameterTypeDescription
facilityIntersectionFacilityThe facility to add.
keystringThe key to track this facility by.

Returns

void

Inherited from

NearestWaypointSubscription.addFacility


addSubscription()

protected addSubscription(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:29

Adds a subscription to this array.

Parameters

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>The subscription to add.

Returns

void

Inherited from

NearestWaypointSubscription.addSubscription


awaitStart()

awaitStart(): Promise<void>

Defined in: src/sdk/navigation/NearestSubscription.ts:98

Returns

Promise<void>

Inherit Doc

Inherited from

NearestWaypointSubscription.awaitStart


doUpdate()

protected doUpdate(lat, lon, radius, maxItems): Promise<void>

Defined in: src/sdk/navigation/NearestSubscription.ts:149

Executes an update of the nearest search subscription.

Parameters

ParameterTypeDescription
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


get()

get(index): IntersectionFacility

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:77

Gets an item from the array.

Parameters

ParameterTypeDescription
indexnumberThex index of the item to get.

Returns

IntersectionFacility

An item.

Throws

Inherited from

NearestWaypointSubscription.get


getArray()

getArray(): readonly IntersectionFacility[]

Defined in: src/sdk/navigation/NearestSubscription.ts:93

Returns

readonly IntersectionFacility[]

Inherit Doc

Inherited from

NearestWaypointSubscription.getArray


initialNotify()

protected initialNotify(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:176

Notifies a subscription of this array's current state.

Parameters

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<IntersectionFacility>>The subscription to notify.

Returns

void

Inherited from

NearestWaypointSubscription.initialNotify


notify()

protected notify(index, type, modifiedItem?): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:100

Notifies subscriptions of a change in the array.

Parameters

ParameterTypeDescription
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


onResults()

protected onResults(results): Promise<void>

Defined in: src/sdk/navigation/NearestSubscription.ts:420

Parameters

ParameterType
resultsNearestSearchResults<string, string>

Returns

Promise<void>

Inherit Doc

Overrides

NearestWaypointSubscription.onResults


onSubDestroyed()

protected onSubDestroyed(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:185

Responds to when a subscription to this array is destroyed.

Parameters

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

Returns

void

Inherited from

NearestWaypointSubscription.onSubDestroyed


refilter()

protected refilter(): void

Defined in: src/sdk/navigation/NearestSubscription.ts:367

Returns

void

Inherit Doc

Overrides

NearestWaypointSubscription.refilter


removeFacility()

protected removeFacility(key): void

Defined in: src/sdk/navigation/NearestSubscription.ts:191

Removes a facility from the collection.

Parameters

ParameterTypeDescription
keystringThe key of the facility to remove.

Returns

void

Inherited from

NearestWaypointSubscription.removeFacility


setFilter()

setFilter(typeMask, showTerminalWaypoints): void

Defined in: src/sdk/navigation/NearestSubscription.ts:345

Sets the intersection search filter.

Parameters

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

Returns

void


setFilterCb()

setFilterCb(filter): void

Defined in: src/sdk/navigation/NearestSubscription.ts:230

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

Parameters

ParameterTypeDescription
filterundefined | (facility) => 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


setFilterDupTerminal()

setFilterDupTerminal(filter): void

Defined in: src/sdk/navigation/NearestSubscription.ts:357

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

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

Returns

void


start()

start(): Promise<void>

Defined in: src/sdk/navigation/NearestSubscription.ts:107

Returns

Promise<void>

Inherit Doc

Inherited from

NearestWaypointSubscription.start


sub()

sub(handler, initialNotify, paused): Subscription

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:41

Parameters

ParameterTypeDefault value
handlerSubscribableArrayHandler<IntersectionFacility>undefined
initialNotifybooleanfalse
pausedbooleanfalse

Returns

Subscription

Inherit Doc

Inherited from

NearestWaypointSubscription.sub


tryGet()

tryGet(index): undefined | IntersectionFacility

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:90

Tries to get the value from the array.

Parameters

ParameterTypeDescription
indexnumberThe index of the item to get.

Returns

undefined | IntersectionFacility

The value or undefined if not found.

Inherited from

NearestWaypointSubscription.tryGet


unsub()

unsub(handler): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:56

Parameters

ParameterType
handlerSubscribableArrayHandler<IntersectionFacility>

Returns

void

Inherit Doc

Inherited from

NearestWaypointSubscription.unsub


update()

update(lat, lon, radius, maxItems): Promise<void>

Defined in: src/sdk/navigation/NearestSubscription.ts:130

Parameters

ParameterType
latnumber
lonnumber
radiusnumber
maxItemsnumber

Returns

Promise<void>

Inherit Doc

Inherited from

NearestWaypointSubscription.update