Skip to main content

Abstract Class: AbstractMapWaypointIcon<T>

Defined in: src/sdk/components/map/MapWaypointIcon.ts:73

An abstract implementation of MapWaypointIcon which supports an arbitrary anchor point and offset.

Extended by

Type Parameters

Type Parameter
T extends MapWaypoint

Implements

Constructors

Constructor

new AbstractMapWaypointIcon<T>(waypoint, priority, size, options?): AbstractMapWaypointIcon<T>

Defined in: src/sdk/components/map/MapWaypointIcon.ts:99

Constructor.

Parameters

ParameterTypeDescription
waypointTThe waypoint associated with this icon.
prioritynumber | Subscribable<number>The render priority of this icon, or a subscribable which provides it. Icons with higher priorities should be rendered above those with lower priorities.
sizeReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">> | Subscribable<Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>>The size of this icon, as [width, height] in pixels, or a subscribable which provides it.
options?AbstractMapWaypointIconOptionsOptions with which to initialize this icon.

Returns

AbstractMapWaypointIcon<T>

Properties

anchor

readonly anchor: Subscribable<Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>>

Defined in: src/sdk/components/map/MapWaypointIcon.ts:86

The anchor point of this icon, expressed relative to its width and height. [0, 0] is the top-left corner, and [1, 1] is the bottom-right corner.


offset

readonly offset: Subscribable<Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>>

Defined in: src/sdk/components/map/MapWaypointIcon.ts:89

The offset of this icon from the projected position of its associated waypoint, as [x, y] in pixels.


priority

readonly priority: Subscribable<number>

Defined in: src/sdk/components/map/MapWaypointIcon.ts:77

The render priority of this icon. Icons with higher priorities will be rendered on top of icons with lower priorities.

Implementation of

MapWaypointIcon.priority


size

readonly size: Subscribable<Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>>

Defined in: src/sdk/components/map/MapWaypointIcon.ts:80

The size of this icon, as [width, height] in pixels.


waypoint

readonly waypoint: T

Defined in: src/sdk/components/map/MapWaypointIcon.ts:100

The waypoint associated with this icon.

Implementation of

MapWaypointIcon.waypoint


tempVec2

protected readonly static tempVec2: Float64Array

Defined in: src/sdk/components/map/MapWaypointIcon.ts:74

Methods

draw()

draw(context, mapProjection): void

Defined in: src/sdk/components/map/MapWaypointIcon.ts:113

Renders this icon to a canvas.

Parameters

ParameterTypeDescription
contextCanvasRenderingContext2DThe canvas 2D rendering context to which to render.
mapProjectionMapProjectionThe projection to use for rendering.

Returns

void

Implementation of

MapWaypointIcon.draw


drawIconAt()

abstract protected drawIconAt(context, mapProjection, left, top): void

Defined in: src/sdk/components/map/MapWaypointIcon.ts:131

Draws the icon at the specified position.

Parameters

ParameterTypeDescription
contextCanvasRenderingContext2DThe canvas rendering context to use.
mapProjectionMapProjectionThe map projection to use.
leftnumberThe x-coordinate of the left edge of the icon.
topnumberThe y-coordinate of the top edge of the icon.

Returns

void