DataSourceCollection

A collection of DataSource instances.

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

An event that is raised when a data source is added to the collection. Event handlers are passed the data source that was added.

Link copied to clipboard

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.

Link copied to clipboard

An event that is raised when a data source is removed from the collection. Event handlers are passed the data source that was removed.

Link copied to clipboard
val length: Int

Gets the number of data sources in this collection.

Functions

Link copied to clipboard
suspend fun add(dataSource: DataSource): DataSource

Adds a data source to the collection.

suspend fun add(dataSource: Promise<DataSource>): DataSource
Link copied to clipboard
Link copied to clipboard
fun contains(dataSource: DataSource): Boolean

Checks to see if the collection contains a given data source.

Link copied to clipboard
fun destroy()

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.

Link copied to clipboard
operator fun get(index: Int): DataSource

Gets a data source by index from the collection.

Link copied to clipboard

Gets a data source by name from the collection.

Link copied to clipboard
fun indexOf(dataSource: DataSource): Int

Determines the index of a given data source in the collection.

Link copied to clipboard

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.

Link copied to clipboard
fun lower(dataSource: DataSource)

Lowers a data source down one position in the collection.

Link copied to clipboard
fun lowerToBottom(dataSource: DataSource)

Lowers a data source to the bottom of the collection.

Link copied to clipboard
fun raise(dataSource: DataSource)

Raises a data source up one position in the collection.

Link copied to clipboard
fun raiseToTop(dataSource: DataSource)

Raises a data source to the top of the collection.

Link copied to clipboard
fun remove(dataSource: DataSource, destroy: Boolean? = definedExternally): Boolean

Removes a data source from this collection, if present.

Link copied to clipboard
fun removeAll(destroy: Boolean? = definedExternally)

Removes all data sources from this collection.