Loading Layers in Cesium Clients Using Cesium API

Cesium clients can load mesh, point cloud, and imagery layers from SkylineGlobe Server using Cesium API. SGS exposes 3DML mesh and point cloud data as 3D Tiles for access by Cesium clients, while storing only the original data format on the server. Imagery layers are served as WMS.

Notes:

The 3D Tiles version is determined by the Default 3D Tiles Version setting on the Settings page unless it is explicitly defined by a 3DML’s b3dmversion tag (see below). See Setting SkylineGlobe Server Settings” in the “SkylineGlobe Server Settings” chapter for more information.

The connection to SkylineGlobe Server is a Guest connection, so only publicly shared layers, i.e., layers whose permission level was set to "Everyone", can be loaded. See "Granting Edit or View Access" in the "Working with Layers" chapter for more information.

Elevation layers can be loaded using Skyline's SGSProvider. See "Loading Layers in Cesium Clients Using Skyline's SGSProvider" in this chapter for information.

Loading Mesh Layers in Cesium Clients

To load your mesh layer in a Cesium client using Cesium API:

Add a Cesium3DTileset element:

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({

url : "https://cloud.skylineglobe.com/SG/demos/b3dm/Frederick/tileset.json"

}));

Use the following path format for the layer to load:

https://[ServerName]/sg/[SiteName]/b3dm/[LayerID]/tileset.json

E.g., https://cloud.skylineglobe.com/SG/demos/b3dm/Frederick/tileset.json

Example:

var viewer = new Cesium.Viewer("cesiumContainer");

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({

url: "https://cloud.skylineglobe.com/SG/demos/b3dm/Frederick/tileset.json"

}));

tileset.readyPromise.then(function(tileset) {

viewer.camera.flyToBoundingSphere( tileset.boundingSphere);

});

Note:You can also interactively browse, edit and run this code example in Cesium Sandcastle.

You can set the OGC 3D Tiles version in which to expose the mesh layer, by appending the 3D Tiles version (b3dmversion) query parameter to the end of your 3D Tile URL. Leave the parameter value empty to use the latest version. Use the following format:

b3dmversion=[version #]

E.g., https://cloud.skylineglobe.com/SG/demos/b3dm/Frederick/tileset.json?b3dmversion=V0.2

 

Note:If a b3dmversion query parameter is not appended to the URL, the 3D Tiles version is determined by the Default 3D Tiles Version setting on the Settings page. See Setting SkylineGlobe Server Settings” in the “SkylineGlobe Server Settings” chapter for more information.

If you want to define how to handle the 3DML’s elevation values, append the vertical datum (vdatum) parameter to the end of your 3D Tile URL. The vdatum parameter can have either of the following values:

convert_z: Reproject to ellipsoid (as required by the OGC 3D Tiles standard) for compatibility with terrain that uses true ellipsoid elevation.

copy_z: Maintain elevation values as geoid, while declaring them as ellipsoid.

Note:Most input coordinate systems and terrain data, including MPT, use geoid elevation values even though they are declared as ellipsoid when delivered to Cesium, and thus they are actually compatible without reprojection.

Use the following format:

?vdatum=[reprojection value: either copy_z. OR convert_z]

E.g., https://cloud.skylineglobe.com/SG/demos/b3dm/Frederick/tileset.json?b3dmversion=V0.2&vdatum=copy_z

Loading Point Cloud Layers in Cesium Clients

To load your point cloud layer in a Cesium client using Cesium API:

Add a Cesium3DTileset element:

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({

url: "https://cloud.skylineglobe.com/SG/demos/pnts/625698/tileset.json"

}));

Use the following path format for the layer to load:

https://[ServerName]/sg/[SiteName]/pnts/[LayerID]/tileset.json

E.g., https://cloud.skylineglobe.com/SG/demos/pnts/625698/tileset.json

Example:

var viewer = new Cesium.Viewer("cesiumContainer");
‎var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({

url: "https://cloud.skylineglobe.com/SG/demos/pnts/625698/tileset.json

}));

tileset.readyPromise.then(function(tileset) {

viewer.camera.flyToBoundingSphere(tileset.boundingSphere);

});

Note:You can also interactively browse, edit and run this code example in Cesium Sandcastle.

If you want to define how to handle the point cloud's elevation values, append the vertical datum (vdatum) parameter to the end of your 3D Tile URL. The vdatum parameter can have either of the following values:

convert_z: Reproject to ellipsoid (as required by the OGC 3D Tiles standard) for compatibility with terrain that uses true ellipsoid elevation.

copy_z: Maintain elevation values as geoid, while declaring them as ellipsoid.

Note:Most input coordinate systems and terrain data, including MPT, use geoid elevation values even though they are declared as ellipsoid when delivered to Cesium, and thus they are actually compatible without reprojection.

Use the following format:

?vdatum=[reprojection value: either copy_z. OR convert_z]

E.g., https://cloud.skylineglobe.com/SG/demos/pnts/625698/tileset.json?vdatum=copy_z

 

Loading Imagery Layers in Cesium Clients

SGS serves imagery layers to Cesium viewers.

To load imagery data in a Cesium client using Cesium API:

Add a Cesium ImageryProvider element.

var imageryLayers = viewer.imageryLayers;

imageryLayers.addImageryProvider();

Create a new Cesium WebMapServiceImageryProvider object.

new Cesium.WebMapServiceImageryProvider({});

Example:

var viewer = new Cesium.Viewer("cesiumContainer");
‎var imageryLayers = viewer.imageryLayers;

Cesium.when(imageryLayers.addImageryProvider(

new Cesium.WebMapServiceImageryProvider({

url: "https://cloud.skylineglobe.com/SG/Demos/Streamer.ashx",

layer: “Caterpillar_Ortho3cm.ii.625696”,

rectangle: Cesium.Rectangle.fromDegrees(-158.38508605957,21.2051582336426,-157.554759979248,21.8001365661621),

parameters: {

transparent: true,

format: "image/png",

},

})),function(a){viewer.camera.flyTo({destination: new Cesium.Rectangle.fromDegrees(-158.38523979, 21.8002224, -157.55467415, 21.2050724)});});