Class: Label

cercalia.Label

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

new cercalia.Label(options)

Name Type Description
options

Label options

Name Type Description
color string | undefined optional

Label color. Default value '#000000'

background string | undefined optional

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

fontWeight boolean | undefined optional

Bold text. Default: false

lightLabel boolean | undefined optional

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

offsetX number | undefined optional

Horitzontal Label offset, in pixels, from the bottom position of icon. If not specified, the position is the center (X axis).

offsetY number | undefined optional

Vertical Label offset, in pixels, from the bottom position of icon. If not specified, the position is the center (Y axis).

show boolean | undefined optional

Show text. Default value 1

text string

Simple Label text (with no background).

iconWidth number | undefined optional

Width of image. Default value 15.

iconHeight number | undefined optional

Height of image. Default value 15.

icon string

Image src.

Methods

Remove the label.

Returns:
ClassName.
Returns:
src image icon
Returns:
get height icon, defould 15
Returns:
get width icon, defould 15
Returns:
OpenLayers3 ol.Overlay Objet.
Returns:
Label text

Hide the label

Returns:
if popup is opened or not. Values: true or false.

remove Icon if exist

Name Type Description
src string

image icon

Name Type Description
height number
Name Type Description
width number
Name Type Description
marker cercalia.Marker

setPosition(position, projectionCode)

Change label position.

Name Type Description
position cercalia.LonLat
projectionCode string

Change label text

Name Type Description
text string

Show the label