Skip to content

Commit

Permalink
Merge pull request #6198 from AnalyticalGraphicsInc/cesium-viewer-ter…
Browse files Browse the repository at this point in the history
…rain

Enable terrain by default in CesiumViewer
  • Loading branch information
mramato authored Feb 13, 2018
2 parents 9246085 + 9988116 commit 14bb593
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Apps/CesiumViewer/CesiumViewer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
define([
'Cesium/Core/Cartesian3',
'Cesium/Core/CesiumTerrainProvider',
'Cesium/Core/defined',
'Cesium/Core/formatError',
'Cesium/Core/Math',
Expand All @@ -15,6 +16,7 @@ define([
'domReady!'
], function(
Cartesian3,
CesiumTerrainProvider,
defined,
formatError,
CesiumMath,
Expand Down Expand Up @@ -52,12 +54,24 @@ define([
var loadingIndicator = document.getElementById('loadingIndicator');
var viewer;
try {
var hasBaseLayerPicker = !defined(imageryProvider);
viewer = new Viewer('cesiumContainer', {
imageryProvider : imageryProvider,
baseLayerPicker : !defined(imageryProvider),
baseLayerPicker : hasBaseLayerPicker,
scene3DOnly : endUserOptions.scene3DOnly,
requestRenderMode : true
});

if (hasBaseLayerPicker) {
var viewModel = viewer.baseLayerPicker.viewModel;
viewModel.selectedTerrain = viewModel.terrainProviderViewModels[1];
} else {
viewer.terrainProvider = new CesiumTerrainProvider({
url: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
requestWaterMask: true,
requestVertexNormals: true
});
}
} catch (exception) {
loadingIndicator.style.display = 'none';
var message = formatError(exception);
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Change Log
* Fixed bug where AxisAlignedBoundingBox did not copy over center value when cloning an undefined result. [#6183](https://github.com/AnalyticalGraphicsInc/cesium/pull/6183)
* Fixed `Resource.fetch` when called with no arguments [#6206](https://github.com/AnalyticalGraphicsInc/cesium/issues/6206)

##### Additions :tada:
* Enable terrain in the `CesiumViewer` demo application [#6198](https://github.com/AnalyticalGraphicsInc/cesium/pull/6198)

### 1.42.1 - 2018-02-01
_This is an npm-only release to fix an issue with using Cesium in Node.js.__
* Fixed a bug where Cesium would fail to load under Node.js. [#6177](https://github.com/AnalyticalGraphicsInc/cesium/pull/6177)
Expand Down
3 changes: 2 additions & 1 deletion Source/Widgets/Viewer/viewerDragDropMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ define([
sourceUri : fileName,
proxy : proxy,
camera : scene.camera,
canvas : scene.canvas
canvas : scene.canvas,
clampToGround: clampToGround
});
} else {
viewer.dropError.raiseEvent(viewer, fileName, 'Unrecognized file: ' + fileName);
Expand Down

0 comments on commit 14bb593

Please sign in to comment.