CompositeEntityCollection

new Cesium.CompositeEntityCollection(collections, owner)

非破坏性地将多个EntityCollection实例组合到一个集合中。 如果多个集合中存在具有相同ID的实体,则该实体是非破坏性的 合并到一个新的实体实例中。如果一个实体在多个 集合中,实体的属性在列表的最后一个集合中吗 已使用属于。CompositeEntityCollection几乎可以在 使用了EntityCollection。
Name Type Description
collections Array.<EntityCollection> optional 要合并的EntityCollection实例的初始列表。
owner DataSource | CompositeEntityCollection optional 创建此集合的数据源(或复合实体集合)。

Members

获取在从集合中添加或删除实体时激发的事件。 生成的事件是EntityCollection.collectionChangedEventCallback
获取此集合的全局唯一标识符。
获取此复合实体集合的所有者,即创建它的数据源或复合实体集合。
获取集合中实体实例的数组。 不应直接修改此数组。

Methods

addCollection(collection, index)

将集合添加到组合中。
Name Type Description
collection EntityCollection 要添加的集合。
index Number optional 要在处添加集合的索引。如果省略,则集合将 添加到所有现有集合之上。
Throws:
  • DeveloperError :索引(如果提供)必须大于或等于零且小于或等于集合数。
计算集合中实体的最大可用性。 如果集合包含无限可用数据和非无限数据的混合, 它只返回与非无限数据相关的间隔。如果全部 数据是无限的,将返回无限的间隔。
Returns:
集合中实体的可用性。

contains(entity)Boolean

如果提供的实体在此集合中,则返回true,否则返回false。
Name Type Description
entity Entity 实体。
Returns:
如果提供的实体在此集合中,则为true,否则为false。

containsCollection(collection)Boolean

检查复合是否包含给定集合。
Name Type Description
collection EntityCollection 要检查的集合。
Returns:
如果复合包含集合,则为true,否则为false。
获取具有指定id的实体。
Name Type Description
id String 要检索的实体的id。
Returns:
具有提供的id或未定义的实体(如果集合中不存在该id)。
从组合中按索引获取集合。
Name Type Description
index Number 要检索的索引。
获取此复合中的集合数。

indexOfCollection(collection)Number

确定组合中给定集合的索引。
Name Type Description
collection EntityCollection 要查找其索引的集合。
Returns:
组合中集合的索引,如果组合中不存在集合,则为-1。

lowerCollection(collection)

将集合降低到复合中的一个位置。
Name Type Description
collection EntityCollection 要移动的集合。
Throws:

lowerCollectionToBottom(collection)

将集合降低到组合的底部。
Name Type Description
collection EntityCollection 要移动的集合。
Throws:

raiseCollection(collection)

将集合在复合中向上提升一个位置。
Name Type Description
collection EntityCollection 要移动的集合。
Throws:

raiseCollectionToTop(collection)

将集合提升到组合的顶部。
Name Type Description
collection EntityCollection 要移动的集合。
Throws:
从此复合中删除所有集合。

removeCollection(collection)Boolean

从此复合中移除集合(如果存在)。
Name Type Description
collection EntityCollection 要删除的集合。
Returns:
如果集合在复合中并被移除, 如果集合不在复合中,则为false。
继续立即引发EntityCollection#collectionChanged个事件 添加或删除项目时。暂停事件时所做的任何修改 将在调用此函数时作为单个事件触发。此功能还可确保 如果事件也被恢复,则重新组合集合。 这个函数是引用计数的,可以安全地调用多次 是EntityCollection#resumeEvents的对应电话。
Throws:
防止引发EntityCollection#collectionChanged事件 直到拨打EntityCollection#resumeEvents,在 点将引发一个覆盖所有挂起操作的事件。 这样可以有效地添加和删除许多项。 当事件被挂起时,重新组合集合将 也要暂停,因为这可能是一个昂贵的行动。 这个函数可以安全地调用多次,只要 是对EntityCollection#resumeEvents的相应呼叫。