ModelExperimental
.
Provides access to a feature's properties stored in the model's feature table.
Modifications to a ModelFeature
object have the lifetime of the model.
Do not construct this directly. Access it through picking using Scene#pick
.
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Object with the following properties:
|
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);
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.
Members
-
Default Value:
Color.WHITE
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 | The case-sensitive name of the property. |
Returns:
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 An array into which to store the results. |
Returns:
- 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 | The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata. |
Returns:
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 |
---|---|---|
results |
Array.<String> | optional An array into which to store the results. |
Returns:
Deprecated: true
Name | Type | Description |
---|---|---|
name |
String | The case-sensitive name of the property. |
Returns:
Name | Type | Description |
---|---|---|
name |
String | The case-sensitive name of the property. |
value |
* | The value of the property that will be copied. |
Returns:
true
if the property was set, false
otherwise.
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');
}