StyleExpression

new Cesium.StyleExpression()

应用于Cesium3DTileset的样式的表达式。

Derived classes of this interface evaluate expressions in the 3D Tiles Styling language.

This type describes an interface and is not intended to be instantiated directly.

See:

Methods

evaluate(feature, result)Boolean|Number|String|RegExp|Cartesian2|Cartesian3|Cartesian4|Color

计算表达式的result,可选地使用提供的功能的属性。如果 中的表达式 3D Tiles Styling language 类型为BooleanNumberString,对应的JavaScript 将返回基元类型。如果结果是RegExp,则为Javascript RegExp 对象将被返回。如果结果是Cartesian2Cartesian3Cartesian4, 将返回Cartesian2Cartesian3Cartesian4对象。如果结果参数是 一个ColorCartesian4值被转换为Color,然后返回。
Name Type Description
feature Cesium3DTileFeature 其属性可以用作表达式中变量的特性。
result Object optional 要将结果存储到的对象。
Returns:
计算表达式的结果。

evaluateColor(feature, result)Color

计算颜色表达式的结果,可选地使用提供的功能的属性。

This is equivalent to StyleExpression#evaluate but always returns a Color object.

Name Type Description
feature Cesium3DTileFeature 其属性可以用作表达式中变量的特性。
result Color optional 存储结果的对象。
Returns:
如果未提供修改的结果参数或新的颜色实例。