Skip to content

Cesium config parameters

Dailis edited this page Oct 31, 2021 · 12 revisions

To configure an hslayers-ng project with a cesium 3D map, an extra configuration must be specified similarly like for a simple hslayers-ng base map project. Either in the main application file (usually app.component.ts's constructor) using this.hsCesiumConfig.update(...) method.

Example:

constructor(private hsCesiumConfig: HsCesiumConfig) {
this.hsCesiumConfig.update({
    terrain_provider: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
    terrain_providers: [{
        title: 'EU-DEM',
        url: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
        active: true
    }],

Or in the hslayersCesiumConfig() function in case of the "simple" application.

Example:

function hslayersCesiumConfig() {
  return {
    terrain_provider: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
    terrain_providers: [{
        title: 'EU-DEM',
        url: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
        active: true
    }],

Cesium 3D Maps

Property Type Manditory Default Value Description Example
cesiumAccessToken
String true Access token for Cesium. Register for it here: https://cesium.com/ion/assets/.
cesiumAnimation
Boolean true Should Cesium animate 3D objects.
cesiumBase
String true Directory of Cesium library. Example: ./node_modules/cesium/Build/Cesium/.
cesiumBingKey
String true API key for Bing maps used as Cesium base layer. See: https://www.bingmapsportal.com/.
cesiumDebugShowFramesPerSecond
Boolean true Turn on or off FPS counter which is used for performance benchmarking.
cesiumInfoBox
Boolean true Show 'get feature info' results in Cesium interface.
cesiumShadows
Boolean true Show shadows for objects and terrain.
cesiumTime
Cesium.JulianDate true
Cesium.JulianDate class object which specifies default time value... to set Cesium viewer.clockViewModel.currentTime to. See: https://cesiumjs.org/Cesium/Build/Documentation/JulianDate.html.
cesiumTimeline
Boolean true Turn on or off Cesium timeline.
creditContainer
Element | String false
The DOM element or ID that will contain the CreditDisplay... If not specified, the credits are added to the bottom of the widget itself.
createWorldTerrainOptions
Object false
If no terrain_provider config parameter is present..., then createWorldTerrainOptions object is used in Cesium.createWorldTerrain function to create terrain layer. See: https://cesiumjs.org/Cesium/Build/Documentation/createWorldTerrain.html.
imageryProvider
Cesium.ImageryProvider false
The imagery provider to use instead of default Bing maps. This value is only valid if Cesium's options.baseLayerPicker is set to false. See: https://cesiumjs.org/Cesium/Build/Documentation/ImageryProvider.html.
terrain_provider
Object false
This is passed to viewer.terrainProvider configuration option... See: https://cesiumjs.org/Cesium/Build/Documentation/Viewer.html and https://cesiumjs.org/Cesium/Build/Documentation/TerrainProvider.html.
Example
terrain_providers
Array<Object> false Objects between which user will be able to choose in layer manager. See terrain_provider config option.
newTerrainProviderOptions
false Specifies new terrain provider options for cesium map.
terrainExaggeration
Number false
A scalar used to exaggerate the terrain... Default value is 1.0. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.

terrain_provider example:

new Cesium.CesiumTerrainProvider({
        url : Cesium.IonResource.fromAssetId(3956),
        requestVertexNormals : true
    })
Clone this wiki locally