Handle the data source of KML markup language (Keyhole Markup Language). KML supports loading 3D models in S3M and glTF formats.
Example:
var viewer = new SuperMap3D.Viewer('Container');
viewer.dataSources.add(SuperMap3D.KmlDataSource.load('../../SampleData/facilities.kmz'),
{
camera: viewer.scene.camera,
canvas: viewer.scene.canvas
});
See:
Members
-
changedEvent : Event
-
Get an event to be fired when the underlying data changes.
-
clock : DataSourceClock
-
Get the clock settings defined by the loaded KML. Indicates the availability interval for all time dynamic data. The value is undefined if the KML does not contain temporal dynamic data.
-
clustering : EntityCluster
-
Gets or sets the class options for the data source. Can be shared between multiple data sources.
-
credit : Credit
-
Get data source credentials
-
entities : EntityCollection
-
get
Entityinstance collection -
errorEvent : Event
-
Gets the event that will be raised when an error is encountered during processing.
-
Gets a value indicating whether the current data source is loading data.
-
loadingEvent : Event
-
Gets the event that will be raised when the data source starts or stops loading.
-
Get the human-readable name of the instance. Will be automatically set to the loaded KML file name.
-
refreshEvent : Event
-
Gets the event raised when the data source refreshes the network link.
-
Gets whether the data source should be displayed.
-
unsupportedNodeEvent : Event
-
Gets the event raised when the data source finds an unsupported node type.
Methods
-
staticSuperMap3D.KmlDataSource.importFile(data, options) → Promise.<KmlDataSource>
-
Import local KML files.
Name Type Description dataString KML file storage path. optionsObject optional The object has the following properties: Name Type Description cameraCamera camera objects canvasCanvas canvas object。 Returns:
After the import is complete, a KmlDataSource instance is returned. -
staticSuperMap3D.KmlDataSource.load(data, options) → Promise.<KmlDataSource>
-
Asynchronously loads the provided KML data, replacing any existing data.
Name Type Description dataString | Document | Blob Layer URL or BLOB containing the KML parsed document. optionsObject optional The object has the following properties: Name Type Default Description cameraCamera camera object canvasCanvas Canvas object. sourceUriString optional Overrides urls used for resolving relative links and other KML web features. clampToGroundBoolean falseoptional If we want to anchor geometric features (polygons, linestrings, and linear rings) to the ground, then true。 ellipsoidEllipsoid Ellipsoid.WGS84optional A global ellipsoid for geocomputing. creditCredit | String optional Credentials for the data source, displayed on the canvas. Returns:
Returns a KmlDataSource instance when the KML is loaded. -
Gets the visibility of the corresponding viewport of the layer.
Name Type Description indexNumber index Returns:
visibleThrows:
-
DeveloperError : index value range in 0~3。
-
-
load(data, options) → Promise.<KmlDataSource>
-
Load a KML layer as a URL.
Name Type Description dataString | Document | Blob Layer URL or BLOB containing the KML parsed document. optionsObject optional The object has the following properties: Name Type Description cameraCamera camera object. canvasCanvas canvas object Returns:
Returns a KmlDataSource instance when the KML is loaded. -
Sets the visibility of the layer corresponding to the viewport.
Name Type Description indexNumber index visibleBoolean visibility Throws:
-
DeveloperError : index value range in 0~3。
-
-
Update all web links that need to be updated.
Name Type Description timeJulianDate Simulation time. true if the data source is displayed within the specified time, otherwise false.
