管道基础大数据平台系统开发-【前端】-新系統界面
surprise
2024-02-05 fb98e10c76d7e6c2d01f3a9f8c1b727f905cbdca
src/components/Screen/mapsdk.vue
@@ -6,6 +6,7 @@
<script>
let yunxuanLayer = null
import mapMenu from '../js/index.js'
export default {
  name: "",
  components: {},
@@ -39,25 +40,9 @@
    // })
  },
  methods: {
    init3DMap() {
      //地图初始化
      // window.sgworld = new SmartEarth.SGWorld("Centermapdiv", {
      //   licenseServer: window.sceneConfig.licenseServer,
      // })
      // window.sgworld = new SmartEarth.SGWorld(
      //   "Centermapdiv",
      //   function () { }
      // )
      window.sgworld = new SmartEarth.SGWorld("Centermapdiv", {
        licenseServer: window.sceneConfig.licenseServer,
      });
      window.viewer = window.Viewer = window.sgworld._Viewer;
    initData() {
      if (is_production) {
        Viewer.imageryLayers.removeAll();
      }
      // Viewer.imageryLayers._layers[0].show = false
      sgworld.Navigate.jumpTo({      //跳转视角
@@ -148,6 +133,28 @@
      //背景透明
      Viewer.scene.backgroundColor = new Cesium.Color(0.0, 0.0, 0.0, 0.0)
    },
    init3DMap() {
      //地图初始化
      // window.sgworld = new SmartEarth.SGWorld("Centermapdiv", {
      //   licenseServer: window.sceneConfig.licenseServer,
      // })
      // window.sgworld = new SmartEarth.SGWorld(
      //   "Centermapdiv",
      //   function () { }
      // )
      window.sgworld = new SmartEarth.SGWorld("Centermapdiv", {
        licenseServer: window.sceneConfig.licenseServer,
      });
      window.viewer = window.Viewer = window.sgworld._Viewer;
      var data = mapMenu.init();
      data.then((res) => {
        if (!res) {
          mapMenu.addGaoDeMap();
        }
        this.initData();
      })
    },
  },
}
</script>
@@ -158,6 +165,7 @@
  height: 100%;
  width: 100%;
}
#Centermapdiv {
  height: 100%;
  width: 100%;