Skip to content

Commit

Permalink
Update Sandcastle demo
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jan 2, 2019
1 parent 2616eee commit 5d5188b
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions Apps/Sandcastle/gallery/Classification Types.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,40 +40,70 @@
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
});

var entity = viewer.entities.add({
var polygon = viewer.entities.add({
polygon : {
hierarchy : new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromRadiansArray([-1.3194369277314022, 0.6988062530900625, -1.3193955980204217, 0.6988091578771254, -1.3193931220959367, 0.698743632490865, -1.3194358224045408, 0.6987471965556998])),
material : Cesium.Color.RED.withAlpha(0.5),
classificationType : Cesium.ClassificationType.BOTH
}
});

var polyline = viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([
-75.60087369900076, 40.04098281743777,
-75.598010289077, 40.04078844408181,
-75.59675285016156, 40.04086594229075,
-75.59637397352532, 40.040121109969746,
-75.59606539659187, 40.03975884437507,
-75.59561655909226, 40.039404588763794,
-75.59512284705194, 40.038907009555686,
-75.59475612079515, 40.03856363410234,
-75.59449019279681, 40.03823283808938,
-75.59424591418271, 40.037731843972246,
-75.59401054355929, 40.03714916296109,
-75.59376657564358, 40.03642237931955,
-75.59350679993548, 40.035831930643496,
-75.59299953761135, 40.03502602536663]),
width : 8,
material : new Cesium.PolylineOutlineMaterialProperty({
color : Cesium.Color.YELLOW,
outlineWidth : 2,
outlineColor : Cesium.Color.BLACK
}),
clampToGround : true
}
});

var classificationOptions = [{
text : 'Classify Both',
onselect : function() {
entity.polygon.classificationType = Cesium.ClassificationType.BOTH;
polygon.polygon.classificationType = Cesium.ClassificationType.BOTH;
polyline.polyline.classificationType = Cesium.ClassificationType.BOTH;
}
}, {
text : 'Classify Terrain',
onselect : function() {
entity.polygon.classificationType = Cesium.ClassificationType.TERRAIN;
polygon.polygon.classificationType = Cesium.ClassificationType.TERRAIN;
polyline.polyline.classificationType = Cesium.ClassificationType.TERRAIN;
}
}, {
text : 'Classify 3D Tiles',
onselect : function() {
entity.polygon.classificationType = Cesium.ClassificationType.CESIUM_3D_TILE;
polygon.polygon.classificationType = Cesium.ClassificationType.CESIUM_3D_TILE;
polyline.polyline.classificationType = Cesium.ClassificationType.CESIUM_3D_TILE;
}
}];

var materialOptions = [{
text : 'Red Material',
onselect : function() {
entity.polygon.material = Cesium.Color.RED.withAlpha(0.5);
polygon.polygon.material = Cesium.Color.RED.withAlpha(0.5);
}
}, {
text : 'Textured Material',
onselect : function() {
entity.polygon.material = '../images/Cesium_Logo_Color.jpg';
polygon.polygon.material = '../images/Cesium_Logo_Color.jpg';
}
}];

Expand Down

0 comments on commit 5d5188b

Please sign in to comment.