ElementService
Cesium v1.147 · 中文

提供对模型中的实体及其元数据的访问。此类型 描述一个接口,不打算直接实例化。

abstract new Cesium.ElementService()

Experimental

This 该特性尚未最终确定,可能会根据 Cesium 的标准弃用政策进行更改。

See:

Methods

async aggregate(options) → Promise.<{aggregations: Array.<ElementService.Aggregation>, total: number}>

计算实体属性的聚合统计信息。
Name Type Description
options object 提供方特定的聚合选项。
Returns:
解析为聚合统计信息的承诺。

async getElement(elementId) → Promise.<ElementService.Element>

检索单个实体。
Name Type Description
elementId string 实体标识符。
Returns:
A 解析为该实体的承诺。

async getElementTreeChildren(options) → Promise.<{nodes: Array.<ElementService.ElementTreeNode>}>

列出元素树中节点的子节点。
Name Type Description
options object optional 提供方特定的树查询选项。
Returns:
解析为子节点的承诺。

async getElementTreeParents(elementId) → Promise.<{path: Array.<ElementService.ElementTreePathEntry>}>

从元素树的根节点检索到特定元素的路径。
Name Type Description
elementId string 实体标识符。
Returns:
一个承诺,指向根优先路径。

async listElements(options) → Promise.<ElementService.ElementPage>

可选地过滤后返回实体页面。
Name Type Description
options object optional 提供方特定的查询选项。
Returns:
A 解析为实体页面的承诺。

Type Definitions

Cesium.ElementService.Aggregation

实体属性的聚合统计信息。
Properties:
Name Type Attributes Description
propertyKey string <optional>
这些统计信息所描述的属性键。
count number 统计信息中包含的实体数量。
min number | null 最小值,如果无法获取则显示为 null。
max number | null 最大值,如果无法获取则显示为 null。
avg number | null 平均值,如果无法获取则显示为 null。
sum number 各值的总和。

Cesium.ElementService.Element

一个实体及其元数据。 实现可能包含额外的提供方特定字段。
Properties:
Name Type Attributes Description
id string 实体标识符。
label string <optional>
如果有的话,该实体的用户友好标签。
location ElementService.ElementLocation <optional>
该实体的地理位置,如果实体没有位置则显示为 undefined(例如概念性实体或没有地理坐标系统的资产)。

Cesium.ElementService.ElementLocation

ElementService.Element 的地理位置,当前存在 仅当该元素被定位后才会显示。
Properties:
Name Type Description
center object 该实体的中心位置。
Properties
Name Type Description
longitude number 经度,以度为单位。
latitude number 纬度,以度为单位。
height number 相对于椭球面的高度,以米为单位。
radius number 以米为单位的球体半径,该球体以 center 为中心并包围该元素。

Cesium.ElementService.ElementPage

由 ElementService#listElements 返回的实体页面。
Properties:
Name Type Description
items Array.<ElementService.Element> 该页面上的实体。
total number | null 匹配实体的总数,如果无法获取总数则显示为 null。

Cesium.ElementService.ElementTreeNode

元素树中的一个节点。
Properties:
Name Type Description
label string 该节点的用户友好标签。
hasChildren boolean 该节点是否有子节点。
id string 该节点所代表的实体的标识符。

Cesium.ElementService.ElementTreePathEntry

以根优先方式的元素树路径中的一条条目。
Properties:
Name Type Description
id string 该条目所代表的标识符。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.