ConditionsExpression

external class ConditionsExpression(val conditionsExpression: Any = definedExternally, defines: Any? = definedExternally) : StyleExpression(source)

An expression for a style applied to a Cesium3DTileset.

Evaluates a conditions expression defined using the 3D Tiles Styling language.

Implements the StyleExpression interface.

const expression = new ConditionsExpression({
conditions : [
['${Area} 10, 'color("#FF0000")'],
['${id} !== "1"', 'color("#00FF00")'],
['true', 'color("#FFFFFF")']
]
});
expression.evaluateColor(feature, result); // returns a Color object

Parameters

defines

Defines in the style.

See also

Constructors

Link copied to clipboard
constructor(conditionsExpression: Any = definedExternally, defines: Any? = definedExternally)

Properties

Link copied to clipboard

The conditions expression defined using the 3D Tiles Styling language.

Functions

Link copied to clipboard
open override fun evaluate(feature: Cesium3DTileFeature, result: Any?): Any

Evaluates the result of an expression, optionally using the provided feature's properties. If the result of the expression in the 3D Tiles Styling language is of type Boolean, Number, or String, the corresponding JavaScript primitive type will be returned. If the result is a RegExp, a Javascript RegExp object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, a Cartesian2, Cartesian3, or Cartesian4 object will be returned. If the result argument is a Color, the Cartesian4 value is converted to a Color and then returned.

Link copied to clipboard
open override fun evaluateColor(feature: Cesium3DTileFeature, result: Color?): Color

Evaluates the result of a Color expression, using the values defined by a feature.