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 331

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 140
Returns:
HTML Element

getIcon(){string|null}

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

getIconHeight(){number}

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

getIconWidth(){number}

src/cercalia/label.js, line 220
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 303
Returns:
Marker.

getOverlay(){ol.Overlay}

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

getText(){string}

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

hide()

src/cercalia/label.js, line 268

Hide the label

isVisible(){boolean}

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

removeIcon()

src/cercalia/label.js, line 198

remove Icon if exist

setIcon(icon)

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

Image icon source

setIconHeight(height)

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

Height in pixels.

setIconWidth(width)

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

Width in pixels.

setPosition(position, opt_projectionCode)

src/cercalia/label.js, line 313

Change label position.

Name Type Description
position cercalia.LonLat

Position

projectionCode string

Optional projection code

setText(text)

src/cercalia/label.js, line 149

Change label text

Name Type Description
text string

Text to display on label.

show()

src/cercalia/label.js, line 256

Show the label