| Name | Type | Description |
|---|---|---|
content |
Cesium3DTileContent | |
batchId |
number |
Example:
// On mouse over, display all the properties for a feature in the console log.
handler.setInputAction(function(movement) {
const feature = scene.pick(movement.endPosition);
if (feature instanceof Cesium.Cesium3DTileFeature) {
const propertyIds = feature.getPropertyIds();
const length = propertyIds.length;
for (let i = 0; i < length; ++i) {
const propertyId = propertyIds[i];
console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
Members
获取或设置与此要素颜色相乘的高亮颜色。当为白色时,要素颜色不会改变。当评估样式的颜色时,会为所有要素设置此属性。
-
Default Value:
Color.WHITE
获取与此要素关联的要素 ID。对于 3D Tiles 1.0,返回批量 ID。对于 EXT_mesh_features,这是来自所选要素 ID 集的要素 ID。
Experimental
此功能使用的 3D Tiles 规范部分尚未最终确定,可能在不遵循 Cesium 标准弃用策略的情况下发生变更。
获取包含折线 ECEF 位置的类型化数组。如果
Cesium3DTileset#vectorKeepDecodedPositions 为 false,或者该要素不是矢量切片中的折线,则返回 undefined。
Experimental
此功能使用的 3D Tiles 规范部分尚未最终确定,可能在不遵循 Cesium 标准弃用策略的情况下发生变更。
readonly primitive : Cesium3DTileset
由
Scene#pick 返回的所有对象都有一个 primitive 属性。此属性返回包含该要素的切片集。
获取或设置是否显示此要素。当评估样式的 show 时,会为所有要素设置此属性。
-
Default Value:
true
readonly tileset : Cesium3DTileset
获取包含此要素的切片集。
Methods
返回具有给定名称的要素属性的副本,检查 3D Tiles 1.0 格式、EXT_structural_metadata 和旧版 EXT_feature_metadata glTF 扩展中的所有元数据,以及切片集 JSON(3D Tiles 1.1)或 3DTILES_metadata 3D Tiles 扩展中存在的元数据。元数据按从最具体到最一般的顺序根据名称检查,并返回第一个匹配项。元数据按以下顺序检查:
- 按语义的批量表(结构化元数据)属性
- 按属性 ID 的批量表(结构化元数据)属性
- 按语义的内容元数据属性
- 按属性的内容元数据属性
- 按语义的切片元数据属性
- 按属性 ID 的切片元数据属性
- 按语义的子树元数据属性
- 按属性 ID 的子树元数据属性
- 按语义的组元数据属性
- 按属性 ID 的组元数据属性
- 按语义的切片集元数据属性
- 按属性 ID 的切片集元数据属性
- 否则,返回 undefined
有关 3D Tiles Next 的详细信息,请参阅 3D Tiles 的 3DTILES_metadata 扩展,以及 glTF 的 EXT_structural_metadata 扩展。有关旧版 glTF 扩展,请参阅 EXT_feature_metadata 扩展
| Name | Type | Description |
|---|---|---|
content |
Cesium3DTileContent | 用于访问元数据的内容 |
batchId |
number | 要获取属性的要素的批量 ID(或要素 ID) |
name |
string | 要素的语义或属性 ID。在每级元数据中,先检查语义,再检查属性 ID。 |
Returns:
属性值,如果要素没有此属性,则为
undefined。
Experimental
此功能使用的 3D Tiles 规范部分尚未最终确定,可能在不遵循 Cesium 标准弃用策略的情况下发生变更。
返回具有给定名称的要素属性值的副本。这包括使用批量表层次结构时来自此要素类和继承类的属性。
| Name | Type | Description |
|---|---|---|
name |
string | 属性的区分大小写的名称。 |
Returns:
属性值,如果要素没有此属性,则为
undefined。
Example:
// Display all the properties for a feature in the console log.
const propertyIds = feature.getPropertyIds();
const length = propertyIds.length;
for (let i = 0; i < length; ++i) {
const propertyId = propertyIds[i];
console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);
}
See:
返回此要素的属性 ID 数组。这包括使用批量表层次结构时来自此要素类和继承类的属性。
| Name | Type | Description |
|---|---|---|
results |
Array.<string> | optional 用于存储结果的数组。 |
Returns:
要素属性的 ID。
返回此要素是否包含该属性。这包括使用批量表层次结构时来自此要素类和继承类的属性。
| Name | Type | Description |
|---|---|---|
name |
string | 属性的区分大小写的名称。 |
Returns:
此要素是否包含该属性。
设置具有给定名称的要素属性的值。
如果具有给定名称的属性不存在,则会创建它。
| Name | Type | Description |
|---|---|---|
name |
string | 属性的区分大小写的名称。 |
value |
* | 将被复制的属性值。 |
Throws:
-
DeveloperError : 继承的批量表层次结构属性是只读的。
Examples:
const height = feature.getProperty('Height'); // e.g., the height of a building
const name = 'clicked';
if (feature.getProperty(name)) {
console.log('already clicked');
} else {
feature.setProperty(name, true);
console.log('first click');
}
