A
DataSource
which processes the GPS Exchange Format (GPX).
使用示例:
const viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));
Demo:
参考:
成员(属性)
changedEvent : Event
Gets an event that will be raised when the underlying data changes.
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.
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.
Gets an object containing metadata about the GPX file.
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.
Gets the version of the GPX Schema in use.
方法
static Cesium.GpxDataSource.load(data, options) → Promise.<GpxDataSource>
Creates a Promise to a new instance loaded with the provided GPX data.
参数名称 | 类型 | 描述信息 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
string | Document | Blob | A url, parsed GPX document, or Blob containing binary GPX data. | ||||||||||||||||||
options |
object |
可选
An object with the following properties:
|
返回值:
A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.
load(data, options) → Promise.<GpxDataSource>
Asynchronously loads the provided GPX data, replacing any existing data.
参数名称 | 类型 | 描述信息 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
string | Document | Blob | A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document. | ||||||||||||||||||
options |
object |
可选
An object with the following properties:
|
返回值:
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.
参数名称 | 类型 | 描述信息 |
---|---|---|
time |
JulianDate | The simulation time. |
返回值:
True if this data source is ready to be displayed at the provided time, false otherwise.