Cesium3DTileset.
提供对存储在图块批处理表中的要素属性的访问,以及显示/隐藏要素和更改其点属性的能力 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 point properties
修改为 Modifications to a Cesium3DTilePointFeature 对象具有图块内容的生命周期。如果图块的内容被卸载,例如,由于它超出了视图范围并且需要在缓存中释放可见图块的空间,请收听 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 Cesium3DTileset#tileUnload 事件来保存任何修改。还听听 event to save any modifications. Also listen to the Cesium3DTileset#tileVisible 重新应用任何修改的事件。 event to reapply any modifications.
不要直接构建它。通过访问它 Do not construct this directly. Access it through Cesium3DTileContent#getFeature
或使用采摘 or picking using Scene#pick and Scene#pickPosition.
示例: 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.Cesium3DTilePointFeature) {
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);
实验性 Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 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
anchorLineColor : Color
仅适用于以下情况 Only applied when heightOffset 被定义。 is defined.
仅适用于以下情况 Only applied when heightOffset 被定义。 is defined.
backgroundColor : Color
仅适用于以下情况 Only applied when labelText 被定义。 is defined.
仅适用于以下情况 Only applied when labelText 被定义。 is defined.
backgroundPadding : Cartesian2
仅适用于以下情况 Only applied when labelText 被定义。 is defined.
仅适用于以下情况 Only applied when image is undefined.
distanceDisplayCondition : DistanceDisplayCondition
仅适用于当 Only applied when the labelText 被定义。 is defined.
horizontalOrigin : HorizontalOrigin
labelColor : Color
如果满足以下条件,颜色将应用于标签: The color will be applied to the label if labelText 被定义。 is defined.
labelHorizontalOrigin : HorizontalOrigin
labelOutlineColor : Color
如果出现以下情况,轮廓颜色将应用于标签: The outline color will be applied to the label if labelText 被定义。 is defined.
轮廓宽度将应用于该点,如果 The outline width will be applied to the point if labelText 被定义。 is defined.
仅适用于以下情况 Only applied when labelText 被定义。 is defined.
labelVerticalOrigin : VerticalOrigin
pointOutlineColor : Color
仅适用于以下情况 Only applied when image is undefined.
仅适用于以下情况 Only applied when image is undefined.
仅适用于以下情况 Only applied when image is undefined.
readonly primitive : Cesium3DTileset
Scene#pick 有一个 have a primitive 财产。这将返回包含该要素的图块集。 property. This returns the tileset containing the feature.
scaleByDistance : NearFarScalar
-
默认值: Default Value:
true
readonly tileset : Cesium3DTileset
translucencyByDistance : NearFarScalar
verticalOrigin : VerticalOrigin
方法 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)}`);
}
另见: See:
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
results |
Array.<string> | 可选 optional 用于存储结果的数组。 An array into which to store the results. |
返回: 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');
}
