成员(属性)
readonly dataSourceAdded : Event
An event that is raised when a data source is added to the collection.
Event handlers are passed the data source that was added.
readonly dataSourceMoved : Event
An event that is raised when a data source changes position in the collection. Event handlers are passed the data source
that was moved, its new index after the move, and its old index prior to the move.
readonly dataSourceRemoved : Event
An event that is raised when a data source is removed from the collection.
Event handlers are passed the data source that was removed.
Gets the number of data sources in this collection.
方法
add(dataSource) → Promise.<DataSource>
Adds a data source to the collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
dataSource |
DataSource | Promise.<DataSource> | A data source or a promise to a data source to add to the collection. When passing a promise, the data source will not actually be added to the collection until the promise resolves successfully. |
返回值:
A Promise that resolves once the data source has been added to the collection.
Checks to see if the collection contains a given data source.
参数名称 | 类型 | 描述信息 |
---|---|---|
dataSource |
DataSource | The data source to check for. |
返回值:
true if the collection contains the data source, false otherwise.
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.
使用示例:
dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
参考:
Gets a data source by index from the collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
index |
number | the index to retrieve. |
返回值:
The data source at the specified index.
getByName(name) → Array.<DataSource>
Gets a data source by name from the collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
name |
string | The name to retrieve. |
返回值:
A list of all data sources matching the provided name.
Determines the index of a given data source in the collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
dataSource |
DataSource | The data source to find the index of. |
返回值:
The index of the data source in the collection, or -1 if the data source does not exist in the collection.
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.
返回值:
true if this object was destroyed; otherwise, false.
Lowers a data source down one position in the collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
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.
参数名称 | 类型 | 描述信息 |
---|---|---|
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.
参数名称 | 类型 | 描述信息 |
---|---|---|
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.
参数名称 | 类型 | 描述信息 |
---|---|---|
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.
Removes a data source from this collection, if present.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
dataSource |
DataSource | The data source to remove. | |
destroy |
boolean |
false
|
可选 Whether to destroy the data source in addition to removing it. |
返回值:
true if the data source was in the collection and was removed,
false if the data source was not in the collection.
Removes all data sources from this collection.
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
destroy |
boolean |
false
|
可选 whether to destroy the data sources in addition to removing them. |