Class: AbstractMapWaypointIcon<T>
An abstract implementation of MapWaypointIcon which supports an arbitrary anchor point and offset.
Type parameters
Name | Type |
---|---|
T | extends MapWaypoint |
Hierarchy
AbstractMapWaypointIcon
Implements
Constructors
constructor
• new AbstractMapWaypointIcon<T
>(waypoint
, priority
, size
, options?
): AbstractMapWaypointIcon
<T
>
Constructor.
Type parameters
Name | Type |
---|---|
T | extends MapWaypoint |
Parameters
Name | Type | Description |
---|---|---|
waypoint | T | The waypoint associated with this icon. |
priority | number | 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. |
size | Readonly <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? | AbstractMapWaypointIconOptions | Options with which to initialize this icon. |
Returns
Defined in
src/sdk/components/map/MapWaypointIcon.ts:99
Properties
anchor
• Readonly
anchor: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>>
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.
Defined in
src/sdk/components/map/MapWaypointIcon.ts:86
offset
• Readonly
offset: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>>
The offset of this icon from the projected position of its associated waypoint, as [x, y]
in pixels.
Defined in
src/sdk/components/map/MapWaypointIcon.ts:89
priority
• Readonly
priority: Subscribable
<number
>
The render priority of this icon. Icons with higher priorities will be rendered on top of icons with lower priorities.
Implementation of
Defined in
src/sdk/components/map/MapWaypointIcon.ts:77
size
• Readonly
size: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>>
The size of this icon, as [width, height]
in pixels.
Defined in
src/sdk/components/map/MapWaypointIcon.ts:80
waypoint
• Readonly
waypoint: T
The waypoint associated with this icon.
Implementation of
Defined in
src/sdk/components/map/MapWaypointIcon.ts:100
tempVec2
▪ Static
Protected
Readonly
tempVec2: Float64Array
Defined in
src/sdk/components/map/MapWaypointIcon.ts:74
Methods
draw
▸ draw(context
, mapProjection
): void
Renders this icon to a canvas.
Parameters
Name | Type | Description |
---|---|---|
context | CanvasRenderingContext2D | The canvas 2D rendering context to which to render. |
mapProjection | MapProjection | The projection to use for rendering. |
Returns
void
Implementation of
Defined in
src/sdk/components/map/MapWaypointIcon.ts:113
drawIconAt
▸ drawIconAt(context
, mapProjection
, left
, top
): void
Draws the icon at the specified position.
Parameters
Name | Type | Description |
---|---|---|
context | CanvasRenderingContext2D | The canvas rendering context to use. |
mapProjection | MapProjection | The map projection to use. |
left | number | The x-coordinate of the left edge of the icon. |
top | number | The y-coordinate of the top edge of the icon. |
Returns
void
Defined in
src/sdk/components/map/MapWaypointIcon.ts:131