Skip to main content

Class: MapCullableLocationTextLabel

A cullable (hides labels that collide with other labels) text label associated with a specific geographic location.

Hierarchy

Implements

Constructors

constructor

new MapCullableLocationTextLabel(text, priority, location, alwaysShow, options?): MapCullableLocationTextLabel

Constructor.

Parameters

NameTypeDescription
textstring | Subscribable<string>The text of this label, or a subscribable which provides it.
prioritynumber | Subscribable<number>The priority of this label, or a subscribable which provides it.
locationGeoPointInterface | Subscribable<GeoPointInterface>The geographic location of this label, or a subscribable which provides it.
alwaysShowboolean | Subscribable<boolean>Whether this label is immune to culling, or a subscribable which provides it.
options?MapLocationTextLabelOptionsOptions with which to initialize this label.

Returns

MapCullableLocationTextLabel

Overrides

MapLocationTextLabel.constructor

Defined in

src/sdk/components/map/MapCullableTextLabel.ts:52

Properties

alwaysShow

Readonly alwaysShow: Subscribable<boolean>

Whether this label is immune to culling.

Implementation of

MapCullableTextLabel.alwaysShow

Defined in

src/sdk/components/map/MapCullableTextLabel.ts:34


anchor

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

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

MapLocationTextLabel.anchor

Defined in

src/sdk/components/map/MapTextLabel.ts:89


bgBorderRadius

Readonly bgBorderRadius: Subscribable<number>

The border radius of this label's background.

Inherited from

MapLocationTextLabel.bgBorderRadius

Defined in

src/sdk/components/map/MapTextLabel.ts:116


bgColor

Readonly bgColor: Subscribable<string>

This label's background color.

Inherited from

MapLocationTextLabel.bgColor

Defined in

src/sdk/components/map/MapTextLabel.ts:110


bgOutlineColor

Readonly bgOutlineColor: Subscribable<string>

The outline color of this label's background.

Inherited from

MapLocationTextLabel.bgOutlineColor

Defined in

src/sdk/components/map/MapTextLabel.ts:122


bgOutlineWidth

Readonly bgOutlineWidth: Subscribable<number>

The outline width of this label's background.

Inherited from

MapLocationTextLabel.bgOutlineWidth

Defined in

src/sdk/components/map/MapTextLabel.ts:119


bgPadding

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

The padding of this label's background, in pixels. Expressed as [top, right, bottom, left].

Inherited from

MapLocationTextLabel.bgPadding

Defined in

src/sdk/components/map/MapTextLabel.ts:113


bounds

Readonly bounds: Float64Array

The bounding box of this label.

Implementation of

MapCullableTextLabel.bounds

Defined in

src/sdk/components/map/MapCullableTextLabel.ts:37


font

Readonly font: Subscribable<string>

The font type of this label.

Inherited from

MapLocationTextLabel.font

Defined in

src/sdk/components/map/MapTextLabel.ts:92


fontColor

Readonly fontColor: Subscribable<string>

The font color of this label.

Inherited from

MapLocationTextLabel.fontColor

Defined in

src/sdk/components/map/MapTextLabel.ts:98


fontOutlineColor

Readonly fontOutlineColor: Subscribable<string>

The font outline color of this label.

Inherited from

MapLocationTextLabel.fontOutlineColor

Defined in

src/sdk/components/map/MapTextLabel.ts:104


fontOutlineWidth

Readonly fontOutlineWidth: Subscribable<number>

The font outline width of this label, in pixels.

Inherited from

MapLocationTextLabel.fontOutlineWidth

Defined in

src/sdk/components/map/MapTextLabel.ts:101


fontSize

Readonly fontSize: Subscribable<number>

The font size of this label, in pixels.

Inherited from

MapLocationTextLabel.fontSize

Defined in

src/sdk/components/map/MapTextLabel.ts:95


invalidation

Readonly invalidation: SubEventInterface<MapCullableLocationTextLabel, void>

An invalidation event.

Implementation of

MapCullableTextLabel.invalidation

Defined in

src/sdk/components/map/MapCullableTextLabel.ts:40


location

Readonly location: Subscribable<GeoPointInterface>

Inherited from

MapLocationTextLabel.location

Defined in

src/sdk/components/map/MapTextLabel.ts:314


offset

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

Inherited from

MapLocationTextLabel.offset

Defined in

src/sdk/components/map/MapTextLabel.ts:316


priority

Readonly priority: Subscribable<number>

The render priority of this label. Higher numbers will render on top of labels with lower numbers when used with a MapCullableTextLabelManager.

Implementation of

MapCullableTextLabel.priority

Inherited from

MapLocationTextLabel.priority

Defined in

src/sdk/components/map/MapTextLabel.ts:83


showBg

Readonly showBg: Subscribable<boolean>

Whether to show the background for this label.

Inherited from

MapLocationTextLabel.showBg

Defined in

src/sdk/components/map/MapTextLabel.ts:107


text

Readonly text: Subscribable<string>

The text of this label.

Implementation of

MapCullableTextLabel.text

Inherited from

MapLocationTextLabel.text

Defined in

src/sdk/components/map/MapTextLabel.ts:80


tempVec2

Static Protected Readonly tempVec2: Float64Array

Inherited from

MapLocationTextLabel.tempVec2

Defined in

src/sdk/components/map/MapTextLabel.ts:77

Methods

destroy

destroy(): void

Destroys this label.

Returns

void

Defined in

src/sdk/components/map/MapCullableTextLabel.ts:107


draw

draw(context, mapProjection): void

Draws this label to a canvas.

Parameters

NameTypeDescription
contextCanvasRenderingContext2DThe canvas rendering context to use to draw.
mapProjectionMapProjectionThe projection to use to project the location of the label.

Returns

void

Implementation of

MapCullableTextLabel.draw

Inherited from

MapLocationTextLabel.draw

Defined in

src/sdk/components/map/MapTextLabel.ts:157


drawBackground

drawBackground(context, centerX, centerY, width, height): void

Draws this label's background to a canvas.

Parameters

NameTypeDescription
contextCanvasRenderingContext2DThe canvas rendering context.
centerXnumberThe x-coordinate of the center of the label, in pixels.
centerYnumberthe y-coordinate of the center of the label, in pixels.
widthnumberThe width of the background, in pixels.
heightnumberThe height of the background, in pixels.

Returns

void

Inherited from

MapLocationTextLabel.drawBackground

Defined in

src/sdk/components/map/MapTextLabel.ts:230


drawText

drawText(context, centerX, centerY): void

Draws this label's text to a canvas.

Parameters

NameTypeDescription
contextCanvasRenderingContext2DThe canvas rendering context.
centerXnumberThe x-coordinate of the center of the label, in pixels.
centerYnumberthe y-coordinate of the center of the label, in pixels.

Returns

void

Inherited from

MapLocationTextLabel.drawText

Defined in

src/sdk/components/map/MapTextLabel.ts:209


getPosition

getPosition(mapProjection, out): Float64Array

Gets the projected position of the label, in pixels.

Parameters

NameTypeDescription
mapProjectionMapProjectionThe map projection to use.
outFloat64ArrayThe vector to which to write the result.

Returns

Float64Array

The projected position of the label.

Inherited from

MapLocationTextLabel.getPosition

Defined in

src/sdk/components/map/MapTextLabel.ts:338


loadBackgroundPath

loadBackgroundPath(context, left, top, width, height, radius): void

Loads the path of this label's background to a canvas rendering context.

Parameters

NameTypeDescription
contextCanvasRenderingContext2DThe canvas rendering context to use.
leftnumberThe x-coordinate of the left edge of the background, in pixels.
topnumberThe y-coordinate of the top edge of the background, in pixels.
widthnumberThe width of the background, in pixels.
heightnumberThe height of the background, in pixels.
radiusnumberThe border radius of the background, in pixels.

Returns

void

Inherited from

MapLocationTextLabel.loadBackgroundPath

Defined in

src/sdk/components/map/MapTextLabel.ts:278


setTextStyle

setTextStyle(context): void

Loads this label's text style to a canvas rendering context.

Parameters

NameTypeDescription
contextCanvasRenderingContext2DThe canvas rendering context to use.

Returns

void

Inherited from

MapLocationTextLabel.setTextStyle

Defined in

src/sdk/components/map/MapTextLabel.ts:197


updateBounds

updateBounds(mapProjection): void

Updates this label's bounding box.

Parameters

NameTypeDescription
mapProjectionMapProjectionThe map projection to use.

Returns

void

Implementation of

MapCullableTextLabel.updateBounds

Defined in

src/sdk/components/map/MapCullableTextLabel.ts:75