Class: MapCullableLocationTextLabel
Defined in: src/sdk/components/map/MapCullableTextLabel.ts:32
A cullable (hides labels that collide with other labels) text label associated with a specific geographic location.
Extends
Extended by
Implements
Constructors
Constructor
new MapCullableLocationTextLabel(
text,priority,location,alwaysShow,options?):MapCullableLocationTextLabel
Defined in: src/sdk/components/map/MapCullableTextLabel.ts:52
Constructor.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Subscribable<string> | The text of this label, or a subscribable which provides it. |
priority | number | Subscribable<number> | The priority of this label, or a subscribable which provides it. |
location | GeoPointInterface | Subscribable<GeoPointInterface> | The geographic location of this label, or a subscribable which provides it. |
alwaysShow | boolean | Subscribable<boolean> | Whether this label is immune to culling, or a subscribable which provides it. |
options? | MapLocationTextLabelOptions | Options with which to initialize this label. |
Returns
MapCullableLocationTextLabel
Overrides
MapLocationTextLabel.constructor
Properties
alwaysShow
readonlyalwaysShow:Subscribable<boolean>
Defined in: src/sdk/components/map/MapCullableTextLabel.ts:34
Whether this label is immune to culling.
Implementation of
MapCullableTextLabel.alwaysShow
anchor
readonlyanchor:Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>,"set"|"sort"|"copyWithin">>>
Defined in: src/sdk/components/map/MapTextLabel.ts:89
The anchor point of this label, expressed relative to this label's width/height. [0, 0] is the top-left corner, and [1, 1] is the bottom-right corner.
Inherited from
bgBorderRadius
readonlybgBorderRadius:Subscribable<number>
Defined in: src/sdk/components/map/MapTextLabel.ts:116
The border radius of this label's background.
Inherited from
MapLocationTextLabel.bgBorderRadius
bgColor
readonlybgColor:Subscribable<string>
Defined in: src/sdk/components/map/MapTextLabel.ts:110
This label's background color.
Inherited from
bgOutlineColor
readonlybgOutlineColor:Subscribable<string>
Defined in: src/sdk/components/map/MapTextLabel.ts:122
The outline color of this label's background.
Inherited from
MapLocationTextLabel.bgOutlineColor
bgOutlineWidth
readonlybgOutlineWidth:Subscribable<number>
Defined in: src/sdk/components/map/MapTextLabel.ts:119
The outline width of this label's background.
Inherited from
MapLocationTextLabel.bgOutlineWidth
bgPadding
readonlybgPadding:Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>,"set"|"sort"|"copyWithin">>>
Defined in: src/sdk/components/map/MapTextLabel.ts:113
The padding of this label's background, in pixels. Expressed as [top, right, bottom, left].
Inherited from
MapLocationTextLabel.bgPadding
bounds
readonlybounds:Float64Array<ArrayBuffer>
Defined in: src/sdk/components/map/MapCullableTextLabel.ts:37
The bounding box of this label.
Implementation of
font
readonlyfont:Subscribable<string>
Defined in: src/sdk/components/map/MapTextLabel.ts:92
The font type of this label.
Inherited from
fontColor
readonlyfontColor:Subscribable<string>
Defined in: src/sdk/components/map/MapTextLabel.ts:98
The font color of this label.
Inherited from
MapLocationTextLabel.fontColor
fontOutlineColor
readonlyfontOutlineColor:Subscribable<string>
Defined in: src/sdk/components/map/MapTextLabel.ts:104
The font outline color of this label.
Inherited from
MapLocationTextLabel.fontOutlineColor
fontOutlineWidth
readonlyfontOutlineWidth:Subscribable<number>
Defined in: src/sdk/components/map/MapTextLabel.ts:101
The font outline width of this label, in pixels.
Inherited from
MapLocationTextLabel.fontOutlineWidth
fontSize
readonlyfontSize:Subscribable<number>
Defined in: src/sdk/components/map/MapTextLabel.ts:95
The font size of this label, in pixels.
Inherited from
invalidation
readonlyinvalidation:SubEventInterface<MapCullableLocationTextLabel,void>
Defined in: src/sdk/components/map/MapCullableTextLabel.ts:40
An invalidation event.
Implementation of
MapCullableTextLabel.invalidation
location
readonlylocation:Subscribable<GeoPointInterface>
Defined in: src/sdk/components/map/MapTextLabel.ts:314
Inherited from
offset
readonlyoffset:Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>,"set"|"sort"|"copyWithin">>>
Defined in: src/sdk/components/map/MapTextLabel.ts:316
Inherited from
priority
readonlypriority:Subscribable<number>
Defined in: src/sdk/components/map/MapTextLabel.ts:83
The render priority of this label. Higher numbers will render on top of labels with lower numbers when used with a MapCullableTextLabelManager.
Implementation of
Inherited from
showBg
readonlyshowBg:Subscribable<boolean>
Defined in: src/sdk/components/map/MapTextLabel.ts:107
Whether to show the background for this label.
Inherited from
text
readonlytext:Subscribable<string>
Defined in: src/sdk/components/map/MapTextLabel.ts:80
The text of this label.
Implementation of
Inherited from
tempVec2
protectedreadonlystatictempVec2:Float64Array<ArrayBuffer>
Defined in: src/sdk/components/map/MapTextLabel.ts:77
Inherited from
Methods
destroy()
destroy():
void
Defined in: src/sdk/components/map/MapCullableTextLabel.ts:107
Destroys this label.
Returns
void
draw()
draw(
context,mapProjection):void
Defined in: src/sdk/components/map/MapTextLabel.ts:157
Draws this label to a canvas.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | CanvasRenderingContext2D | The canvas rendering context to use to draw. |
mapProjection | MapProjection | The projection to use to project the location of the label. |
Returns
void
Implementation of
Inherited from
drawBackground()
protecteddrawBackground(context,centerX,centerY,width,height):void
Defined in: src/sdk/components/map/MapTextLabel.ts:230
Draws this label's background to a canvas.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | CanvasRenderingContext2D | The canvas rendering context. |
centerX | number | The x-coordinate of the center of the label, in pixels. |
centerY | number | the y-coordinate of the center of the label, in pixels. |
width | number | The width of the background, in pixels. |
height | number | The height of the background, in pixels. |
Returns
void
Inherited from
MapLocationTextLabel.drawBackground
drawText()
protecteddrawText(context,centerX,centerY):void
Defined in: src/sdk/components/map/MapTextLabel.ts:209
Draws this label's text to a canvas.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | CanvasRenderingContext2D | The canvas rendering context. |
centerX | number | The x-coordinate of the center of the label, in pixels. |
centerY | number | the y-coordinate of the center of the label, in pixels. |
Returns
void
Inherited from
getPosition()
protectedgetPosition(mapProjection,out):Float64Array
Defined in: src/sdk/components/map/MapTextLabel.ts:338
Gets the projected position of the label, in pixels.
Parameters
| Parameter | Type | Description |
|---|---|---|
mapProjection | MapProjection | The map projection to use. |
out | Float64Array | The vector to which to write the result. |
Returns
Float64Array
The projected position of the label.
Inherited from
MapLocationTextLabel.getPosition
loadBackgroundPath()
protectedloadBackgroundPath(context,left,top,width,height,radius):void
Defined in: src/sdk/components/map/MapTextLabel.ts:278
Loads the path of this label's background to a canvas rendering context.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | CanvasRenderingContext2D | The canvas rendering context to use. |
left | number | The x-coordinate of the left edge of the background, in pixels. |
top | number | The y-coordinate of the top edge of the background, in pixels. |
width | number | The width of the background, in pixels. |
height | number | The height of the background, in pixels. |
radius | number | The border radius of the background, in pixels. |
Returns
void
Inherited from
MapLocationTextLabel.loadBackgroundPath
setTextStyle()
protectedsetTextStyle(context):void
Defined in: src/sdk/components/map/MapTextLabel.ts:197
Loads this label's text style to a canvas rendering context.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | CanvasRenderingContext2D | The canvas rendering context to use. |
Returns
void
Inherited from
MapLocationTextLabel.setTextStyle
updateBounds()
updateBounds(
mapProjection):void
Defined in: src/sdk/components/map/MapCullableTextLabel.ts:75
Updates this label's bounding box.
Parameters
| Parameter | Type | Description |
|---|---|---|
mapProjection | MapProjection | The map projection to use. |
Returns
void