Cesium3DTileset 的一个点特征。
提供对存储在瓦片的批处理表中的特征属性的访问,以及显示/隐藏特征和更改其点属性的能力。
对 Cesium3DTilePointFeature 对象的修改具有瓦片内容的生命周期。如果瓦片的内容被卸载,例如,由于它超出视野并需要
在缓存中释放空间以容纳可见的瓦片,请监听 Cesium3DTileset#tileUnload 事件以保存任何
修改。同时监听 Cesium3DTileset#tileVisible 事件以重新应用任何修改。
不要直接构造此对象。请通过 Cesium3DTileContent#getFeature
或使用 Scene#pick 和 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标准弃用政策的情况下发生更改。
Members
anchorLineColor : Color
仅在定义了 heightOffset 时应用。
仅在定义了 heightOffset 时应用。
backgroundColor : Color
仅在定义了 labelText 时应用。
仅在定义了 labelText 时应用。
backgroundPadding : Cartesian2
仅在定义了 labelText 时应用。
仅在 image 为 undefined 时应用。
distanceDisplayCondition : DistanceDisplayCondition
仅在定义了 labelText 时应用。
horizontalOrigin : HorizontalOrigin
labelColor : Color
如果 labelText 被定义,则该颜色将应用于标签。
labelHorizontalOrigin : HorizontalOrigin
labelOutlineColor : Color
如果 labelText 被定义,则轮廓颜色将应用于标签。
如果 labelText 被定义,则轮廓宽度将应用于该点。
仅在定义了 labelText 时应用。
labelVerticalOrigin : VerticalOrigin
pointOutlineColor : Color
仅在 image 为 undefined 时应用。
仅在 image 为 undefined 时应用。
仅在 image 为 undefined 时应用。
readonly primitive : Cesium3DTileset
Scene#pick 返回的对象都有一个 primitive 属性。该属性返回
包含该特征的瓦片集。
scaleByDistance : NearFarScalar
-
Default Value:
true
readonly tileset : Cesium3DTileset
translucencyByDistance : NearFarScalar
verticalOrigin : VerticalOrigin
Methods
| 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:
| Name | Type | Description |
|---|---|---|
results |
Array.<string> | optional 存储结果的数组。 |
Returns:
| 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');
}
