ShowGeometryInstanceAttribute

new Cesium.ShowGeometryInstanceAttribute(show)

Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
参数名称 类型 默认值 描述信息
show boolean true 可选 Determines if the geometry instance will be shown.
使用示例:
const instance = new Cesium.GeometryInstance({
  geometry : new Cesium.BoxGeometry({
    vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
    minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
    maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  }),
  modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
    Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  id : 'box',
  attributes : {
    show : new Cesium.ShowGeometryInstanceAttribute(false)
  }
});
参考:

成员(属性)

The datatype of each component in the attribute, e.g., individual elements in ColorGeometryInstanceAttribute#value.
默认值: ComponentDatatype.UNSIGNED_BYTE

readonly componentsPerAttribute : number

The number of components in the attributes, i.e., ColorGeometryInstanceAttribute#value.
默认值: 1
When true and componentDatatype is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
默认值: true
The values for the attributes stored in a typed array.
默认值: [1.0]

方法

static Cesium.ShowGeometryInstanceAttribute.toValue(show, result)Uint8Array

Converts a boolean show to a typed array that can be used to assign a show attribute.
参数名称 类型 描述信息
show boolean The show value.
result Uint8Array 可选 The array to store the result in, if undefined a new instance will be created.
返回值:
The modified result parameter or a new instance if result was undefined.
使用示例:
const attributes = primitive.getGeometryInstanceAttributes('an id');
attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);