Class: MapWaypointRendererEntry<W>
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:771
An entry for a waypoint registered with MapWaypointRenderer.
Type Parameters
| Type Parameter |
|---|
W extends MapWaypoint |
Constructors
Constructor
new MapWaypointRendererEntry<
W>(waypoint,textManager,roleDefinitions,selectRoleToRender):MapWaypointRendererEntry<W>
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:802
Constructor.
Parameters
| Parameter | Type | Description |
|---|---|---|
waypoint | W | The waypoint associated with this entry. |
textManager | MapCullableTextLabelManager | The text manager to which to register this entry's labels. |
roleDefinitions | ReadonlyMap<number, Readonly<MapWaypointRenderRoleDef<W>>> | A map of all valid render roles to their definitions. |
selectRoleToRender | MapWaypointRenderRoleSelector<W> | A function to use to select roles under which to render this entry. |
Returns
MapWaypointRendererEntry<W>
Properties
icon
readonlyicon:MapWaypointIcon<W> |null=null
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:790
This entry's waypoint icon.
label
readonlylabel:MapCullableTextLabel|null=null
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:793
This entry's waypoint label.
lastRenderedRole
readonlylastRenderedRole:0=0
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:781
The role under which this entry was last rendered, or 0 if this entry was not rendered in the last render
update.
lastRenderedRoleDefinition
readonlylastRenderedRoleDefinition:Readonly<MapWaypointRenderRoleDef<W>> |null=null
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:787
The definition for the role under which this entry was last rendered, or null if this entry was not rendered
in the last render update.
roles
readonlyroles:0=0
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:775
The render role(s) assigned to this entry.
waypoint
readonlywaypoint:W
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:803
The waypoint associated with this entry.
Methods
addRole()
addRole(
roles,sourceId):void
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:869
Assigns one or more render roles to this entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
roles | number | The render role(s) to assign. |
sourceId | string | The unique string ID of the source of the assignment. |
Returns
void
destroy()
destroy():
void
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:951
Destroys this entry. Any label from this entry currently registered with the text manager will be deregistered.
Returns
void
isAllRoles()
isAllRoles(
roles,useLastRendered):boolean
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:854
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
| Parameter | Type | Default value | Description |
|---|---|---|---|
roles | number | undefined | the render role(s) against which to check. |
useLastRendered | boolean | false | Whether 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.
isAnyRole()
isAnyRole(
roles,useLastRendered):boolean
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:818
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
| Parameter | Type | Default value | Description |
|---|---|---|---|
roles | number | undefined | The render roles against which to check. |
useLastRendered | boolean | false | Whether 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.
isOnlyRole()
isOnlyRole(
roles,useLastRendered):boolean
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:836
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
| Parameter | Type | Default value | Description |
|---|---|---|---|
roles | number | undefined | The render roles against which to check. |
useLastRendered | boolean | false | Whether 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.
removeRole()
removeRole(
roles,sourceId):void
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:882
Removes one or more render roles from this entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
roles | number | The render role(s) to remove. |
sourceId | string | The unique string ID of the soruce of the de-assignment. |
Returns
void
update()
update():
void
Defined in: src/sdk/components/map/MapWaypointRenderer.ts:943
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