Skip to content

KBE3D / KBCore / Cesium / StyleExpression

类: StyleExpression

An expression for a style applied to a Cesium3DTileset. <p> Derived classes of this interface evaluate expressions in the 3D Tiles Styling language

. </p> <p> This type describes an interface and is not intended to be instantiated directly. </p>

方法

evaluate()

evaluate(feature: Cesium3DTileFeature, result?: any): string | number | boolean | RegExp | Color | Cartesian3 | Cartesian2 | Cartesian4

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 <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code> object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>, a Cartesian2, Cartesian3, or Cartesian4 object will be returned. If the <code>result</code> argument is a Color, the Cartesian4 value is converted to a Color and then returned.

参数

feature

Cesium3DTileFeature

The feature whose properties may be used as variables in the expression.

result?

any

The object onto which to store the result.

返回

string | number | boolean | RegExp | Color | Cartesian3 | Cartesian2 | Cartesian4

The result of evaluating the expression.


evaluateColor()

evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color

Evaluates the result of a Color expression, optionally using the provided feature's properties. <p> This is equivalent to StyleExpression#evaluate but always returns a Color object. </p>

参数

feature

Cesium3DTileFeature

The feature whose properties may be used as variables in the expression.

result?

Color

The object in which to store the result.

返回

Color

The modified result parameter or a new Color instance if one was not provided.

构造函数

构造函数

new StyleExpression(): StyleExpression

返回

StyleExpression

KBE3D @3.0.0 Copyright © 2024-present KBE3D