Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable terrain by default in CesiumViewer #6198

Merged
merged 3 commits into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -6,6 +6,9 @@ Change Log
##### Fixes :wrench:
* Fixed bug where AxisAlignedBoundingBox did not copy over center value when cloning an undefined result. [#6183](https://github.com/AnalyticalGraphicsInc/cesium/pull/6183)

##### 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