管道基础大数据平台系统开发-【前端】-新系統界面
surprise
2024-04-01 2cbbc0e4c0357260f370c47365810608c19131c9
src/components/mapsdk.vue
@@ -308,13 +308,15 @@
                :underline="false" @click="setSurfaceDeForm" style="margin-right: 10px">地表形变时序图</el-link>
              <el-link v-if="$store.state.propertiesName.enName == 's_surveyworksite'" type="primary" :underline="false"
                @click="getPointInfo" style="margin-right: 10px">勘察信息表</el-link>
              <el-link type="primary" :underline="false" @click="getAttatchList" style="margin-right: 10px">查看附件</el-link>
              <el-link type="primary" :underline="false" @click="getAttatchList"
                style="margin-right: 10px">查看附件</el-link>
              <i class="el-icon-close" @click="closeBufferBox(6)"></i>
            </div>
          </div>
          <div class="pointInfoBoxContext" style="height:250px;overflow-y: auto">
            <div style="line-height: 20px" v-for="(value, key) in $store.state.propertiesInfo" :key="key">
              <span v-if="key != 'eventid'" style="font-size: 14px;font-weight: bold;margin-right: 5px">{{ key }}:</span>
              <span v-if="key != 'eventid'" style="font-size: 14px;font-weight: bold;margin-right: 5px">{{ key
                }}:</span>
              <span v-if="key != 'eventid'">{{ value }}</span>
            </div>
          </div>
@@ -463,6 +465,7 @@
} from '../api/api'
import { getToken } from '@/utils/auth'
import * as echarts from "echarts"
import axios from 'axios';
export default {
  name: "",
  components: {
@@ -941,6 +944,20 @@
        window.TerrainFlattening && window.TerrainFlattening.remove();
      }
    },
    addGaoDeMap() {
      Viewer.imageryLayers.removeAll();
      var base_ulr = window.sceneConfig.baseUrl;
      if (base_ulr.indexOf('{host}') > -1) {
        base_ulr = base_ulr.replace("{host}", iisHost)
      }
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.UrlTemplateImageryProvider({
          url: base_ulr,
          maximumLevel: 5
        })
      );
    },
    init3DMap() {
      var webKey = "94a34772eb88317fcbf8428e10448561";
      //地图初始化
@@ -948,20 +965,25 @@
        licenseServer: window.sceneConfig.licenseServer,
      });
      window.Viewer = window.sgworld._Viewer;
      if (is_production) {
        Viewer.imageryLayers.removeAll();
        var base_ulr = window.sceneConfig.baseUrl;
        if (base_ulr.indexOf('{host}') > -1) {
          base_ulr = base_ulr.replace("{host}", iisHost)
        }
        Viewer.imageryLayers.addImageryProvider(
          new Cesium.UrlTemplateImageryProvider({
            url: base_ulr,
            maximumLevel: 5
          })
        );
        this.addGaoDeMap();
      } else {
        var url = "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/?callback=loadJsonp940826&f=json"
        $.ajax({
          url: url,
          timeout: 1500, // 请求超时时间
          async: true,
          type: "GET",
          success: (res) => {
            console.log("在线地址获取成功")
          },
          error: (res) => {
            console.log("在线地址获获取失败")
            this.addGaoDeMap();
          }
        })
      }
      //定位
      // sgworld.Navigate.jumpTo({
@@ -1011,18 +1033,18 @@
        );
      }
      // var option = {
      //   url: window.sceneConfig.SGUrl,
      //   layerName: window.sceneConfig.mptName,
      //   requestVertexNormals: true,
      // };
      // window.terrainLayer = sgworld.Creator.sfsterrainprovider("", option, "", true, "");
      window.terrainLayer = new Cesium.CesiumTerrainProvider({
        // url: LFData + '/3d/terrain/dem20230321'
        url: demLayer
      });
      Viewer.terrainProvider = window.terrainLayer
      var option = {
        url: window.sceneConfig.SGUrl,
        layerName: window.sceneConfig.mptName,
        requestVertexNormals: true,
      };
      window.terrainLayer = sgworld.Creator.sfsterrainprovider("", option, "", true, "");
      // window.terrainLayer = new Cesium.CesiumTerrainProvider({
      //   // url: LFData + '/3d/terrain/dem20230321'
      //   url: demLayer
      // });
      // Viewer.terrainProvider = window.terrainLayer
      window.terrainFlag = 'MPT'
      window.elevationTool = new SmartEarth.ElevationTool(window.sgworld);
      elevationTool.setContourColor("#F1D487");
@@ -2166,5 +2188,4 @@
//   background: rgba(255, 255, 255, 0.2) !important;
//   color: white !important;
//   border: 1px solid rgba(255, 255, 255, 0.2) !important;
// }
</style>
// }</style>