Class: Label

cercalia.Label


Marker label. You can personalize the color, text type, position, etc...

new cercalia.Label(options)

src/cercalia/label.js, line 18
Name Type Description
options

Label options

Name Type Description
color string | undefined

Label color. Default value '#000000'

background string | undefined

Label backgroud. The string format is the same than css tag. Default value 'none repeat scroll 0% 0% #ffffff'

fontWeight boolean | undefined

Bold text. Default: false

lightLabel boolean | undefined

In case of paint a high number of labels, you can create Labels with a simpler DOM. Default value: false.

offset number | undefined

Label offset, in pixels, from the bottom position of icon. Default value for default label is [-3, -18].

show boolean | undefined

Show text. Default value 1

text string

Simple Label text (with no background). Required.

iconWidth number | undefined

Width of image. Default value 15.

iconHeight number | undefined

Height of image. Default value 15.

icon string

Image src. Required.

Extends

Methods

destroy()

src/cercalia/label.js, line 359

Remove the label.

getClass(){string} inherited

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

getElement(){Element|null|undefined}

src/cercalia/label.js, line 147
Returns:
HTML Element

getIcon(){string|null}

src/cercalia/label.js, line 173
Returns:
src image icon

getIconHeight(){number}

src/cercalia/label.js, line 219
Returns:
get height icon. Default 15.

getIconWidth(){number}

src/cercalia/label.js, line 227
Returns:
get width icon. Default 15.

getId(){string} inherited

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

getMarker(){cercalia.Marker}

src/cercalia/label.js, line 331
Returns:
Marker.

getOverlay(){ol.Overlay}

src/cercalia/label.js, line 351
Returns:
OpenLayers3 ol.Overlay Objet.

getText(){string}

src/cercalia/label.js, line 165
Returns:
Label text

getZIndex(){number}

src/cercalia/label.js, line 300
Returns:
CSS label zIndex

hide()

src/cercalia/label.js, line 275

Hide the label

isVisible(){boolean}

src/cercalia/label.js, line 308
Returns:
if popup is opened or not. Values: true or false.

removeIcon()

src/cercalia/label.js, line 205

remove Icon if exist

setIcon(icon)

src/cercalia/label.js, line 181
Name Type Description
icon string

Image icon source

setIconHeight(height)

src/cercalia/label.js, line 235
Name Type Description
height number

Height in pixels.

setIconWidth(width)

src/cercalia/label.js, line 249
Name Type Description
width number

Width in pixels.

setPosition(position, opt_projectionCode)

src/cercalia/label.js, line 341

Change label position.

Name Type Description
position cercalia.LonLat

Position

projectionCode string

Optional projection code

setText(text)

src/cercalia/label.js, line 156

Change label text

Name Type Description
text string

Text to display on label.

setZIndex(zIndex)

src/cercalia/label.js, line 288

Change the zIndex value

Name Type Description
zIndex number

Z-Index of label.

show()

src/cercalia/label.js, line 263

Show the label