Skip to content

Commit

Permalink
Update billboard Sandcastle example.
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnell committed Apr 3, 2017
1 parent faed91c commit 9c139ab
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions Apps/Sandcastle/gallery/Billboards.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@

function sizeBillboardInMeters() {
Sandcastle.declare(sizeBillboardInMeters);

var entity = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
billboard : {
image : '../images/Cesium_Logo_overlay.png',
sizeInMeters : true
}
});

viewer.zoomTo(entity);
}

Expand Down Expand Up @@ -221,6 +221,29 @@
});
}

var terrainProvider;
function disableDepthTest() {
Sandcastle.declare(disableDepthTest);

terrainProvider = viewer.terrainProvider;
viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url : 'https://assets.agi.com/stk-terrain/world',
requestWaterMask : true,
requestVertexNormals : true
});
viewer.scene.globe.depthTestAgainstTerrain = true;

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-122.1958, 46.1915),
billboard : {
image : '../images/facility.gif',
heightReference : Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance : Number.POSITIVE_INFINITY
}
});
viewer.zoomTo(viewer.entities);
}

Sandcastle.addToolbarMenu([{
text : 'Add billboard',
onselect : function() {
Expand Down Expand Up @@ -275,11 +298,23 @@
addMarkerBillboards();
Sandcastle.highlight(addMarkerBillboards);
}
}, {
text : 'Disable the depth test when clamped to ground',
onselect : function() {
disableDepthTest();
Sandcastle.highlight(disableDepthTest);
}
}]);

Sandcastle.reset = function () {
viewer.camera.flyHome(0);
viewer.entities.removeAll();

if (Cesium.defined(terrainProvider)) {
viewer.terrainProvider = terrainProvider;
terrainProvider = undefined;
viewer.scene.globe.depthTestAgainstTerrain = false;
}
};
//Sandcastle_End
Sandcastle.finishedLoading();
Expand Down

0 comments on commit 9c139ab

Please sign in to comment.