# CzmlDataSource

#### new Cesium.CzmlDataSource(name)
engine/Source/DataSources/CzmlDataSource.js 4822

A `DataSource` which processes CZML.

Name | Type | Description
--- | --- | ---
`name` | string | optional An optional name for the data source. This value will be overwritten if a loaded document contains a name.

##### Demo:

- Cesium Sandcastle CZML Demo

### Members

#### static Cesium.CzmlDataSource.updaters : Array.<CzmlDataSource.UpdaterFunction>
engine/Source/DataSources/CzmlDataSource.js 4984

Gets the array of CZML processing functions.

#### changedEvent : Event
engine/Source/DataSources/CzmlDataSource.js 4897

Gets an event that will be raised when the underlying data changes.

#### clock : DataSourceClock
engine/Source/DataSources/CzmlDataSource.js 4867

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.

#### clustering : EntityCluster
engine/Source/DataSources/CzmlDataSource.js 4942

Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.

#### credit : Credit
engine/Source/DataSources/CzmlDataSource.js 4960

Gets the credit that will be displayed for the data source

#### entities : EntityCollection
engine/Source/DataSources/CzmlDataSource.js 4877

Gets the collection of `Entity` instances.

#### errorEvent : Event
engine/Source/DataSources/CzmlDataSource.js 4907

Gets an event that will be raised if an error is encountered during processing.

#### isLoading : boolean
engine/Source/DataSources/CzmlDataSource.js 4887

Gets a value indicating if the data source is currently loading data.

#### loadingEvent : Event
engine/Source/DataSources/CzmlDataSource.js 4917

Gets an event that will be raised when the data source either starts or stops loading.

#### name : string
engine/Source/DataSources/CzmlDataSource.js 4855

Gets a human-readable name for this instance.

#### show : boolean
engine/Source/DataSources/CzmlDataSource.js 4927

Gets whether or not this data source should be displayed.

### Methods

#### static Cesium.CzmlDataSource.load(czml, options) → Promise.<CzmlDataSource>
engine/Source/DataSources/CzmlDataSource.js 4845

Creates a Promise to a new instance loaded with the provided CZML data.

Name | Type | Description
--- | --- | ---
`czml` | Resource | string | object | A url or CZML object to be processed.
`options` | CzmlDataSource.LoadOptions | optional An object specifying configuration options

##### Returns:

A promise that resolves to the new instance once the data is processed.

#### static Cesium.CzmlDataSource.processMaterialPacketData(object, propertyName, packetData, interval, sourceUri, entityCollection)
engine/Source/DataSources/CzmlDataSource.js 5111

A helper function used by custom CZML updater functions which creates or updates a `MaterialProperty` from a CZML packet.

Name | Type | Description
--- | --- | ---
`object` | object | The object on which the property will be added or updated.
`propertyName` | string | The name of the property on the object.
`packetData` | object | The CZML packet being processed.
`interval` | TimeInterval | A constraining interval for which the data is valid.
`sourceUri` | string | The originating uri of the data being processed.
`entityCollection` | EntityCollection | The collection being processsed.

#### static Cesium.CzmlDataSource.processPacketData(type, object, propertyName, packetData, interval, sourceUri, entityCollection)
engine/Source/DataSources/CzmlDataSource.js 5083

A helper function used by custom CZML updater functions which creates or updates a `Property` from a CZML packet.

Name | Type | Description
--- | --- | ---
`type` | function | The constructor function for the property being processed.
`object` | object | The object on which the property will be added or updated.
`propertyName` | string | The name of the property on the object.
`packetData` | object | The CZML packet being processed.
`interval` | TimeInterval | A constraining interval for which the data is valid.
`sourceUri` | string | The originating uri of the data being processed.
`entityCollection` | EntityCollection | The collection being processsed.

#### static Cesium.CzmlDataSource.processPositionPacketData(object, propertyName, packetData, interval, sourceUri, entityCollection)
engine/Source/DataSources/CzmlDataSource.js 5097

A helper function used by custom CZML updater functions which creates or updates a `PositionProperty` from a CZML packet.

Name | Type | Description
--- | --- | ---
`object` | object | The object on which the property will be added or updated.
`propertyName` | string | The name of the property on the object.
`packetData` | object | The CZML packet being processed.
`interval` | TimeInterval | A constraining interval for which the data is valid.
`sourceUri` | string | The originating uri of the data being processed.
`entityCollection` | EntityCollection | The collection being processsed.

#### load(czml, options) → Promise.<CzmlDataSource>
engine/Source/DataSources/CzmlDataSource.js 5053

Loads the provided url or CZML object, replacing any existing data.

Name | Type | Description
--- | --- | ---
`czml` | Resource | string | object | A url or CZML object to be processed.
`options` | CzmlDataSource.LoadOptions | optional An object specifying configuration options

##### Returns:

A promise that resolves to this instances once the data is processed.

#### process(czml, options) → Promise.<CzmlDataSource>
engine/Source/DataSources/CzmlDataSource.js 5041

Processes the provided url or CZML object without clearing any existing data.

Name | Type | Description
--- | --- | ---
`czml` | Resource | string | object | A url or CZML object to be processed.
`options` | CzmlDataSource.LoadOptions | optional An object specifying configuration options

##### Returns:

A promise that resolves to this instances once the data is processed.

#### update(time) → boolean
engine/Source/DataSources/CzmlDataSource.js 5066

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.

Name | Type | Description
--- | --- | ---
`time` | JulianDate | The simulation time.

##### Returns:

True if this data source is ready to be displayed at the provided time, false otherwise.

### Type Definitions

#### Cesium.CzmlDataSource.LoadOptions
engine/Source/DataSources/CzmlDataSource.js 4804

Initialization options for the `load` method.

##### Properties:

Name | Type | Attributes | Description
--- | --- | --- | ---
`sourceUri` | Resource | string | <optional> | Overrides the url to use for resolving relative links.
`credit` | Credit | string | <optional> | A credit for the data source, which is displayed on the canvas.

#### Cesium.CzmlDataSource.UpdaterFunction(entity, packet, entityCollection, sourceUri)
engine/Source/DataSources/CzmlDataSource.js 4967

Name | Type | Description
--- | --- | ---
`entity` | Entity |
`packet` | object |
`entityCollection` | EntityCollection |
`sourceUri` | string |

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.