20191209
Showing
4 changed files
with
28 additions
and
18 deletions
| ... | @@ -61,6 +61,8 @@ export default { | ... | @@ -61,6 +61,8 @@ export default { |
| 61 | this.smviewer=new Cesium.Viewer('cesiumContainer', { | 61 | this.smviewer=new Cesium.Viewer('cesiumContainer', { |
| 62 | animation: true | 62 | animation: true |
| 63 | }); | 63 | }); |
| 64 | $(".cesium-widget-credits")[0].style.visibility="hidden"; | ||
| 65 | $(".cesium-viewer-animationContainer")[0].style.visibility="hidden"; | ||
| 64 | var scenecamera=null; | 66 | var scenecamera=null; |
| 65 | this.smviewer.imageryLayers.addImageryProvider(new Cesium.BingMapsImageryProvider({ | 67 | this.smviewer.imageryLayers.addImageryProvider(new Cesium.BingMapsImageryProvider({ |
| 66 | url : 'https://dev.virtualearth.net', | 68 | url : 'https://dev.virtualearth.net', | ... | ... |
| ... | @@ -73,7 +73,14 @@ export default { | ... | @@ -73,7 +73,14 @@ export default { |
| 73 | imageryLayers.addImageryProvider(labelImagery); | 73 | imageryLayers.addImageryProvider(labelImagery); |
| 74 | 74 | ||
| 75 | __this.smviewer.camera.setView({ | 75 | __this.smviewer.camera.setView({ |
| 76 | destination : Cesium.Cartesian3.fromDegrees(116.34485552299206, 39.99754814959118, 450.0) | 76 | destination : Cesium.Cartesian3.fromDegrees(116.34485552299206, 39.99754814959118, 600.0), |
| 77 | orientation:{ | ||
| 78 | // 指向 | ||
| 79 | heading:Cesium.Math.toRadians(45, 0), | ||
| 80 | // 视角 | ||
| 81 | pitch:Cesium.Math.toRadians(-45), | ||
| 82 | roll:0.0 | ||
| 83 | } | ||
| 77 | }); | 84 | }); |
| 78 | // 鼠标左键点击事件 | 85 | // 鼠标左键点击事件 |
| 79 | var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); | 86 | var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); | ... | ... |
| ... | @@ -203,30 +203,30 @@ export default { | ... | @@ -203,30 +203,30 @@ export default { |
| 203 | // b. 使用entity模型 | 203 | // b. 使用entity模型 |
| 204 | function addClapFeature(feature) { | 204 | function addClapFeature(feature) { |
| 205 | var lonLatArr = getLonLatArray(feature.geometry.points); | 205 | var lonLatArr = getLonLatArray(feature.geometry.points); |
| 206 | // smviewer.entities.add({ | ||
| 207 | // id: 'identify-area', | ||
| 208 | // name: '单体化标识面', | ||
| 209 | // polygon: { | ||
| 210 | // hierarchy: Cesium.Cartesian3.fromDegreesArray(lonLatArr), | ||
| 211 | // material: new Cesium.Color(1.0, 0.0, 0.0, 0.3), | ||
| 212 | // }, | ||
| 213 | // clampToS3M: true // 贴在S3M模型表面 | ||
| 214 | // }); | ||
| 215 | console.log(lonLatArr); | ||
| 216 | smviewer.entities.add({ | 206 | smviewer.entities.add({ |
| 217 | id: 'identify-area', | 207 | id: 'identify-area', |
| 218 | name: '单体化标识面', | 208 | name: '单体化标识面', |
| 219 | polygon: { | 209 | polygon: { |
| 220 | hierarchy: Cesium.Cartesian3.fromDegreesArray(lonLatArr), | 210 | hierarchy: Cesium.Cartesian3.fromDegreesArray(lonLatArr), |
| 221 | material: new Cesium.Color(0.0, 1.0, 0.0, 0.3), | 211 | material: new Cesium.Color(1.0, 0.0, 0.0, 0.3), |
| 222 | // perPositionHeight: true, | ||
| 223 | extrudedHeight: 100, | ||
| 224 | height: 50, | ||
| 225 | vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, | ||
| 226 | outline : true, | ||
| 227 | outlineColor : Cesium.Color.BLACK | ||
| 228 | }, | 212 | }, |
| 213 | clampToS3M: true // 贴在S3M模型表面 | ||
| 229 | }); | 214 | }); |
| 215 | // console.log(lonLatArr); | ||
| 216 | // smviewer.entities.add({ | ||
| 217 | // id: 'identify-area', | ||
| 218 | // name: '单体化标识面', | ||
| 219 | // polygon: { | ||
| 220 | // hierarchy: Cesium.Cartesian3.fromDegreesArray(lonLatArr), | ||
| 221 | // material: new Cesium.Color(0.0, 1.0, 0.0, 0.3), | ||
| 222 | // // perPositionHeight: true, | ||
| 223 | // extrudedHeight: 100, | ||
| 224 | // height: 50, | ||
| 225 | // vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, | ||
| 226 | // outline : true, | ||
| 227 | // outlineColor : Cesium.Color.BLACK | ||
| 228 | // }, | ||
| 229 | // }); | ||
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | // 得到[经度,纬度,经度,纬度...]形式的数组,用于构造面。 | 232 | // 得到[经度,纬度,经度,纬度...]形式的数组,用于构造面。 | ... | ... |
-
Please register or sign in to post a comment