Skip to main content

Class: SpotTag

component.SpotTag

classdesc Tag holding properties for visualizing the centroid of a geometry.

example

var geometry = new PointGeometry([0.3, 0.3]);var tag = new SpotTag(    "id-1",    geometry    { editable: true, color: 0xff0000 });
tagComponent.add([tag]);

Hierarchy#

  • Tag

    ↳ SpotTag

Constructors#

constructor#

• new SpotTag(id, geometry, options?)

Create a spot tag.

override

Parameters#

NameTypeDescription
idstring
geometryGeometry
options?SpotTagOptionsOptions defining the visual appearance and behavior of the spot tag.

Overrides#

Tag.constructor

Defined in#

component/tag/tag/SpotTag.ts:40

Events#

on#

• on(type, handler): void

Event fired when the geometry of the tag has changed.

example

var tag = new OutlineTag({ // tag options });// Set an event listenertag.on('geometry', function() {  console.log("A geometry event has occurred.");});

Parameters#

NameType
type"geometry"
handler(event: TagStateEvent) => void

Returns#

void

Inherited from#

Tag.on

Defined in#

component/tag/tag/Tag.ts:147

• on(type, handler): void

Event fired when a tag has been updated.

example

var tag = new OutlineTag({ // tag options });// Set an event listenertag.on('tag', function() {  console.log("A tag event has occurred.");});

Parameters#

NameType
type"tag"
handler(event: TagStateEvent) => void

Returns#

void

Inherited from#

Tag.on

Defined in#

component/tag/tag/Tag.ts:164

Accessors#

color#

• get color(): number

Get color property.

Returns#

number

The color of the spot as a hexagonal number;

Defined in#

component/tag/tag/SpotTag.ts:56

• set color(value): void

Set color property.

fires changed

Parameters#

NameType
valuenumber

Returns#

void

The color of the spot as a hexagonal number;

Defined in#

component/tag/tag/SpotTag.ts:66


editable#

• get editable(): boolean

Get editable property.

Returns#

boolean

Value indicating if tag is editable.

Defined in#

component/tag/tag/SpotTag.ts:75

• set editable(value): void

Set editable property.

fires changed

Parameters#

NameType
valueboolean

Returns#

void

Value indicating if tag is editable.

Defined in#

component/tag/tag/SpotTag.ts:85


geometry#

• get geometry(): Geometry

Get geometry property.

Returns#

Geometry

The geometry of the tag.

Defined in#

component/tag/tag/Tag.ts:76


icon#

• get icon(): string

Get icon property.

Returns#

string

Defined in#

component/tag/tag/SpotTag.ts:94

• set icon(value): void

Set icon property.

fires changed

Parameters#

NameType
valuestring

Returns#

void

Defined in#

component/tag/tag/SpotTag.ts:104


id#

• get id(): string

Get id property.

Returns#

string

Defined in#

component/tag/tag/Tag.ts:68


text#

• get text(): string

Get text property.

Returns#

string

Defined in#

component/tag/tag/SpotTag.ts:113

• set text(value): void

Set text property.

fires changed

Parameters#

NameType
valuestring

Returns#

void

Defined in#

component/tag/tag/SpotTag.ts:123


textColor#

• get textColor(): number

Get text color property.

Returns#

number

Defined in#

component/tag/tag/SpotTag.ts:132

• set textColor(value): void

Set text color property.

fires changed

Parameters#

NameType
valuenumber

Returns#

void

Defined in#

component/tag/tag/SpotTag.ts:142

Methods#

fire#

â–¸ fire(type, event): void

Parameters#

NameType
type"tag" | "geometry"
eventTagStateEvent

Returns#

void

Inherited from#

Tag.fire

Defined in#

../doc/component/tag/tag/Tag.ts:103


off#

â–¸ off(type, handler): void

Unsubscribe from an event by its name.

Parameters#

NameType
type"tag" | "geometry"
handler(event: TagStateEvent) => void

Returns#

void

Inherited from#

Tag.off

Defined in#

../doc/component/tag/tag/Tag.ts:118


setOptions#

â–¸ setOptions(options): void

Set options for tag.

description Sets all the option properties provided and keps the rest of the values as is.

fires changed

Parameters#

NameTypeDescription
optionsSpotTagOptionsSpot tag options

Returns#

void

Defined in#

component/tag/tag/SpotTag.ts:157