KmlDataSource
A DataSource which processes Keyhole Markup Language 2.2 (KML).
KML support in Cesium is incomplete, but a large amount of the standard, as well as Google's gx
extension namespace, is supported. See Github issue #873 for a detailed list of what is and isn't supported. Cesium will also write information to the console when it encounters most unsupported features.
Non visual feature data, such as atom:author
and ExtendedData
is exposed via an instance of KmlFeatureData, which is added to each Entity under the kml
property.
const viewer = new Viewer('cesiumContainer');
viewer.dataSources.add(KmlDataSource.load('../../SampleData/facilities.kmz',
{
camera: viewer.scene.camera,
canvas: viewer.scene.canvas
})
);
See also
Types
Options for constructing a new KmlDataSource, or calling the static load
method.
Properties
The current size of this Canvas will be used to populate the Link parameters for client height and width.
Gets an event that will be raised when the underlying data changes.
Gets the clock settings defined by the loaded KML. This represents the total availability interval for all time-dynamic data. If the KML 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 collection of Entity instances.
Gets an event that will be raised if an error is encountered during processing.
Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.
Gets an event that will be raised when the data source either starts or stops loading.
Gets an event that will be raised when the data source refreshes a network link.
Gets an event that will be raised when the data source finds an unsupported node type.
Functions
Asynchronously loads the provided KML data, replacing any existing data.
Updates any NetworkLink that require updating.