A feature of a
Model.
提供对存储在模型特性表中的特性的访问.
对 NT 0 ModelFeature NT 1 对象的修改具有该模型的寿命.
Do not construct this directly. Access it through picking using Scene#pick.
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
下列属性的对象 :
|
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.ModelFeature) {
console.log(feature);
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
Members
color : Color
获取或设置突出颜色与特征的颜色乘以. 何时
这是白色的, 特性的颜色没有改变 。 此设定为所有特性
当评价样式的颜色时.
-
Default Value:
Color.WHITE
获取与此功能相关的特性 ID 。 3D 梯子 1.0
批量ID已返回。 对于 EXT mesh features,这是来自
选中的特性 ID 设置.
Experimental
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.
如果显示特性, 则获取或设定 。 此设定为所有特性
当一个风格的节目被评价时.
-
Default Value:
true
Methods
返回带有指定名称的特性属性值的副本.
| Name | Type | Description |
|---|---|---|
name |
string | 财产的大小写名称. |
Returns:
The value of the property or
undefined if the feature does not have this property.
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));
}
返回特性的属性标识组.
| Name | Type | Description |
|---|---|---|
results |
Array.<string> | optional 存储结果的数组 . |
Returns:
特征属性的ID.
返回带有指定名称的特性财产副本,检查所有
从 EXT 结构 元数据与遗留的 EXT feature 元数据 glTF 中的元数据
扩展。 元数据从最具体的名称到大多数名称
将军和第一次比赛归来。 元数据按此顺序检查 :
- structural metadata property by semantic
- structural metadata property by property ID
See the EXT_structural_metadata Extension as well as the previous EXT_feature_metadata Extension for glTF.
| Name | Type | Description |
|---|---|---|
name |
string | 特征的语义或属性ID. 语义在元数据每个颗粒的属性标识前都要检查. |
Returns:
The value of the property or
undefined if the feature does not have this property.
Experimental
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.
返回特性是否包含此属性 .
| Name | Type | Description |
|---|---|---|
name |
string | 财产的大小写名称. |
Returns:
特性是否包含此属性 .
设置特性属性与给定名称的值.
| Name | Type | Description |
|---|---|---|
name |
string | 财产的大小写名称. |
value |
* | 将复制的属性的值 . |
Returns:
如果设定了产权, 则使用 & NT 0 true NT 1 , 否则使用 & NT 2 false NT 3 .
Throws:
-
DeveloperError : Inherited batch table hierarchy property is read only.
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');
}