Skip to content

Commit

Permalink
Changed datasources to initialize terrain heights, so the user doesn'…
Browse files Browse the repository at this point in the history
…t have to.
  • Loading branch information
Tom Fili committed Aug 2, 2016
1 parent 067a13d commit 934828e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@
}
}];

Cesium.GroundPrimitive.initializeTerrainHeights().then(function() {
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));
});
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));

//Sandcastle_End
Sandcastle.finishedLoading();
Expand Down
8 changes: 8 additions & 0 deletions Source/DataSources/DataSourceDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ define([
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/EventHelper',
'../Scene/GroundPrimitive',
'./BillboardVisualizer',
'./BoundingSphereState',
'./BoxGeometryUpdater',
Expand All @@ -33,6 +34,7 @@ define([
destroyObject,
DeveloperError,
EventHelper,
GroundPrimitive,
BillboardVisualizer,
BoundingSphereState,
BoxGeometryUpdater,
Expand Down Expand Up @@ -77,6 +79,8 @@ define([
throw new DeveloperError('dataSourceCollection is required.');
}
//>>includeEnd('debug');

GroundPrimitive.initializeTerrainHeights();

var scene = options.scene;
var dataSourceCollection = options.dataSourceCollection;
Expand Down Expand Up @@ -231,6 +235,10 @@ define([
}
//>>includeEnd('debug');

if (!GroundPrimitive._initialized) {
return false;
}

var result = true;

var i;
Expand Down

0 comments on commit 934828e

Please sign in to comment.