Loading Layers in Cesium Clients Using Skyline's SGSProvider

Cesium clients can load mesh, point cloud, imagery, and elevation layers from SkylineGlobe Server using Skyline's SGSProvider:

§  Mesh and point cloud layers – Exposed as 3D Tiles. Only the original data format is stored on the server.

§  Imagery layers – Served as WMS.

§  Elevation layers – Served via SGSTerrainProvider, SkylineGlobe Server's custom Cesium terrain provider.

Note:   When a project is loaded, SkylineGlobe Server's custom terrain provider, “SGSTerrainProvider", overrides the Cesium terrainProvider set in the Cesium client project, and its MPT or TBP is set as the base terrain. If the loaded project also contains elevation layers or other elevation layers from a different project are loaded, the last elevation layer loaded is set as the base terrain. If you do not want a project's elevation layers to replace your base terrain, set the layerType only to layer types other than elevation, i.e., _LayerType.MESH, _LayerType.IMAGERY, or _LayerType.POINT_CLOUD or any combination of these. See below for more information.


To load your layers in a Cesium client using Skyline's SGSProvider:

Note:   SGSProvider is supported in Cesium 1.62 and above.

1.      Open .\TerraExplorerWeb\js, and copy the SGSProvider folder to your .\Cesium\Apps folder.

2.      Add the SGSProvider.v2.js in your main HTML to start using the SGSProvider library.

<script src="SGSProvider/SGSProvider.v2.js" type="text/javascript"></script>

3.      Connect to SGS using the SGSProvider.connect method.

Note:       After the initial connection to SGS, there is no need to reconnect before loading additional layers.

SGSProvider.connect (URL, username, password)

The following connection options are available:

§  Connect as a guest user only to public layers, e.g.,


§  Connect with a token, e.g.,


§  Connect with a user and password, e.g.,

SGSProvider.connect("https://www.skylineglobe.com/sg”, “Username", "Password");

4.      Load layers in either of the following ways:

§  Load all Layers in a Project - Load all layers in a specific TE4W project. The layerType parameter can be left empty to load all supported layer types in the project, or a specific layer type can be passed to load only layers of that type. More than one layer type can be passed in a single call. The supported layer types are: _LayerType.MESH, _LayerType.POINT_CLOUD, _LayerType.IMAGERY, and _LayerType.ELEVATION.

SGSProvider.loadLayersFromProject(project, layerType)


The following example loads all mesh and imagery layers in the SampleProject project:

SGSProvider.loadLayersFromProject("SampleProject", [_LayerType.MESH, _LayerType.IMAGERY]);


§  Load Individual Layers - Load individual layers by ID, alias, or tag. For loading by tag, set the resourceType to _ResourceType.TAG.

SGSProvider.loadLayers(resourceID, resourceType, layerType)

§  This example loads a single layer by ID.


§  This example loads a single layer by alias.


§  This example loads all layers of a specified LayerType that share a common tag. The supported layer types are: MESH, POINT_CLOUD, IMAGERY, and ELEVATION. For loading by tag, set the resourceType to _ResourceType.TAG.

SGSProvider.loadLayers(“TagName”, _ResourceType.TAG, [_LayerType.POINT_CLOUD]);