应用于
Cesium3DTileset
的样式。
计算使用3D Tiles Styling language定义的表达式。
Name | Type | Description |
---|---|---|
style |
String | Object | optional 样式或定义样式的对象的 url。 |
Examples:
tileset.style = new SuperMap3D.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 SuperMap3D.Cesium3DTileStyle({
color : 'vec4(${Temperature})',
pointSize : '${Temperature} * 2.0'
});
See:
Members
-
color : StyleExpression
-
Examples:
var style = new Cesium3DTileStyle({ color : '(${Temperature} > 90) ? color("red") : color("white")' }); style.color.evaluateColor(frameState, feature, result); // returns a SuperMap3D.Color object
var style = new SuperMap3D.Cesium3DTileStyle(); // Override color expression with a custom function style.color = { evaluateColor : function(frameState, feature, result) { return SuperMap3D.Color.clone(SuperMap3D.Color.WHITE, result); } };
-
X轴方向上的重复贴图次数。
-
Y轴方向上的重复贴图次数。
-
meta : StyleExpression
-
获取或设置包含特定于应用程序的表达式的对象,这些表达式可以显式求值,例如在用户界面中显示。
Example:
var style = new Cesium3DTileStyle({ meta : { description : '"Building id ${id} has height ${Height}."' } }); style.meta.description.evaluate(frameState, feature); // returns a String with the substituted variables
-
设置PBR材质。
Example:
var urls=[ '1.json' '2.json' '3.json' ]; layer.themeStyle=new Cesium3DTileStyle({ pbrMaterialIndex:{ conditions:conditions } })
-
pointSize : StyleExpression
-
获取或设置用于求值样式pointSize属性的
StyleExpression
对象,该表达式必须返回或可转换为 数值类型(Number)。Examples:
var style = new Cesium3DTileStyle({ pointSize : '(${Temperature} > 90) ? 2.0 : 1.0' }); style.pointSize.evaluate(frameState, feature); // returns a Number
var style = new SuperMap3D.Cesium3DTileStyle(); // Override pointSize expression with a custom function style.pointSize = { evaluate : function(frameState, feature) { return 1.0; } };
-
当该值为 true 时,样式已就绪,其表达式可被求值。若样式是通过对象(而非 URL)构造的,则该值会立即变为 true。
-
Default Value:
false
-
readonlyreadyPromise : Promise.<Cesium3DTileStyle>
-
获取一个Promise,该Promise将在样式准备就绪且其表达式可被求值时得到解析。
-
show : StyleExpression
-
获取或设置用于
StyleExpression
属性的show
对象,该表达式必须返回或可转换为Boolean类型。Examples:
var style = new Cesium3DTileStyle({ show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)' }); style.show.evaluate(frameState, feature); // returns true or false depending on the feature's properties
var style = new SuperMap3D.Cesium3DTileStyle(); // Override show expression with a custom function style.show = { evaluate : function(frameState, feature) { return true; } };
-
-
Default Value:
undefined