From 5d5188ba4ea535057d793967d3f49f4311029d4c Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Wed, 2 Jan 2019 17:47:53 -0500 Subject: [PATCH] Update Sandcastle demo --- .../gallery/Classification Types.html | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/Apps/Sandcastle/gallery/Classification Types.html b/Apps/Sandcastle/gallery/Classification Types.html index c1d6c8d3d4b4..dc02fcf8ba88 100644 --- a/Apps/Sandcastle/gallery/Classification Types.html +++ b/Apps/Sandcastle/gallery/Classification Types.html @@ -40,7 +40,7 @@ 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), @@ -48,32 +48,62 @@ } }); +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'; } }];