| 名称 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:
成员 Members
static Cesium.CzmlDataSource.updaters : Array.<CzmlDataSource.UpdaterFunction>
获取 CZML 处理函数的数组。 Gets the array of CZML processing functions.
changedEvent : Event
获取当基础数据更改时将引发的事件。 Gets an event that will be raised when the underlying data changes.
获取由加载的 CZML 定义的时钟设置。如果 CZML 中没有显式定义时钟,则返回所有对象的组合可用性。如果仅存在静态数据,则该值未定义。 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.
获取或设置此数据源的聚类选项。该对象可以在多个数据源之间共享。 Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
获取将为数据源显示的信用 Gets the credit that will be displayed for the data source
获取集合 Gets the collection of
Entity instances.
errorEvent : Event
获取在处理过程中遇到错误时将引发的事件。 Gets an event that will be raised if an error is encountered during processing.
获取一个值,该值指示数据源当前是否正在加载数据。 Gets a value indicating if the data source is currently loading data.
loadingEvent : Event
获取当数据源开始或停止加载时将引发的事件。 Gets an event that will be raised when the data source either starts or stops loading.
获取此实例的人类可读名称。 Gets a human-readable name for this instance.
获取是否应显示此数据源。 Gets whether or not this data source should be displayed.
方法 Methods
static Cesium.CzmlDataSource.load(czml, options) → Promise.<CzmlDataSource>
创建一个 Promise 到加载了所提供的 CZML 数据的新实例。 Creates a Promise to a new instance loaded with the provided CZML data.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
czml |
Resource | string | object | 要处理的 url 或 CZML 对象。 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)
自定义 CZML 更新程序函数使用的辅助函数,用于创建或更新 A helper function used by custom CZML updater functions which creates or updates a
MaterialProperty 来自 CZML 数据包。 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 | 正在处理的 CZML 数据包。 The CZML packet being processed. |
interval |
TimeInterval | 数据有效的约束区间。 A constraining interval for which the data is valid. |
sourceUri |
string | 正在处理的数据的原始 uri。 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)
自定义 CZML 更新程序函数使用的辅助函数,用于创建或更新 A helper function used by custom CZML updater functions which creates or updates a
Property 来自 CZML 数据包。 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 | 正在处理的 CZML 数据包。 The CZML packet being processed. |
interval |
TimeInterval | 数据有效的约束区间。 A constraining interval for which the data is valid. |
sourceUri |
string | 正在处理的数据的原始 uri。 The originating uri of the data being processed. |
entityCollection |
EntityCollection | 正在处理集合。 The collection being processsed. |
static Cesium.CzmlDataSource.processPositionPacketData(object, propertyName, packetData, interval, sourceUri, entityCollection)
自定义 CZML 更新程序函数使用的辅助函数,用于创建或更新 A helper function used by custom CZML updater functions which creates or updates a
PositionProperty 来自 CZML 数据包。 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 | 正在处理的 CZML 数据包。 The CZML packet being processed. |
interval |
TimeInterval | 数据有效的约束区间。 A constraining interval for which the data is valid. |
sourceUri |
string | 正在处理的数据的原始 uri。 The originating uri of the data being processed. |
entityCollection |
EntityCollection | 正在处理集合。 The collection being processsed. |
load(czml, options) → Promise.<CzmlDataSource>
加载提供的 url 或 CZML 对象,替换任何现有数据。 Loads the provided url or CZML object, replacing any existing data.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
czml |
Resource | string | object | 要处理的 url 或 CZML 对象。 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>
处理提供的 url 或 CZML 对象,而不清除任何现有数据。 Processes the provided url or CZML object without clearing any existing data.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
czml |
Resource | string | object | 要处理的 url 或 CZML 对象。 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.
将数据源更新为提供的时间。该功能是可选的,不需要实现。它为根据当前动画时间或场景状态检索数据的数据源提供。如果实施,更新将被调用 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,否则为 false。 True if this data source is ready to be displayed at the provided time, false otherwise.
类型定义 Type Definitions
初始化选项 Initialization options for the
load method.
属性: Properties:
| 名称 Name | 类型 Type | Attributes | 说明 Description |
|---|---|---|---|
sourceUri |
Resource | string |
<可选> <optional> |
覆盖用于解析相对链接的 url。 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. |
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
entity |
Entity | |
packet |
object | |
entityCollection |
EntityCollection | |
sourceUri |
string |
