Skip to main content

Class: MapWaypointRendererEntry<W>

An entry for a waypoint registered with MapWaypointRenderer.

Type parameters

NameType
Wextends MapWaypoint

Constructors

constructor

new MapWaypointRendererEntry<W>(waypoint, textManager, roleDefinitions, selectRoleToRender): MapWaypointRendererEntry<W>

Constructor.

Type parameters

NameType
Wextends MapWaypoint

Parameters

NameTypeDescription
waypointWThe waypoint associated with this entry.
textManagerMapCullableTextLabelManagerThe text manager to which to register this entry's labels.
roleDefinitionsReadonlyMap<number, Readonly<MapWaypointRenderRoleDef<W>>>A map of all valid render roles to their definitions.
selectRoleToRenderMapWaypointRenderRoleSelector<W>A function to use to select roles under which to render this entry.

Returns

MapWaypointRendererEntry<W>

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:456

Properties

waypoint

Readonly waypoint: W

The waypoint associated with this entry.

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:457

Accessors

icon

get icon(): null | MapWaypointIcon<W>

This entry's waypoint icon.

Returns

null | MapWaypointIcon<W>

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:478


label

get label(): null | MapCullableTextLabel

This entry's waypoint label.

Returns

null | MapCullableTextLabel

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:484


lastRenderedRole

get lastRenderedRole(): number

The role under which this entry was last rendered, or 0 if this entry has not yet been rendered.

Returns

number

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:472


roles

get roles(): number

The render role(s) assigned to this entry.

Returns

number

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:466

Methods

addRole

addRole(roles, sourceId): void

Assigns one or more render roles to this entry.

Parameters

NameTypeDescription
rolesnumberThe render role(s) to assign.
sourceIdstringThe unique string ID of the source of the assignment.

Returns

void

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:547


destroy

destroy(): void

Destroys this entry. Any label from this entry currently registered with the text manager will be deregistered.

Returns

void

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:619


isAllRoles

isAllRoles(roles, useLastRendered?): boolean

Checks whether this entry is assigned all the specified render role(s). Optionally, this method can also check if this entry was last rendered in all the specified role(s) instead.

Parameters

NameTypeDefault valueDescription
rolesnumberundefinedthe render role(s) against which to check.
useLastRenderedbooleanfalseWhether to check the role(s) in which this entry was last rendered instead of the current roles assigned to this entry. False by default.

Returns

boolean

whether the check passed.

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:532


isAnyRole

isAnyRole(roles, useLastRendered?): boolean

Checks whether this entry is assigned any of the specified render roles. Optionally, this method can also check if this entry was last rendered in any of the specified roles instead.

Parameters

NameTypeDefault valueDescription
rolesnumberundefinedThe render roles against which to check.
useLastRenderedbooleanfalseWhether to check the role(s) in which this entry was last rendered instead of the current roles assigned to this entry. False by default.

Returns

boolean

whether the check passed.

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:496


isOnlyRole

isOnlyRole(roles, useLastRendered?): boolean

Checks whether this entry is assigned only the specified render role(s). Optionally, this method can also check if this entry was last rendered in only the specified role(s) instead.

Parameters

NameTypeDefault valueDescription
rolesnumberundefinedThe render roles against which to check.
useLastRenderedbooleanfalseWhether to check the role(s) in which this entry was last rendered instead of the current roles assigned to this entry. False by default.

Returns

boolean

whether the check passed.

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:514


removeRole

removeRole(roles, sourceId): void

Removes one or more render roles from this entry.

Parameters

NameTypeDescription
rolesnumberThe render role(s) to remove.
sourceIdstringThe unique string ID of the soruce of the de-assignment.

Returns

void

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:560


update

update(): void

Updates this entry. An appropriate render role is selected, then the icon and label are updated as appropriate for the chosen role. If the waypoint's label should be visible, it is added to the appropriate text manager. Of note, this method will not draw the waypoint icon to a canvas element; it will simply ensure the .showIcon property contains the correct value depending on whether the icon should be visible.

Returns

void

Defined in

src/sdk/components/map/MapWaypointRenderer.ts:608