FreedoPModelset
.
Provides access to a feature's properties stored in the tile's batch table, as well
as the ability to show/hide a feature and change its highlight color via
FreedoPModelFeature#show
and FreedoPModelFeature#color
, respectively.
Modifications to a FreedoPModelFeature
object have the lifetime of the tile's
content. If the tile's content is unloaded, e.g., due to it going out of view and needing
to free space in the cache for visible tiles, listen to the FreedoPModelset#tileUnload
event to save any
modifications. Also listen to the FreedoPModelset#tileVisible
event to reapply any modifications.
Do not construct this directly. Access it through FreedoPModelContent#getFeature
or picking using Scene#pick
.
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 Freedo.FreedoPModelFeature) {
const propertyNames = feature.getPropertyNames();
const length = propertyNames.length;
for (let i = 0; i < length; ++i) {
const propertyName = propertyNames[i];
console.log(propertyName + ': ' + feature.getProperty(propertyName));
}
}
}, Freedo.ScreenSpaceEventType.MOUSE_MOVE);
Members
color : Color
-
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 Freedo's standard deprecation policy.
FreedoPModelset#vectorKeepDecodedPositions
is false
or the feature is not a polyline in a vector tile.
Experimental
This feature is using part of the 3D Tiles spec that is not final and is subject to change without Freedo's standard deprecation policy.
readonly primitive : FreedoPModelset
Scene#pick
have a primitive
property. This returns
the tileset containing the feature.
-
Default Value:
true
readonly tileset : FreedoPModelset
Methods
- Batch table (feature metadata) property by semantic
- Batch table (feature metadata) property by property ID
- Tile metadata property by semantic
- Tile metadata property by property ID
- Group metadata property by semantic
- Group metadata property by property ID
- Tileset metadata property by semantic
- Tileset metadata property by property ID
- Otherwise, return undefined
For 3D Tiles Next details, see the 3DTILES_metadata Extension for 3D Tiles, as well as the EXT_mesh_features Extension for glTF. For the legacy glTF extension, see EXT_feature_metadata Extension
Name | Type | Description |
---|---|---|
content |
FreedoPModelContent | The content for accessing the metadata |
batchId |
Number | The batch ID (or feature ID) of the feature to get a property for |
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 Freedo's standard deprecation policy.
Name | Type | Description |
---|---|---|
attributeName |
String | 需要取的属性的名称 |
results |
Array.<String> | 返回的属性值的数组 |
Returns:
Example:
// Display all the properties for a feature in the console log.
var components = feature.getAncestors('component');
var length = components.length;
for (var i = 0; i < length; ++i) {
var componentValue = components[i];
}
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 propertyNames = feature.getPropertyNames();
const length = propertyNames.length;
for (let i = 0; i < length; ++i) {
const propertyName = propertyNames[i];
console.log(propertyName + ': ' + feature.getProperty(propertyName));
}
See:
Name | Type | Description |
---|---|---|
results |
Array.<String> | optional An array into which to store the results. |
Returns:
Name | Type | Description |
---|---|---|
attributeName |
String | 需要判断的属性名,例如 'component' |
attributeValue |
String | 需要判断的属性值 |
Returns:
Name | Type | Description |
---|---|---|
name |
String | The case-sensitive name of the property. |
Returns:
If a property with the given name doesn't exist, it is created.
Name | Type | Description |
---|---|---|
name |
String | The case-sensitive name of the property. |
value |
* | The value of the property that will be copied. |
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');
}