Skip to content

Commit

Permalink
Merge pull request #7004 from AnalyticalGraphicsInc/terrain-sandcastle
Browse files Browse the repository at this point in the history
Check for `sampleTerrainMostDetailed` support in terrain sandcastle example
  • Loading branch information
ggetz authored Sep 10, 2018
2 parents 7058d9a + e1f21f3 commit 5e28dfb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Apps/Sandcastle/gallery/Terrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
if(typeof require === 'function') {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
});
}
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
Expand Down Expand Up @@ -191,6 +193,10 @@
}, 'sampleButtons');

Sandcastle.addToolbarButton('Sample Most Detailed Everest Terrain', function() {
if (!Cesium.defined(viewer.terrainProvider.availability)) {
console.log('sampleTerrainMostDetailed is not supported for the selected terrain provider');
return;
}
var terrainSamplePositions = createGrid(0.0005);
Cesium.when(Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, terrainSamplePositions), sampleTerrainSuccess);
lookAtMtEverest();
Expand Down

0 comments on commit 5e28dfb

Please sign in to comment.