Skip to content

Commit d7426a8

Browse files
committed
Update Sandcastle example from review.
1 parent 61fad64 commit d7426a8

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Apps/Sandcastle/gallery/Classification Types.html

+17-17
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,31 @@
3333
url : 'https://beta.cesium.com/api/assets/1458?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxYmJiNTAxOC1lOTg5LTQzN2EtODg1OC0zMWJjM2IxNGNlYmMiLCJpZCI6NDQsImFzc2V0cyI6WzE0NThdLCJpYXQiOjE0OTkyNjM4MjB9.1WKijRa-ILkmG6utrhDWX6rDgasjD7dZv-G5ZyCmkKg'
3434
}));
3535

36-
var rectanglePrimitive;
37-
3836
tileset.readyPromise.then(function() {
3937
var boundingSphere = tileset.boundingSphere;
4038
viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius + 500.0));
4139
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
42-
43-
var center = Cesium.Ellipsoid.WGS84.cartesianToCartographic(boundingSphere.center);
44-
var offset = 0.0001;
45-
var rectangle = new Cesium.Rectangle(center.longitude - offset, center.latitude - offset, center.longitude + offset, center.latitude + offset);
46-
rectanglePrimitive = viewer.scene.primitives.add(new Cesium.GroundPrimitive({
47-
geometryInstances : new Cesium.GeometryInstance({
48-
geometry : new Cesium.RectangleGeometry({
49-
rectangle : rectangle
50-
}),
51-
attributes: {
52-
color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
53-
}
54-
}),
55-
classificationType : Cesium.ClassificationType.BOTH
56-
}));
5740
}).otherwise(function(error) {
5841
throw(error);
5942
});
6043

44+
var cartographics = [new Cesium.Cartographic(-1.3194369277314022, 0.6988062530900625),
45+
new Cesium.Cartographic(-1.3193955980204217, 0.6988091578771254),
46+
new Cesium.Cartographic(-1.3193931220959367, 0.698743632490865),
47+
new Cesium.Cartographic(-1.3194358224045408, 0.6987471965556998)];
48+
var rectangle = Cesium.Rectangle.fromCartographicArray(cartographics);
49+
var rectanglePrimitive = viewer.scene.primitives.add(new Cesium.GroundPrimitive({
50+
geometryInstances : new Cesium.GeometryInstance({
51+
geometry : new Cesium.RectangleGeometry({
52+
rectangle : rectangle
53+
}),
54+
attributes: {
55+
color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
56+
}
57+
}),
58+
classificationType : Cesium.ClassificationType.BOTH
59+
}));
60+
6161
var options = [{
6262
text : 'Classify Both',
6363
onselect : function() {
-18 Bytes
Loading

0 commit comments

Comments
 (0)