A
DataSource 它处理 GPS 交换格式 (GPX)。 which processes the GPS Exchange Format (GPX).
示例: Example:
const viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));
演示: Demo:
另见: See:
成员 Members
changedEvent : Event
获取当基础数据更改时将引发的事件。 Gets an event that will be raised when the underlying data changes.
获取由加载的 GPX 定义的时钟设置。这表示所有时间动态数据的总可用性间隔。如果 GPX 不包含时间动态数据,则该值未定义。 Gets the clock settings defined by the loaded GPX. This represents the total availability interval for all time-dynamic data. If the GPX does not contain time-dynamic data, this value is undefined.
获取或设置此数据源的聚类选项。该对象可以在多个数据源之间共享。 Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
获取 GPX 文档的创建者。 Gets the creator of the GPX document.
获取集合 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.
获取包含有关 GPX 文件的元数据的对象。 Gets an object containing metadata about the GPX file.
获取此实例的人类可读名称。这将在加载时自动设置为 GPX 文档名称。 Gets a human-readable name for this instance. This will be automatically be set to the GPX document name on load.
获取是否应显示此数据源。 Gets whether or not this data source should be displayed.
获取正在使用的 GPX 架构的版本。 Gets the version of the GPX Schema in use.
方法 Methods
static Cesium.GpxDataSource.load(data, options) → Promise.<GpxDataSource>
为加载了所提供的 GPX 数据的新实例创建一个 Promise。 Creates a Promise to a new instance loaded with the provided GPX data.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
string | Document | Blob | url、已解析的 GPX 文档或包含二进制 GPX 数据的 Blob。 A url, parsed GPX document, or Blob containing binary GPX data. | ||||||||||||||||||
options |
object |
可选 optional
具有以下属性的对象: An object with the following properties:
|
返回: Returns:
加载 gpx 后将解析为新的 GpxDataSource 实例的承诺。 A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.
load(data, options) → Promise.<GpxDataSource>
异步加载提供的 GPX 数据,替换任何现有数据。 Asynchronously loads the provided GPX data, replacing any existing data.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
string | Document | Blob | url、已解析的 GPX 文档或包含二进制 GPX 数据或已解析的 GPX 文档的 Blob。 A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document. | ||||||||||||||||||
options |
object |
可选 optional
具有以下属性的对象: An object with the following properties:
|
返回: Returns:
加载 GPX 后将解决此实例的承诺。 A promise that will resolve to this instances once the GPX is loaded.
将数据源更新为提供的时间。该功能是可选的,不需要实现。它为根据当前动画时间或场景状态检索数据的数据源提供。如果实施,更新将被调用 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.
