Class: SimpleLabel

cercalia.SimpleLabel


cercalia.SimpleLabel

new cercalia.SimpleLabel(options)

src/cercalia/simplelabel.js, line 16
Name Type Description
options

Marker options

Name Type Description
color string | undefined

Text color.

fontBold boolean | undefined

Bold text. Default: true.

fontFamily string | undefined

Text font.

fontSize number | undefined

Text size, in pixels. Default 13.

divided boolean | undefined

String separating with breaking line. Default true.

offset Array.<number> | undefined

Simpel Label offset, in pixels. Default value: [0, 0].

overflow boolean | undefined

For polygon labels allow text to exceed the width of the polygon at the label positoin. Default false.

strokeColor string | undefined

Stroke color.

strokeWidth number | undefined

Stroke width.

rotation number | undefined

Text rotation.

text string

Simple Label text (with no background). Required.

textAlign string | undefined

Text alignment. Possible values: left, right, center, end or start. Default is left.

visible boolean | undefined

Text visibility. Default value true.

Extends

Methods

destroy()

src/cercalia/simplelabel.js, line 451

Destroy object

getClass(){string} inherited

src/cercalia/object.js, line 41
Returns:
Get Class name of object

getFillColor(){string}

src/cercalia/simplelabel.js, line 308

Return text color.

Returns:
Hexadecimal color. For example: #FF0000.

getFontFamily(){string}

src/cercalia/simplelabel.js, line 225

Returns text font family-

Returns:
Font family.

getFontSize(){number}

src/cercalia/simplelabel.js, line 267

Returns text font

Returns:
Font size in pixels.

getId(){string} inherited

src/cercalia/object.js, line 33
Returns:
Unique Id.

getOffset(){Array.<number>}

src/cercalia/simplelabel.js, line 288

Returns offset.

Returns:
Offset [x,y].

getOverflow(){boolean}

src/cercalia/simplelabel.js, line 426
Returns:
Get overflow value

getRotation(){number}

src/cercalia/simplelabel.js, line 367

Returns SimpleLabel rotation

Returns:
Rotation angle in degrees.

getStrokeColor(){string}

src/cercalia/simplelabel.js, line 328

Returns outline color of text.

Returns:
Hexadecimal color. For exmaple: #FF0000.

getStrokeWidth(){number}

src/cercalia/simplelabel.js, line 348

Get Stroke Width

Returns:
Width in pixels.

getText(){string}

src/cercalia/simplelabel.js, line 205

Get simple label text

Returns:
Get text.

getTextStyle(){ol.style.Text}

src/cercalia/simplelabel.js, line 179

Get Text style.

Returns:
Text style.

isFontBold(){boolean}

src/cercalia/simplelabel.js, line 245

Returns true if font is bold.

Returns:
Font bold. true bold, false normal weight.

isVisible(){boolean}

src/cercalia/simplelabel.js, line 391
Returns:
visible Returns if SimpleLabel is visible

setFillColor(fillColor)

src/cercalia/simplelabel.js, line 297

Change text color. If have an assigned marker updates it

Name Type Description
fillColor string

Hexadecimal color. For example: #FF0000.

setFontBold(fontBold)

src/cercalia/simplelabel.js, line 234

Change the text passed by parameter. If have an assigned marker updates it

Name Type Description
fontBold boolean

true bold, false normal weight.

setFontFamily(fontFamily)

src/cercalia/simplelabel.js, line 214

Change the text passed by parameter. If have an assigned marker updates it

Name Type Description
fontFamily string

Font Family. Example: Arial.

setFontSize(fontSize)

src/cercalia/simplelabel.js, line 255

Change the text size in pixels. If have an assigned marker updates it

Name Type Description
fontSize number

Font size in pixels.

setOffset(offset)

src/cercalia/simplelabel.js, line 277

Change displacement on the horizontal axis. If have an assigned marker updates it

Name Type Description
offset Array.<number>

Offset [x,y].

setOverflow(overflow)

src/cercalia/simplelabel.js, line 416
Name Type Description
overflow boolean

Permit overflow over feature or not.

setRotation(rotation)

src/cercalia/simplelabel.js, line 357

Change the text passed by parameter. If has an assigned marker updates it

Name Type Description
rotation number

Rotation angle in degrees.

setStrokeColor(strokeColor)

src/cercalia/simplelabel.js, line 317

Change outline color. If has an assigned marker updates it

Name Type Description
strokeColor string

Hexadecimal color. For exmaple: #FF0000.

setStrokeWidth(strokeWidth)

src/cercalia/simplelabel.js, line 337

Change width. If null, sets 0 value. If has an assigned marker updates it

Name Type Description
strokeWidth number

Width in pixels.

setText(text, opt_divider)

src/cercalia/simplelabel.js, line 189

Change the text passed by parameter. If have an assigned marker updates it

Name Type Description
text string

Text to put to simple label.

divider boolean

Optional divider.

setVisible(visible)

src/cercalia/simplelabel.js, line 400

Show / hide label

Name Type Description
visible boolean

Set visible. (true or false).