管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2023-02-01 dda0e6f581e8c2b116f2eae53756d80215d6e5e0
src/components/mapsdk.vue
@@ -270,6 +270,7 @@
import {
  select_Comprehensive_ByPageAndCount,
  select_Comprehensive_SelectWktById,
  comprehensive_selectRoute
} from '../api/api';
export default {
  name: '',
@@ -354,23 +355,23 @@
      });
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.UrlTemplateImageryProvider({
          url:  gaoDeBaseUrl[0].url,
          url: gaoDeBaseUrl[0].url,
        })
      );
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.UrlTemplateImageryProvider({
          url:  gaoDeBaseUrl[1].url,
          url: gaoDeBaseUrl[1].url,
        })
      );
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.UrlTemplateImageryProvider({
          url:  gaoDeBaseUrl[2].url,
          url: gaoDeBaseUrl[2].url,
        })
      );
@@ -422,15 +423,15 @@
      window.elevationTool = new SmartEarth.ElevationTool(window.sgworld);
      elevationTool.setContourColor('#F1D487');
      var helper = new Cesium.EventHelper();
      helper.add(Viewer.scene.globe.tileLoadProgressEvent, function (e) {
     if (e == 0) {
console.log("这个是加载最后一个矢量切片的回调");
}
        helper.removeAll();
        helper = undefined;
      });
      // var helper = new Cesium.EventHelper();
      // helper.add(Viewer.scene.globe.tileLoadProgressEvent, function (e) {
      //   if (e == 0) {
      //     console.log("这个是加载最后一个矢量切片的回调");
      //   }
      //   helper.removeAll();
      //   helper = undefined;
      // });
@@ -621,29 +622,54 @@
          break;
      }
    },
    showMouseLeftClick(res) {
    async showMouseLeftClick(res) {
      if (res == 3) {
        if (this.linePath != null) {
          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])
        }
        var jsonurl =
          wnsUrl +
          '?start=' +
          this.pathFrom.lon +
          '&end=' +
          this.pathFrom.lat +
          '&propertyName=Shape&tolerance=500&request=FindPath&format=json';
        $.ajax({
          url: jsonurl,
          async: false,
          type: 'GET',
          dataType: 'json',
          contentType: 'application/json;charset=utf-8',
          success: (data) => {
            this.executeFly3D(data);
          },
        });
        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);
        }
        )
        // var jsonurl =
        //   wnsUrl +
        //   '?start=' +
        //   this.pathFrom.lon +
        //   '&end=' +
        //   this.pathFrom.lat +
        //   '&propertyName=Shape&tolerance=500&request=FindPath&format=json';
        // $.ajax({
        //   url: jsonurl,
        //   async: false,
        //   type: 'GET',
        //   dataType: 'json',
        //   contentType: 'application/json;charset=utf-8',
        //   success: (data) => {
        //     this.executeFly3D(data);
        //   },
        // });
      } else {
        var that = this;
        if (this.handler != null) {
@@ -744,6 +770,8 @@
            sgworld.Creator.DeleteObject(this.linePath);
            this.linePath = null;
          }
          Viewer.dataSources.removeAll( )
          break;
        case 4:
          if (this.linePath != null) {