管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-02-16 a609fc88cec4d74460b5255bdfdd430fb6a6ffa2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
  <div class="ParentCentermapdiv">
    <div id="Centermapdiv"></div>
  </div>
</template>
 
<script>
export default {
  name: "",
  components: {},
  data() {
    return {}
  },
  mounted() {
    this.init3DMap()
  },
  methods: {
    init3DMap() {
      //地图初始化
      window.sgworld = new SmartEarth.SGWorld("Centermapdiv", {
        licenseServer: window.sceneConfig.licenseServer,
      })
 
      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: {
          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.imageryLayers.addImageryProvider(
        new Cesium.UrlTemplateImageryProvider({
          url: gaoDeBaseUrl[1].url,
        })
      )
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.UrlTemplateImageryProvider({
          url: gaoDeBaseUrl[2].url,
        })
      )
 
      Viewer._enableInfoOrSelection = false
      //显示fps
      Viewer.scene.debugShowFramesPerSecond = false
      //导航控件
      window.sgworld.navControl("nav", false)
      //比例尺
      window.sgworld.navControl("scale", 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)
    },
  },
}
</script>
 
<style scoped lang="scss">
.ParentCentermapdiv {
  display: fixed;
  height: 100%;
  width: 100%;
}
#Centermapdiv {
  height: 100%;
  width: 100%;
}
</style>