# GpxDataSource

#### new Cesium.GpxDataSource()
engine/Source/DataSources/GpxDataSource.js 750

A `DataSource` which processes the GPS Exchange Format (GPX).

##### Example:

    const viewer = new Cesium.Viewer('cesiumContainer');
    viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));

##### Demo:

- http://sandcastle.cesium.com/index.html?src=GPX.html

##### See:

- Topografix GPX Standard
- Topografix GPX Documentation

### Members

#### changedEvent : Event
engine/Source/DataSources/GpxDataSource.js 860

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

#### clock : DataSourceClock
engine/Source/DataSources/GpxDataSource.js 830

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.

#### clustering : EntityCluster
engine/Source/DataSources/GpxDataSource.js 905

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

#### creator : string
engine/Source/DataSources/GpxDataSource.js 808

Gets the creator of the GPX document.

#### entities : EntityCollection
engine/Source/DataSources/GpxDataSource.js 840

Gets the collection of `Entity` instances.

#### errorEvent : Event
engine/Source/DataSources/GpxDataSource.js 870

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

#### isLoading : boolean
engine/Source/DataSources/GpxDataSource.js 850

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

#### loadingEvent : Event
engine/Source/DataSources/GpxDataSource.js 880

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

#### metadata : object
engine/Source/DataSources/GpxDataSource.js 818

Gets an object containing metadata about the GPX file.

#### name : string
engine/Source/DataSources/GpxDataSource.js 788

Gets a human-readable name for this instance. This will be automatically be set to the GPX document name on load.

#### show : boolean
engine/Source/DataSources/GpxDataSource.js 890

Gets whether or not this data source should be displayed.

#### version : string
engine/Source/DataSources/GpxDataSource.js 798

Gets the version of the GPX Schema in use.

### Methods

#### static Cesium.GpxDataSource.load(data, options) → Promise.<GpxDataSource>
engine/Source/DataSources/GpxDataSource.js 777

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

Name | Type | Description
--- | --- | ---
`data` | string | Document | Blob | A url, parsed GPX document, or Blob containing binary GPX data.
`options` | object | optional An object with the following properties:
Name | Type | Description
--- | --- | ---
`clampToGround` | boolean | optional True if the symbols should be rendered at the same height as the terrain
`waypointImage` | string | optional Image to use for waypoint billboards.
`trackImage` | string | optional Image to use for track billboards.
`trackColor` | string | optional Color to use for track lines.
`routeColor` | string | optional Color to use for route lines.

##### Returns:

A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.

#### load(data, options) → Promise.<GpxDataSource>
engine/Source/DataSources/GpxDataSource.js 945

Asynchronously loads the provided GPX data, replacing any existing data.

Name | Type | Description
--- | --- | ---
`data` | string | Document | 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:
Name | Type | Description
--- | --- | ---
`clampToGround` | boolean | optional True if the symbols should be rendered at the same height as the terrain
`waypointImage` | string | optional Image to use for waypoint billboards.
`trackImage` | string | optional Image to use for track billboards.
`trackColor` | string | optional Color to use for track lines.
`routeColor` | string | optional Color to use for route lines.

##### Returns:

A promise that will resolve to this instances once the GPX is loaded.

#### update(time) → boolean
engine/Source/DataSources/GpxDataSource.js 929

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.

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