• Public
  • Public/Protected
  • All

A TextStyle describes how text should be formatted on the map.

TextStyle is not an actual type in the LuciadRIA API. This is only documentation of the the expected structure of an object in order to be considered a TextStyle.

All properties are optional.




  • TextStyle



Optional alignmentBaseline

alignmentBaseline: string

The baseline alignment of the text for the vertical anchoring of the text.. Allowed values are top, hanging, middle, alphabetic, ideographic and bottom. For more information about these values, please visit the W3 documentation for the html5 canvas "textBaseline" property.

Optional angle

angle: number

The rotation of the text, clockwise in degrees. The text is rotated in view-space. This means the angle is not an orientation of the text with regards to the Earth's coordinate system, but a rotation in the plane of the screen. An angle with value 0 means the text is oriented straight up.

Optional draped

draped: boolean

Whether or not this text should be draped on top of the terrain.

By default, a shape is draped if it has undefined or zero Z. Otherwise it will not be draped.

You can override the default behaviour by setting this flag true or false. If you explicitly drape a 3D shape, its 2D "shadow" is painted on the terrain.

This setting is only relevant for 3D maps and is ignored for 2D maps.



Optional fill

fill: string

The fill color as a CSS color string. This is the color of the text itself.

Optional font

font: string

The font to use, as a CSS font string.

Optional halo

halo: string

The halo color as a CSS color string. This is an outline around the text.

Optional haloWidth

haloWidth: number

The halo width.

Optional occlusionMode

occlusionMode: OcclusionMode

When this text should be painted in 3D in relation to other 3D data.


  • Mode VISIBLE_ONLY shows only the part of the text that is not obscured by other 3D data. This is the default.
  • Mode ALWAYS_VISIBLE shows the entire text even if behind by other 3D data. The text will appear in front of other objects.
  • Mode OCCLUDED_ONLY shows only the part of the text that is behind other 3D data. You typically use this to display obscured shapes in combination with another style that uses "VISIBLE" mode.
  • This parameter is only relevant in 3D.
  • This parameter is only applied on non-draped shapes.
  • When using extruded shapes or other non-flat shapes, a combination of "OCCLUDED_ONLY" and "VISIBLE_ONLY" only works with transparent colors.





Optional offsetX

offsetX: number

The X offset in pixels that should be applied with respect to the location specified by the shape parameter.

Optional offsetY

offsetY: number

the Y offset in pixels that should be applied wrt the location specified by the shape parameter. specified by the shape parameter.

Optional stroke

stroke: string

The stroke of the text. This is the outline of the text. It can partially overlap with the fill and halo.

Optional strokeWidth

strokeWidth: number

the stroke width

Optional textAnchor

textAnchor: string

The horizontal anchoring of the text for the given location. Allowed values are "start", "end", "left", "right" and "center". The "left" or "start" means that the text will be anchored at the first character of the text-string. The "right" or "end" means the text will be anchored at the last character of the string. The "center" means the text will be centered on the anchor. The default value is start.

The value for textAnchor controls also how every element of a multi-line text is horizontally aligned.

Multi-line text with different textAnchor values

Optional zOrder

zOrder: number

The Z-order of this shape. Shapes will be painted from lowest to highest Z-order.


  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method