-
Name Type Description optionsOptions
Name Type Description classNamestring Class name for CSS styling. Default empty.
colorstring Label color. Default value '#000000'
backgroundstring Label backgroud. The string format is the same than css tag. Default value 'none repeat scroll 0% 0% #ffffff'
fontWeightboolean Bold text. Default: false
offsetmodule:maplibre-gl~Offset Label offset, in pixels, from the bottom position of icon. Default value for default label is
[-3, -18].showboolean Show text. Default value
1.textstring Simple Label text (with no background).
anchormodule:maplibre-gl~PositionAnchor | undefined Anchor
'center' , 'top' , 'bottom' , 'left' , 'right' , 'top-left' , 'top-right'.
Methods
-
Return DOM Element.
-
Obtain marker.
Returns:
Marker.
-
Obtain text
Returns:
Label text
-
Hide element on map
-
Returns:
if popup is opened or not. Values:trueorfalse.
-
Change label position.
Name Type Description positionmodule:cercaliagl/LonLat~LonLat Position
-
Change label text content. It can be HTML string. For example
<b>Bold</b> text labelName Type Description textstring Text to display on label.
-
Show element on map