|
33 | 33 | url : 'https://beta.cesium.com/api/assets/1458?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxYmJiNTAxOC1lOTg5LTQzN2EtODg1OC0zMWJjM2IxNGNlYmMiLCJpZCI6NDQsImFzc2V0cyI6WzE0NThdLCJpYXQiOjE0OTkyNjM4MjB9.1WKijRa-ILkmG6utrhDWX6rDgasjD7dZv-G5ZyCmkKg'
|
34 | 34 | }));
|
35 | 35 |
|
36 |
| -var rectanglePrimitive; |
37 |
| - |
38 | 36 | tileset.readyPromise.then(function() {
|
39 | 37 | var boundingSphere = tileset.boundingSphere;
|
40 | 38 | viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius + 500.0));
|
41 | 39 | 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 |
| - })); |
57 | 40 | }).otherwise(function(error) {
|
58 | 41 | throw(error);
|
59 | 42 | });
|
60 | 43 |
|
| 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 | + |
61 | 61 | var options = [{
|
62 | 62 | text : 'Classify Both',
|
63 | 63 | onselect : function() {
|
|
0 commit comments