In earlier versions of CesiumJS I have used the following snippet to add a terrain server to the view model:
var terrainProviders = [];
terrainProviders.push(new Cesium.ProviderViewModel({
name: "90m Australia",
iconUrl: './icon/opentopomap.png',
tooltip: '90m Australia Terrain',
category: 'Offline',
creationFunction: function() {
return new Cesium.CesiumTerrainProvider({
url: 'https://terrain.datr.dev/data/90m_australia/',
});
}
}));
var viewer = new Cesium.Viewer("cesiumContainer", {
baseLayerPicker: true,
imageryProviderViewModels: imageryProviders,
terrainProviderViewModels: terrainProviders,
geocoder: false,
shouldAnimate: false,
selectionIndicator: false
});
In newer versions (1.114) clicking this terrain server makes the globe go blank. I understand this was a change from version 1.104. I can’t understand how to integrate the example snippet into my code - here is my attempt which also results in a blank globe;
terrainProviders.push(new Cesium.ProviderViewModel({
name: "90m Australia",
iconUrl: './icon/opentopomap.png',
tooltip: '90m Australia Terrain',
category: 'Offline',
creationFunction: function() {
return new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(
'https://terrain.datr.dev/data/90m_australia/'
));
}
}));