Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TextTechniqueParams

Render geometry as a text.

Hierarchy

Index

Properties

Optional backgroundColor

backgroundColor: DynamicProperty<StyleColor>

Text background color in hexadecimal or CSS-style notation, for example: "#e4e9ec", "#fff", "rgb(255, 0, 0)", or "hsl(35, 11%, 88%)".

format

color-hex

Optional backgroundOpacity

backgroundOpacity: DynamicProperty<number>

Background text opacity value.

Optional backgroundSize

backgroundSize: DynamicProperty<number>

Size of the text background (pixels).

Optional canvasRotation

canvasRotation: DynamicProperty<number>

TextCanvas rotation (radians).

Optional category

category: DynamicProperty<string>

The category of this technique.

remarks

The category is used in conjunction with Theme.priorities to assign render orders to the objects created by this Style.

Optional color

Text color in hexadecimal or CSS-style notation, for example: "#e4e9ec", "#fff", "rgb(255, 0, 0)", or "hsl(35, 11%, 88%)".

format

color-hex

Optional constantHeight

constantHeight: DynamicProperty<boolean>

If true, geometry height won't be scaled on projection. Enable it for projections with variable scale factor (e.g. mercator) to avoid distortions in geometry with great heights and latitude spans. E.g. a large object with even height would look oblique to the ground plane on mercator unless this property is set to true.

defaultvalue

true for geometries stored at level less than 12.

Optional distanceScale

distanceScale: undefined | number

Scaling factor of the text. Defaults to 0.5, reducing the size ot 50% in the distance.

Optional enabled

enabled: DynamicProperty<boolean>

Runtime filtering of techniques.

Use with ['dynamic-properties'] operator for dynamic feature highlight, highlighig etc.

see

Picking example

Optional fadeFar

fadeFar: DynamicProperty<number>

Distance to the camera (0.0 = camera position, 1.0 = farPlane) at which the object has zero opacity and stops fading out. An undefined value disables fading.

Optional fadeNear

fadeNear: DynamicProperty<number>

Distance to the camera `(0.0 = camera position, 1.0 = farPlane) at which the object start fading out (opacity decreases).

Optional fontName

fontName: undefined | string

Name of the preferred Font to be used when rendering.

Optional fontStyle

fontStyle: "Regular" | "Bold" | "Italic" | "BoldItalic"

Glyph style to apply for the currently active Font.

Optional fontVariant

fontVariant: "Regular" | "AllCaps" | "SmallCaps"

Glyph variant to apply for the currently active Font.

Optional hAlignment

hAlignment: DynamicProperty<"Left" | "Center" | "Right">

Text position regarding the baseline.

Optional id

id: undefined | string

The name used to identify materials created from this technique.

Optional kind

Specified kind of geometry.

remarks

One kind is set as default in the technique, and can be overridden in the style.

deprecated

Use enabled with expressions based on ['dynamic-properties'] operator. See "object picking" example.

Optional label

label: undefined | string

Field name of object containing the text to be rendered.

deprecated

Use ["get", "FIELD"].

Optional leading

leading: DynamicProperty<number>

Inter-line spacing (pixels). Scaled by size.

Optional lineRotation

lineRotation: DynamicProperty<number>

Line typesetting rotation (radians).

Optional lineWidth

lineWidth: DynamicProperty<number>

Maximum line width (pixels).

Optional maxLines

maxLines: DynamicProperty<number>

Maximum number of lines for this label.

Optional maxZoomLevel

maxZoomLevel: DynamicProperty<number>

Maximum zoom level. If the current zoom level is equal to or greater, the technique will not be used.

Optional mayOverlap

mayOverlap: undefined | false | true

If true, icon is allowed to overlap other labels or icons of lower priority.

defaultvalue

false

Optional minZoomLevel

minZoomLevel: DynamicProperty<number>

Minimal zoom level. If the current zoom level is smaller, the technique will not be used.

Optional opacity

opacity: DynamicProperty<number>

For transparent text, set a value between 0.0 for totally transparent, to 1.0 for totally opaque.

Optional priority

priority: DynamicProperty<number>

Priority of text, defaults to 0. Elements with highest priority get placed first.

Optional renderOrder

renderOrder: DynamicProperty<number>

The render order of the objects created using this technique.

remarks

If not specified in style file monotonically increasing values according to style position in file.

Optional reserveSpace

reserveSpace: undefined | false | true

If true, element will reserve screen space, other markers of lower priority will not be able to overlap.

defaultvalue

true

Optional rotation

rotation: undefined | number

Glyph local rotation (radians).

Optional side

side: DynamicProperty<number>

Defines which side of faces will be rendered - front, back or both. See https://threejs.org/docs/#api/en/materials/Material.side.

Optional size

size: DynamicProperty<number>

Size of the text (pixels).

Optional style

style: undefined | string

Name of the text style.

Optional text

text: DynamicProperty<string>

Text to be displayed for feature.

remarks

Defaults to first defined:

  • feature property label if present in technique (depreacted);
  • ["get", "name:short"] is useAbbreviation is true;
  • ["get", "iso_code"] is useIsoCode is true;
  • ["get", "name:$LANGUAGE"] for each specified language;
  • ["get", "name"].

Optional textFadeTime

textFadeTime: undefined | number

Fading time for labels in seconds.

Optional tracking

tracking: DynamicProperty<number>

Inter-glyph spacing (pixels). Scaled by size.

Optional transient

transient: boolean | Pickability

Optional. If true or Pickability.transient, no IDs will be saved for the geometry this style creates. Default is Pickability.onlyVisible, which allows all pickable and visible objects to be picked, Pickability.all, will also allow invisible objects to be picked.

defaultvalue

Pickability.onlyVisible The boolean option is for backwardscompatibilty, please use the Pickability.

TODO: deprecate and rename to something that makes more sense

Optional transparent

transparent: DynamicProperty<boolean>

Set to 'true' if line should appear transparent.

remarks

Rendering transparent lines may come with a slight performance impact. See https://threejs.org/docs/#api/en/materials/Material.transparent.

Optional useAbbreviation

useAbbreviation: undefined | false | true

If true, the abbreviation (field name:short) of the elements is used as text.

deprecated

Use proper expression with [get, name:short] for this purpose.

Optional useIsoCode

useIsoCode: undefined | false | true

If true, the iso code (field 'iso_code') of the elements is used as text.

remarks

The iso_code field contains the ISO 3166-1 2-letter country code.

deprecated

Use proper expression with [get, iso_code] for this purpose.

Optional vAlignment

vAlignment: DynamicProperty<"Above" | "Center" | "Below">

Text position inside a line.

Optional wrappingMode

wrappingMode: DynamicProperty<"None" | "Character" | "Word">

Wrapping (line-breaking) mode.

Optional xOffset

xOffset: undefined | number

Horizontal offset (to the right) in screen pixels.

Optional yOffset

yOffset: undefined | number

Vertical offset (up) in screen pixels.

Generated using TypeDoc