管道基础大数据平台系统开发-【前端】-新系統界面
584911253@qq.com
2023-03-10 eb6cfd90fd89f11263146dc4c38069c8a4845fab
src/components/mapsdk.vue
@@ -56,6 +56,7 @@
          </div>
        </el-card>
      </div>
      <!--坐标点位-->
      <div
        class="coordLocalBox"
        v-if="showCoordLocalBoxDialog"
@@ -95,6 +96,7 @@
          </div>
        </el-card>
      </div>
      <!--地形平整-->
      <div
        class="terrainLevelBox"
        v-if="showTerrainLevelDialog"
@@ -230,6 +232,7 @@
          </div>
        </el-card>
      </div>
      <!-- 路径分析弹窗-->
      <div
        class="pathAnalysisBox"
        v-if="showPathAnalysisBoxDialog"
@@ -315,6 +318,7 @@
          ></div>
        </div>
      </div>
      <!-- 坡度分析弹窗-->
      <div
        class="lengend"
        v-show="showLengendDialog"
@@ -665,6 +669,20 @@
    this.$bus.$on('changemapType', (e) => {
      this.show2DMap = e;
    });
    this.$bus.$on('closeMenuPop', (e) => {
      //非路径分析
      if (e != 'd3'){
        this.showPathAnalysisBoxDialog = false;
      }
      //非坡度分析
      if (e != 'd2'){
        this.showLengendDialog = false;
      }
      //非地形平整
      if (e != 'd10'){
        this.showTerrainLevelDialog = false;
      }
    });
    //模型捕捉
    this.catchmodel()
  },
@@ -850,7 +868,8 @@
        } else {
          this.showBufferBoxDialog = true;
        }
      } else if (res.name == "Coord") {
      }
      else if (res.name == "Coord") {
        if (res.id == "1") {
          this.showCoordLocalBoxDialog = true;
          this.showToponymicLocalBoxDialog = false;
@@ -859,7 +878,8 @@
          this.showCoordLocalBoxDialog = false;
          this.getToponymicData();
        }
      } else if (res.name == "Analysis") {
      }
      else if (res.name == "Analysis") {
        if (res.id == "3") {
          if (res.show == true) {
            this.showPathAnalysisBoxDialog = true;
@@ -868,23 +888,21 @@
            this.closeBufferBox(4);
          }
        }
      } else if (res.name == "Trrain") {
      }
      else if (res.name == "Trrain") {
        switch (res.id) {
          case "d10":
            this.showTerrainLevelDialog = !this.showTerrainLevelDialog;
            this.clearTerrainLevel();
            break;
        }
      } else if (res.name == "Lengend") {
      }
      else if (res.name == "Lengend") {
        switch (res.id) {
          case "d2":
            this.showLengendDialog = res.vshow;
            break;
        }
      }
    },
    handleSizeChange(val) {
@@ -958,6 +976,7 @@
          break;
        case 2:
          this.showCoordLocalBoxDialog = false;
          sgworld.Creator.DeleteObject(this.imagePoint);
          break;
        case 3:
          this.showToponymicLocalBoxDialog = false;
@@ -990,6 +1009,10 @@
        Y: lat,
        Altitude: 2000,
      };
      if (this.imagePoint != null) {
        sgworld.Creator.DeleteObject(this.imagePoint);
        this.imagePoint = null;
      }
      this.imagePoint = sgworld.Creator.CreateLabel(
        position,
        "",
@@ -1068,36 +1091,64 @@
    },
    async showMouseLeftClick(res) {
      if (res == 3) {
        this.$refs.form.validate((valid) => {
          if (!valid) {
            return false;
        this.$refs.form.validate(async (valid) => {
          if (valid) {
            this.clearPathAll(5);
            var start = this.pathFrom.lon.split(",");
            var end = this.pathFrom.lat.split(",");
            var startData = {
              x1: parseFloat(start[0]),
              y1: parseFloat(start[1]),
              x2: parseFloat(end[0]),
              y2: parseFloat(end[1]),
            };
            const data = await comprehensive_selectRoute(startData);
            if (data.code != 200) {
              return this.$message.error("数据请求失败");
            }
            if (!data.result) {
              return this.$message.error("暂无数据");
            }
            var wkt = this.$wkt.parse(data.result);
            var bufferSource = Cesium.GeoJsonDataSource.load(wkt, {
              stroke: new Cesium.Color(82 / 255, 152 / 255, 255 / 255, 1),
              strokeWidth: 5,
              clampToGround: true,
            });
            bufferSource.then((bufferSource) => {
              sgworld.Navigate.flyToObj(bufferSource);
              Viewer.dataSources.add(bufferSource);
            });
          }
        });
        this.clearPathAll(3);
        var start = this.pathFrom.lon.split(",");
        var end = this.pathFrom.lat.split(",");
        var startData = {
          x1: parseFloat(start[0]),
          y1: parseFloat(start[1]),
          x2: parseFloat(end[0]),
          y2: parseFloat(end[1]),
        };
        const data = await comprehensive_selectRoute(startData);
        if (data.code != 200) {
          return this.$message.error("数据请求失败");
        }
        var wkt = this.$wkt.parse(data.result);
        var bufferSource = Cesium.GeoJsonDataSource.load(wkt, {
          stroke: new Cesium.Color(82 / 255, 152 / 255, 255 / 255, 1),
          strokeWidth: 5,
          clampToGround: true,
        });
        bufferSource.then((bufferSource) => {
          sgworld.Navigate.flyToObj(bufferSource);
          Viewer.dataSources.add(bufferSource);
        });
        // this.clearPathAll(3);
        // var start = this.pathFrom.lon.split(",");
        // var end = this.pathFrom.lat.split(",");
        // var startData = {
        //   x1: parseFloat(start[0]),
        //   y1: parseFloat(start[1]),
        //   x2: parseFloat(end[0]),
        //   y2: parseFloat(end[1]),
        // };
        //
        // const data = await comprehensive_selectRoute(startData);
        // if (data.code != 200) {
        //   return this.$message.error("数据请求失败");
        // }
        // if (!data.result) {
        //   return this.$message.error("暂无数据");
        // }
        // var wkt = this.$wkt.parse(data.result);
        // var bufferSource = Cesium.GeoJsonDataSource.load(wkt, {
        //   stroke: new Cesium.Color(82 / 255, 152 / 255, 255 / 255, 1),
        //
        //   strokeWidth: 5,
        //   clampToGround: true,
        // });
        // bufferSource.then((bufferSource) => {
        //   sgworld.Navigate.flyToObj(bufferSource);
        //   Viewer.dataSources.add(bufferSource);
        // });
        // var jsonurl =
        //   wnsUrl +
        //   '?start=' +
@@ -1223,6 +1274,13 @@
            sgworld.Creator.DeleteObject(this.linePath);
            this.linePath = null;
          }
        case 5:
          if (this.linePath != null) {
            sgworld.Creator.DeleteObject(this.linePath);
            this.linePath = null;
          }
          Viewer.dataSources.removeAll();
          break;
      }
    },
@@ -1448,7 +1506,6 @@
.mapBox {
  width: 100%;
  height: 100%;
  position: relative;
  #mapdiv {
    width: 100%;
@@ -1494,6 +1551,14 @@
        padding: 10px 20px;
      }
    }
    .pathAnalysisBox{
      width: 412px;
      height: 370px;
      z-index: 40;
      position: absolute;
      right: 8%;
      bottom: 1%;
    }
    .attributionPop{
      width: 350px;
      height: 370px;
@@ -1508,7 +1573,6 @@
        padding: 10px 20px;
      }
    }
    .terrainLevelBox {
      width: 350px;
      height: 370px;