text property
Value to use for a text label.
Within a constant string value, a feature attribute name enclosed in curly
braces (e.g., {token}) is replaced with the value of the named attribute.
Tokens inside non-constant expressions are ignored; instead, use mgl_join:
and key path expressions.
The default value of this property is an expression that evaluates to the empty
string. Set this property to nil to reset it to the default value.
This attribute corresponds to the text-field
layout property in the MapLibre Style Spec.
You can set this property to an expression containing any of the following:
Constant string values
Formatted expressions.
Predefined functions, including mathematical and string operators
Conditional expressions
Variable assignments and references to assigned variables
Interpolation and step functions applied to the $zoomLevel variable and/or
feature attributes
Related examples
See the Cluster point data and Use images to cluster point data to learn how to use an expression to set this attribute to the number of markers within a cluster.
Implementation
NSExpression get text {
final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_text);
return NSExpression.castFromPointer(_ret, retain: true, release: true);
}
Value to use for a text label.
Within a constant string value, a feature attribute name enclosed in curly
braces (e.g., {token}) is replaced with the value of the named attribute.
Tokens inside non-constant expressions are ignored; instead, use mgl_join:
and key path expressions.
The default value of this property is an expression that evaluates to the empty
string. Set this property to nil to reset it to the default value.
This attribute corresponds to the text-field
layout property in the MapLibre Style Spec.
You can set this property to an expression containing any of the following:
Constant string values
Formatted expressions.
Predefined functions, including mathematical and string operators
Conditional expressions
Variable assignments and references to assigned variables
Interpolation and step functions applied to the $zoomLevel variable and/or
feature attributes
Related examples
See the Cluster point data and Use images to cluster point data to learn how to use an expression to set this attribute to the number of markers within a cluster.
Implementation
set text(NSExpression value) {
_objc_msgSend_xtuoz7(this.ref.pointer, _sel_setText_, value.ref.pointer);
}