Members
readonly dataSourceAdded : Event
当数据源被添加到集合时引发的事件。
事件处理程序会接收到被添加的数据源。
readonly dataSourceMoved : Event
当数据源在集合中改变位置时引发的事件。事件处理程序会接收到
被移动的数据源、移动后的新索引以及移动前的旧索引。
readonly dataSourceRemoved : Event
当数据源从集合中移除时引发的事件。
事件处理程序会接收到被移除的数据源。
获取此集合中数据源的数量。
Methods
add(dataSource) → Promise.<DataSource>
将数据源添加到集合中。
| Name | Type | Description |
|---|---|---|
dataSource |
DataSource | Promise.<DataSource> | 要添加到集合中的数据源或数据源 Promise。 当传递 Promise 时,数据源在 Promise 成功解析后才会 实际添加到集合中。 |
Returns:
一旦数据源被添加到集合中就解析的 Promise。
检查集合是否包含给定的数据源。
| Name | Type | Description |
|---|---|---|
dataSource |
DataSource | 要检查的数据源。 |
Returns:
如果集合包含该数据源则返回 true,否则返回 false。
Destroys the resources held by all data sources in this collection. Explicitly destroying this
object allows for deterministic release of WebGL resources, instead of relying on the garbage
collector. Once this object is destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception. Therefore,
assign the return value (undefined) to the object as done in the example.
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
See:
通过索引从集合中获取数据源。
| Name | Type | Description |
|---|---|---|
index |
number | 要检索的索引。 |
Returns:
指定索引处的数据源。
getByName(name) → Array.<DataSource>
通过名称从集合中获取数据源。
| Name | Type | Description |
|---|---|---|
name |
string | 要检索的名称。 |
Returns:
所有匹配提供名称的数据源列表。
确定给定数据源在集合中的索引。
| Name | Type | Description |
|---|---|---|
dataSource |
DataSource | 要查找索引的数据源。 |
Returns:
数据源在集合中的索引,如果数据源不存在于集合中则返回 -1。
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception.
Returns:
true if this object was destroyed; otherwise, false.
Lowers a data source down one position in the collection.
| Name | Type | Description |
|---|---|---|
dataSource |
DataSource | The data source to move. |
Throws:
-
DeveloperError : dataSource is not in this collection.
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Lowers a data source to the bottom of the collection.
| Name | Type | Description |
|---|---|---|
dataSource |
DataSource | The data source to move. |
Throws:
-
DeveloperError : dataSource is not in this collection.
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Raises a data source up one position in the collection.
| Name | Type | Description |
|---|---|---|
dataSource |
DataSource | The data source to move. |
Throws:
-
DeveloperError : dataSource is not in this collection.
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Raises a data source to the top of the collection.
| Name | Type | Description |
|---|---|---|
dataSource |
DataSource | The data source to move. |
Throws:
-
DeveloperError : dataSource is not in this collection.
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
如果数据源存在于集合中,则从集合中移除它。
| Name | Type | Default | Description |
|---|---|---|---|
dataSource |
DataSource | 要移除的数据源。 | |
destroy |
boolean |
false
|
optional 除移除外是否还要销毁数据源。 |
Returns:
如果数据源在集合中并被移除则返回 true,
如果数据源不在集合中则返回 false。
从此集合中移除所有数据源。
| Name | Type | Default | Description |
|---|---|---|---|
destroy |
boolean |
false
|
optional 除移除外是否还要销毁数据源。 |
