Appearance
KBE3D / KBCore / Cesium / GpxDataSource
类: GpxDataSource
A DataSource which processes the GPS Exchange Format (GPX).
示例
ts
const viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));属性
name
name:
string
Gets a human-readable name for this instance. This will be automatically be set to the GPX document name on load.
version
version:
string
Gets the version of the GPX Schema in use.
creator
creator:
string
Gets the creator of the GPX document.
metadata
metadata:
any
Gets an object containing metadata about the GPX file.
clock
clock:
DataSourceClock
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.
entities
entities:
EntityCollection
Gets the collection of Entity instances.
isLoading
isLoading:
boolean
Gets a value indicating if the data source is currently loading data.
changedEvent
changedEvent:
Event
Gets an event that will be raised when the underlying data changes.
errorEvent
errorEvent:
Event
Gets an event that will be raised if an error is encountered during processing.
loadingEvent
loadingEvent:
Event
Gets an event that will be raised when the data source either starts or stops loading.
show
show:
boolean
Gets whether or not this data source should be displayed.
clustering
clustering:
EntityCluster
Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
方法
load()
staticload(data:string|Document|Blob,options?: {clampToGround?:boolean;waypointImage?:string;trackImage?:string;trackColor?:string;routeColor?:string; }):Promise<GpxDataSource>
Creates a Promise to a new instance loaded with the provided GPX data.
参数
data
A url, parsed GPX document, or Blob containing binary GPX data.
string | Document | Blob
options?
An object with the following properties:
clampToGround?
boolean
True if the symbols should be rendered at the same height as the terrain
waypointImage?
string
Image to use for waypoint billboards.
trackImage?
string
Image to use for track billboards.
trackColor?
string
Color to use for track lines.
routeColor?
string
Color to use for route lines.
返回
Promise<GpxDataSource>
A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.
update()
update(
time:JulianDate):boolean
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
The simulation time.
返回
boolean
True if this data source is ready to be displayed at the provided time, false otherwise.
load()
load(
data:string|Document|Blob,options?: {clampToGround?:boolean;waypointImage?:string;trackImage?:string;trackColor?:string;routeColor?:string; }):Promise<GpxDataSource>
Asynchronously loads the provided GPX data, replacing any existing data.
参数
data
A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document.
string | Document | Blob
options?
An object with the following properties:
clampToGround?
boolean
True if the symbols should be rendered at the same height as the terrain
waypointImage?
string
Image to use for waypoint billboards.
trackImage?
string
Image to use for track billboards.
trackColor?
string
Color to use for track lines.
routeColor?
string
Color to use for route lines.
返回
Promise<GpxDataSource>
A promise that will resolve to this instances once the GPX is loaded.
构造函数
构造函数
new GpxDataSource():
GpxDataSource
返回
GpxDataSource
