main.cesium.CzmlDataSource.kt Maven / Gradle / Ivy
The newest version!
// Automatically generated - do not modify!
@file:JsModule("cesium")
@file:Suppress(
"EXTERNAL_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER",
)
package cesium
/**
* A [DataSource] which processes [CZML](https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide).
* @see Online Documentation
*
* @constructor
* @property [name] An optional name for the data source. This value will be overwritten if a loaded document contains a name.
* @see Online Documentation
*/
external class CzmlDataSource(var name: String = definedExternally) {
/**
* Gets the clock settings defined by the loaded CZML. If no clock is explicitly
* defined in the CZML, the combined availability of all objects is returned. If
* only static data exists, this value is undefined.
* @see Online Documentation
*/
var clock: DataSourceClock
/**
* Gets the collection of [Entity] instances.
* @see Online Documentation
*/
var entities: EntityCollection
/**
* Gets a value indicating if the data source is currently loading data.
* @see Online Documentation
*/
var isLoading: Boolean
/**
* Gets an event that will be raised when the underlying data changes.
* @see Online Documentation
*/
var changedEvent: Event
/**
* Gets an event that will be raised if an error is encountered during processing.
* @see Online Documentation
*/
var errorEvent: Event
/**
* Gets an event that will be raised when the data source either starts or stops loading.
* @see Online Documentation
*/
var loadingEvent: Event
/**
* Gets whether or not this data source should be displayed.
* @see Online Documentation
*/
var show: Boolean
/**
* Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
* @see Online Documentation
*/
var clustering: EntityCluster
/**
* Gets the credit that will be displayed for the data source
* @see Online Documentation
*/
var credit: Credit
/**
* Processes the provided url or CZML object without clearing any existing data.
* @param [czml] A url or CZML object to be processed.
* @return A promise that resolves to this instances once the data is processed.
* @see Online Documentation
*/
fun process(
czml: Resource,
options: ProcessOptions? = definedExternally,
): kotlin.js.Promise
/**
* @property [sourceUri] Overrides the url to use for resolving relative links.
*/
interface ProcessOptions {
var sourceUri: String?
}
fun process(
czml: String,
options: ProcessOptions? = definedExternally,
): kotlin.js.Promise
fun process(
czml: Any,
options: ProcessOptions? = definedExternally,
): kotlin.js.Promise
/**
* Loads the provided url or CZML object, replacing any existing data.
* @param [czml] A url or CZML object to be processed.
* @param [options] An object specifying configuration options
* @return A promise that resolves to this instances once the data is processed.
* @see Online Documentation
*/
fun load(
czml: Resource,
options: LoadOptions? = definedExternally,
): kotlin.js.Promise
fun load(
czml: String,
options: LoadOptions? = definedExternally,
): kotlin.js.Promise
fun load(
czml: Any,
options: LoadOptions? = definedExternally,
): kotlin.js.Promise
/**
* Updates the data source to the provided time. This function is optional and
* is not required to be implemented. It is provided for data sources which
* retrieve data based on the current animation time or scene state.
* If implemented, update will be called by [DataSourceDisplay] once a frame.
* @param [time] The simulation time.
* @return True if this data source is ready to be displayed at the provided time, false otherwise.
* @see Online Documentation
*/
fun update(time: JulianDate): Boolean
companion object {
/**
* Creates a Promise to a new instance loaded with the provided CZML data.
* @param [czml] A url or CZML object to be processed.
* @param [options] An object specifying configuration options
* @return A promise that resolves to the new instance once the data is processed.
* @see Online Documentation
*/
fun load(
czml: Resource,
options: LoadOptions? = definedExternally,
): kotlin.js.Promise
fun load(
czml: String,
options: LoadOptions? = definedExternally,
): kotlin.js.Promise
fun load(
czml: Any,
options: LoadOptions? = definedExternally,
): kotlin.js.Promise
/**
* Gets the array of CZML processing functions.
* @see Online Documentation
*/
var updaters: Array
/**
* A helper function used by custom CZML updater functions
* which creates or updates a [Property] from a CZML packet.
* @param [type] The constructor function for the property being processed.
* @param [object] The object on which the property will be added or updated.
* @param [propertyName] The name of the property on the object.
* @param [packetData] The CZML packet being processed.
* @param [interval] A constraining interval for which the data is valid.
* @param [sourceUri] The originating uri of the data being processed.
* @param [entityCollection] The collection being processsed.
* @see Online Documentation
*/
fun processPacketData(
type: Function<*>,
obj: Any,
propertyName: String,
packetData: Any,
interval: TimeInterval,
sourceUri: String,
entityCollection: EntityCollection,
)
/**
* A helper function used by custom CZML updater functions
* which creates or updates a [PositionProperty] from a CZML packet.
* @param [object] The object on which the property will be added or updated.
* @param [propertyName] The name of the property on the object.
* @param [packetData] The CZML packet being processed.
* @param [interval] A constraining interval for which the data is valid.
* @param [sourceUri] The originating uri of the data being processed.
* @param [entityCollection] The collection being processsed.
* @see Online Documentation
*/
fun processPositionPacketData(
obj: Any,
propertyName: String,
packetData: Any,
interval: TimeInterval,
sourceUri: String,
entityCollection: EntityCollection,
)
/**
* A helper function used by custom CZML updater functions
* which creates or updates a [MaterialProperty] from a CZML packet.
* @param [object] The object on which the property will be added or updated.
* @param [propertyName] The name of the property on the object.
* @param [packetData] The CZML packet being processed.
* @param [interval] A constraining interval for which the data is valid.
* @param [sourceUri] The originating uri of the data being processed.
* @param [entityCollection] The collection being processsed.
* @see Online Documentation
*/
fun processMaterialPacketData(
obj: Any,
propertyName: String,
packetData: Any,
interval: TimeInterval,
sourceUri: String,
entityCollection: EntityCollection,
)
/**
* Initialization options for the `load` method.
* @property [sourceUri] Overrides the url to use for resolving relative links.
* @property [credit] A credit for the data source, which is displayed on the canvas.
* @see Online Documentation
*/
interface LoadOptions {
var sourceUri: Resource?
var credit: Credit?
}
}
}