Cesium3DTileset.
计算使用以下定义的表达式 Evaluates an expression defined using the 3D Tiles Styling language.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
style |
object | 可选 optional 定义样式的对象。 An object defining a style. |
示例: Examples:
tileset.style = new Cesium.Cesium3DTileStyle({
color : {
conditions : [
['${Height} >= 100', 'color("purple", 0.5)'],
['${Height} >= 50', 'color("red")'],
['true', 'color("blue")']
]
},
show : '${Height} > 0',
meta : {
description : '"Building id ${id} has height ${Height}."'
}
});
tileset.style = new Cesium.Cesium3DTileStyle({
color : 'vec4(${Temperature})',
pointSize : '${Temperature} * 2.0'
});
另见: See:
成员 Members
anchorLineColor : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's anchorLineColor 财产。或者,可以使用定义颜色样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a color style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Color.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override anchorLineColor expression with a string
style.anchorLineColor = 'color("blue")';
const style = new Cesium.Cesium3DTileStyle();
// Override anchorLineColor expression with a condition
style.anchorLineColor = {
conditions : [
['${height} > 2', 'color("cyan")'],
['true', 'color("blue")']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
anchorLineEnabled : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's anchorLineEnabled 财产。或者,可以使用定义布尔样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a boolean style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Boolean.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override anchorLineEnabled expression with a string
style.anchorLineEnabled = 'true';
const style = new Cesium.Cesium3DTileStyle();
// Override anchorLineEnabled expression with a condition
style.anchorLineEnabled = {
conditions : [
['${height} > 2', 'true'],
['true', 'false']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
backgroundColor : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's backgroundColor 财产。或者,可以使用定义颜色样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a color style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Color.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override backgroundColor expression with a string
style.backgroundColor = 'color("blue")';
const style = new Cesium.Cesium3DTileStyle();
// Override backgroundColor expression with a condition
style.backgroundColor = {
conditions : [
['${height} > 2', 'color("cyan")'],
['true', 'color("blue")']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
backgroundEnabled : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's backgroundEnabled 财产。或者,可以使用定义布尔样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a boolean style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Boolean.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override backgroundEnabled expression with a string
style.backgroundEnabled = 'true';
const style = new Cesium.Cesium3DTileStyle();
// Override backgroundEnabled expression with a condition
style.backgroundEnabled = {
conditions : [
['${height} > 2', 'true'],
['true', 'false']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
backgroundPadding : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's backgroundPadding 财产。或者,可以使用定义 vec2 样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a vec2 style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Cartesian2.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Example:
const style = new Cesium.Cesium3DTileStyle();
// Override backgroundPadding expression with a string
style.backgroundPadding = 'vec2(5.0, 7.0)';
style.backgroundPadding.evaluate(feature); // returns a Cartesian2
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's color 财产。或者,可以使用定义颜色样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a color style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Color.
此表达式适用于所有图块格式。 This expression is applicable to all tile formats.
示例: Examples:
const style = new Cesium3DTileStyle({
color : '(${Temperature} > 90) ? color("red") : color("white")'
});
style.color.evaluateColor(feature, result); // returns a Cesium.Color object
const style = new Cesium.Cesium3DTileStyle();
// Override color expression with a custom function
style.color = {
evaluateColor : function(feature, result) {
return Cesium.Color.clone(Cesium.Color.WHITE, result);
}
};
const style = new Cesium.Cesium3DTileStyle();
// Override color expression with a string
style.color = 'color("blue")';
const style = new Cesium.Cesium3DTileStyle();
// Override color expression with a condition
style.color = {
conditions : [
['${height} > 2', 'color("cyan")'],
['true', 'color("blue")']
]
};
disableDepthTestDistance : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's disableDepthTestDistance 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Number.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Example:
const style = new Cesium.Cesium3DTileStyle();
// Override disableDepthTestDistance expression with a string
style.disableDepthTestDistance = '1000.0';
style.disableDepthTestDistance.evaluate(feature); // returns a Number
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
distanceDisplayCondition : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's distanceDisplayCondition 财产。或者,可以使用定义 vec2 样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a vec2 style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Cartesian2.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Example:
const style = new Cesium.Cesium3DTileStyle();
// Override distanceDisplayCondition expression with a string
style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';
style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's font 财产。或者,可以使用定义字符串样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a string style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a String.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"'
});
style.font.evaluate(feature); // returns a String
const style = new Cesium.Cesium3DTileStyle();
// Override font expression with a custom function
style.font = {
evaluate : function(feature) {
return '24px Helvetica';
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
heightOffset : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's heightOffset 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Number.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override heightOffset expression with a string
style.heightOffset = '2.0';
const style = new Cesium.Cesium3DTileStyle();
// Override heightOffset expression with a condition
style.heightOffset = {
conditions : [
['${height} > 2', '4.0'],
['true', '2.0']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
horizontalOrigin : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's horizontalOrigin 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a HorizontalOrigin.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
horizontalOrigin : HorizontalOrigin.LEFT
});
style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
const style = new Cesium.Cesium3DTileStyle();
// Override horizontalOrigin expression with a custom function
style.horizontalOrigin = {
evaluate : function(feature) {
return HorizontalOrigin.CENTER;
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's image 财产。或者,可以使用定义字符串样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a string style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a String.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"'
});
style.image.evaluate(feature); // returns a String
const style = new Cesium.Cesium3DTileStyle();
// Override image expression with a custom function
style.image = {
evaluate : function(feature) {
return '/url/to/image';
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's labelColor 财产。或者,可以使用定义颜色样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a color style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Color.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override labelColor expression with a string
style.labelColor = 'color("blue")';
const style = new Cesium.Cesium3DTileStyle();
// Override labelColor expression with a condition
style.labelColor = {
conditions : [
['${height} > 2', 'color("cyan")'],
['true', 'color("blue")']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
labelHorizontalOrigin : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's labelHorizontalOrigin 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a HorizontalOrigin.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
labelHorizontalOrigin : HorizontalOrigin.LEFT
});
style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
const style = new Cesium.Cesium3DTileStyle();
// Override labelHorizontalOrigin expression with a custom function
style.labelHorizontalOrigin = {
evaluate : function(feature) {
return HorizontalOrigin.CENTER;
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
labelOutlineColor : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's labelOutlineColor 财产。或者,可以使用定义颜色样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a color style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Color.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override labelOutlineColor expression with a string
style.labelOutlineColor = 'color("blue")';
const style = new Cesium.Cesium3DTileStyle();
// Override labelOutlineColor expression with a condition
style.labelOutlineColor = {
conditions : [
['${height} > 2', 'color("cyan")'],
['true', 'color("blue")']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
labelOutlineWidth : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's labelOutlineWidth 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Number.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override labelOutlineWidth expression with a string
style.labelOutlineWidth = '5';
const style = new Cesium.Cesium3DTileStyle();
// Override labelOutlineWidth expression with a condition
style.labelOutlineWidth = {
conditions : [
['${height} > 2', '5'],
['true', '0']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's label style 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a LabelStyle.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
labelStyle : `(\${Temperature} > 90) ? ${LabelStyle.FILL_AND_OUTLINE} : ${LabelStyle.FILL}`
});
style.labelStyle.evaluate(feature); // returns a LabelStyle
const style = new Cesium.Cesium3DTileStyle();
// Override labelStyle expression with a custom function
style.labelStyle = {
evaluate : function(feature) {
return LabelStyle.FILL;
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's labelText 财产。或者,可以使用定义字符串样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a string style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a String.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
labelText : '(${Temperature} > 90) ? ">90" : "<=90"'
});
style.labelText.evaluate(feature); // returns a String
const style = new Cesium.Cesium3DTileStyle();
// Override labelText expression with a custom function
style.labelText = {
evaluate : function(feature) {
return 'Example label text';
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
labelVerticalOrigin : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's labelVerticalOrigin 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a VerticalOrigin.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
labelVerticalOrigin : VerticalOrigin.TOP
});
style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin
const style = new Cesium.Cesium3DTileStyle();
// Override labelVerticalOrigin expression with a custom function
style.labelVerticalOrigin = {
evaluate : function(feature) {
return VerticalOrigin.CENTER;
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
示例: Example:
const style = new Cesium3DTileStyle({
meta : {
description : '"Building id ${id} has height ${Height}."'
}
});
style.meta.description.evaluate(feature); // returns a String with the substituted variables
pointOutlineColor : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's pointOutlineColor 财产。或者,可以使用定义颜色样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a color style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Color.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override pointOutlineColor expression with a string
style.pointOutlineColor = 'color("blue")';
const style = new Cesium.Cesium3DTileStyle();
// Override pointOutlineColor expression with a condition
style.pointOutlineColor = {
conditions : [
['${height} > 2', 'color("cyan")'],
['true', 'color("blue")']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
pointOutlineWidth : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's pointOutlineWidth 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Number.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium.Cesium3DTileStyle();
// Override pointOutlineWidth expression with a string
style.pointOutlineWidth = '5';
const style = new Cesium.Cesium3DTileStyle();
// Override pointOutlineWidth expression with a condition
style.pointOutlineWidth = {
conditions : [
['${height} > 2', '5'],
['true', '0']
]
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's pointSize 财产。或者,可以使用定义磅值样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a point size style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Number.
此表达式仅适用于矢量切片或点云切片中的点要素。 This expression is only applicable to point features in a Vector tile or a Point Cloud tile.
示例: Examples:
const style = new Cesium3DTileStyle({
pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'
});
style.pointSize.evaluate(feature); // returns a Number
const style = new Cesium.Cesium3DTileStyle();
// Override pointSize expression with a custom function
style.pointSize = {
evaluate : function(feature) {
return 1.0;
}
};
const style = new Cesium.Cesium3DTileStyle();
// Override pointSize expression with a number
style.pointSize = 1.0;
const style = new Cesium.Cesium3DTileStyle();
// Override pointSize expression with a string
style.pointSize = '${height} / 10';
const style = new Cesium.Cesium3DTileStyle();
// Override pointSize expression with a condition
style.pointSize = {
conditions : [
['${height} > 2', '1.0'],
['true', '2.0']
]
};
scaleByDistance : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's scaleByDistance 财产。或者,可以使用定义 vec4 样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a vec4 style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Cartesian4.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Example:
const style = new Cesium.Cesium3DTileStyle();
// Override scaleByDistance expression with a string
style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';
style.scaleByDistance.evaluate(feature); // returns a Cartesian4
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
StyleExpression 用于评估样式的对象 object used to evaluate the style's show 财产。或者,可以使用定义显示样式的布尔值、字符串或对象。 getter 将返回内部 property. Alternatively a boolean, string, or object defining a show style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
表达式必须返回或转换为 The expression must return or convert to a Boolean.
此表达式适用于所有图块格式。 This expression is applicable to all tile formats.
示例: Examples:
const style = new Cesium3DTileStyle({
show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'
});
style.show.evaluate(feature); // returns true or false depending on the feature's properties
const style = new Cesium.Cesium3DTileStyle();
// Override show expression with a custom function
style.show = {
evaluate : function(feature) {
return true;
}
};
const style = new Cesium.Cesium3DTileStyle();
// Override show expression with a boolean
style.show = true;
};
const style = new Cesium.Cesium3DTileStyle();
// Override show expression with a string
style.show = '${Height} > 0';
};
const style = new Cesium.Cesium3DTileStyle();
// Override show expression with a condition
style.show = {
conditions: [
['${height} > 2', 'false'],
['true', 'true']
];
};
-
默认值: Default Value:
{}
translucencyByDistance : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's translucencyByDistance 财产。或者,可以使用定义 vec4 样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a vec4 style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a Cartesian4.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Example:
const style = new Cesium.Cesium3DTileStyle();
// Override translucencyByDistance expression with a string
style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';
style.translucencyByDistance.evaluate(feature); // returns a Cartesian4
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
verticalOrigin : StyleExpression
StyleExpression 用于评估样式的对象 object used to evaluate the style's verticalOrigin 财产。或者,可以使用定义数字样式的字符串或对象。 getter 将返回内部 property. Alternatively a string or object defining a number style can be used. The getter will return the internal Expression or ConditionsExpression,这可能与提供给设置者的值不同。 , which may differ from the value provided to the setter.
该表达式必须返回一个 The expression must return a VerticalOrigin.
此表达式仅适用于矢量切片中的点要素。 This expression is only applicable to point features in a Vector tile.
示例: Examples:
const style = new Cesium3DTileStyle({
verticalOrigin : VerticalOrigin.TOP
});
style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin
const style = new Cesium.Cesium3DTileStyle();
// Override verticalOrigin expression with a custom function
style.verticalOrigin = {
evaluate : function(feature) {
return VerticalOrigin.CENTER;
}
};
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
