| | |
| | | <template> |
| | | <div class="ParentCentermapdiv"> |
| | | <div class="ParentCentermapdiv"> |
| | | <div id="Centermapdiv"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | name: "", |
| | | components: {}, |
| | | data() { |
| | | return{} |
| | | return {} |
| | | }, |
| | | mounted() { |
| | | this.init3DMap() |
| | |
| | | window.Viewer = window.sgworld._Viewer |
| | | Viewer.imageryLayers._layers[0].show = false |
| | | //定位 |
| | | // Viewer.camera.flyTo({ |
| | | // destination: Cesium.Cartesian3.fromDegrees(110, 33, 25000000), |
| | | // }) |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(110, 33, 25000000), |
| | | destination: { |
| | | x: -3919623.6069864673, |
| | | y: 13752070.475126158, |
| | | z: 8307291.863719194, |
| | | }, |
| | | orientation: { |
| | | heading: 6.283185307179582, |
| | | roll: 0, |
| | | pitch: -1.5707039123519846, |
| | | }, |
| | | }) |
| | | |
| | | }); |
| | | Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: gaoDeBaseUrl[0].url, |
| | |
| | | }) |
| | | ) |
| | | |
| | | |
| | | |
| | | Viewer._enableInfoOrSelection = false |
| | | //显示fps |
| | | Viewer.scene.debugShowFramesPerSecond = false |
| | |
| | | //开启深度检测 |
| | | sgworld.Analysis.depthTestAgainstTerrain(true) |
| | | |
| | | |
| | | Viewer.terrainProvider = new Cesium.CesiumTerrainProvider({ |
| | | url: demLayer, |
| | | }) |
| | |
| | | //改变天空颜色为黑色 |
| | | Viewer.scene.skyBox.show = false //关闭天空盒,否则会显示天空颜色 |
| | | //背景透明 |
| | | Viewer.scene.backgroundColor = new Cesium.Color(0.0, 0.0, 0.0, 0.0); |
| | | Viewer.scene.backgroundColor = new Cesium.Color(0.0, 0.0, 0.0, 0.0) |
| | | }, |
| | | |
| | | } |
| | | |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .ParentCentermapdiv{ |
| | | .ParentCentermapdiv { |
| | | display: fixed; |
| | | height: 100%; |
| | | width: 100%; |
| | | width: 100%; |
| | | } |
| | | #Centermapdiv{ |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | |
| | | #Centermapdiv { |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | </style> |