wang_xy 2 年之前
父节点
当前提交
9307c4ab56
共有 3 个文件被更改,包括 116 次插入46 次删除
  1. 109 39
      src/components/supermap-2.5d.vue
  2. 1 0
      src/components/vBottomMenu.vue
  3. 6 7
      src/views/monitor.vue

+ 109 - 39
src/components/supermap-2.5d.vue

@@ -1,5 +1,5 @@
 <template>
-    <div id="cesium-container" style="width: 100%; height: 100%;background: none;">
+    <div id="cesiumContainer" style="width: 100%; height: 100%;background: none;">
 
     </div>
 
@@ -11,17 +11,20 @@
 	export default {
 		name: 'sookaSuperMap',
 		data() {
-			return {
+      return {
         viewer:null,
         scene:null,
         handler:null,
-
         pick:null,
         back_position:null,
         content:null,
-        stkTerrainProvider:null,
-
-        aac:null,//定时
+        mvtMap0:null,
+        shuixi_name:null,
+        mvtMap1:null,
+        mvtMap2:null,
+        mvtMap3:null,
+        road_name:null,
+        layer_xiangzhenjie_name:null,
         /*************************原地图属性*********************/
         isEditableLayers: false, //绘图控件
 
@@ -31,42 +34,109 @@
 		watch: {
     },
 		mounted() {
-      this.viewer = new Cesium.Viewer('cesium-container')
-      //添加SuperMap iServer发布的影像服务
-      // var layer = this.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
-      //   url: 'http://121.36.228.94:8090/iserver/services/3D-sipingchangjing/rest/realspace'
-      // }));
-      // //添加SuperMap iServer发布的影像服务
-      // var layer1 = this.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
-      //   url: 'http://121.36.228.94:8090/iserver/services/map-spyx4326/rest/maps/dem'
-      // }));
-
-      this.scene = this.viewer.scene;
-      this.scene.lightSource.ambientLightColor = new Cesium.Color(0.65, 0.65, 0.65, 1);
-      var urlStr = 'http://121.36.228.94:8090/iserver/services/3D-sipingchangjing/rest/realspace';
-      this.scene.open(urlStr);
-
-      //将三维球定位到指定位置,camera是相机,是当前视野范围相机
-      //destination是相机的目标位置,参数是经度、纬度、高度
-      //orientation是相机朝向
-      //    heading-代表镜头左右方向,正值为右,负值为左
-      //    pitch-代表镜头上下方向,正值为上,负值为下.
-      //    roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
-      this.viewer.camera.flyTo({
-        destination: Cesium.Cartesian3.fromDegrees(124.5465087890625, 43.0869197845459, 25000),
-        orientation: {
-          heading :  Cesium.Math.toRadians(348.4202942851978),
-          pitch : Cesium.Math.toRadians(-30.74026687972041),
-          roll : Cesium.Math.toRadians(0)
-        },
-        complete:function callback() {
-          // 定位完成之后的回调函数
-
-        }
-      });
+      this.onload();
     },
 		props: {},
 		methods: {
+      onload() {
+        let that = this;
+        //1.添加地形数据
+        that.viewer = new Cesium.Viewer('cesiumContainer', {
+          //创建地形服务提供者的实例,url为SuperMap iServer发布的TIN地形服务
+          terrainProvider: new Cesium.CesiumTerrainProvider({
+            url: "http://121.36.228.94:8090/iserver/services/3D-sipingchangjing/rest/realspace/datas/dem%40spyx4326",
+            //isSct : false,//地形服务源自SuperMap iServer发布时需设置isSct为true
+            invisibility: true
+          }),
+          infoBox: true
+        }, {
+          contextOptions: {
+            msaaLevel: 4,
+            requestWebgl2: true
+          },
+          orderIndependentTranslucency: false
+        });
+        that.viewer.cesiumWidget.creditContainer.style.display = "none" // 去掉超图logo水印
+        this.scene = this.viewer.scene;
+        //2.添加SuperMap iServer发布的影像服务
+        let layer = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+          url: "http://121.36.228.94:8090/iserver/services/3D-sipingchangjing/rest/realspace/datas/siping_2m@spyx4326",
+        }));
+        //3.添加县界
+        // let layer_xianjie = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+        //   url : "http://121.36.228.94:8090/iserver/services/map-SIPING/rest/maps/XianJie",
+        // }));
+        //4.添加乡镇界
+        let layer_xiangzhenjie = that.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+          url: "http://121.36.228.94:8090/iserver/services/map-SIPING/rest/maps/XiangZhenJie",
+        }));
+        // //5.水系
+        // let shuixi = "http://121.36.228.94:8090/iserver/services/map-mvt-shuixiMian/restjsr/v1/vectortile/maps/shuixi_Mian";
+        // this.mvtMap0 = scene.addVectorTilesMap({
+        //   url: shuixi,
+        //   canvasWidth: 512,
+        //   name: 'mvt_map0',
+        //   viewer: this.viewer,
+        //   // show: true,
+        //   // selectedColor: new Cesium.Color(6, 169, 254, 0.5)
+        // });
+        // //6.林地
+        // let lindi = "http://121.36.228.94:8090/iserver/services/map-mvt-lindi/restjsr/v1/vectortile/maps/lindi";
+        // this.mvtMap1 = scene.addVectorTilesMap({
+        //   url: lindi,
+        //   canvasWidth: 512,
+        //   name: 'mvt_map1',
+        //   viewer: this.viewer,
+        //   show:true,
+        //   selectedColor:new Cesium.Color(6,169,254,0.5)
+        // });
+        // //7.农田
+        // let nongtian = "http://121.36.228.94:8090/iserver/services/map-mvt-nongtian/restjsr/v1/vectortile/maps/nongtian";
+        // this.mvtMap2 = scene.addVectorTilesMap({
+        //   url: nongtian,
+        //   canvasWidth: 512,
+        //   name: 'mvt_map2',
+        //   viewer: this.viewer,
+        //   show:true,
+        //   selectedColor:new Cesium.Color(6,169,254,0.5)
+        // });
+        // //8.路网
+        // let road = "http://121.36.228.94:8090/iserver/services/map-mvt-roadXian/restjsr/v1/vectortile/maps/road_Xian";
+        // this.mvtMap3 = scene.addVectorTilesMap({
+        //   url: road,
+        //   canvasWidth: 512,
+        //   name: 'mvt_map3',
+        //   viewer: this.viewer,
+        //   show:true,
+        //   selectedColor:new Cesium.Color(6,169,254,0.5)
+        // });
+        // //9.添加路网NAME
+        // this.road_name = this.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+        //   url : "http://121.36.228.94:8090/iserver/services/map-SIPING/rest/maps/road_Name",
+        //   show : false
+        // }));
+        // // 10.添加水系NAME
+        // this.shuixi_name = this.viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+        //   url: "http://121.36.228.94:8090/iserver/services/map-SIPING/rest/maps/shuixi_Name",
+        //   show: false
+        // }));
+
+        //11.添加乡镇界名称
+        let layer_xiangzhenjie_name = 'http://121.36.228.94:8090/iserver/services/3D-XiangZhenJie_Name/rest/realspace';
+        this.scene.open(layer_xiangzhenjie_name);
+
+        //    heading-代表镜头左右方向,正值为右,负值为左
+        //    pitch-代表镜头上下方向,正值为上,负值为下.
+        //    roll-代表镜头左右倾斜,正值,向右倾斜,负值向左倾斜
+        that.viewer.camera.setView({
+          destination: Cesium.Cartesian3.fromDegrees(124.49980650138238, 43.428263986216815, 350000),
+          orientation: {
+            // heading :  Cesium.Math.toRadians(346.4202942851978),
+            // pitch : Cesium.Math.toRadians(-16.74026687972041),
+            // roll : Cesium.Math.toRadians(0)
+          }
+        });
+      },
       //移除之前添加的点
       clearM(){
         this.viewer.entities.removeAll();

+ 1 - 0
src/components/vBottomMenu.vue

@@ -363,6 +363,7 @@
 	import {
 		treeselectAll as deptTreeselect
 	} from '@/api/system/dept'
+  import { selectConfigKey } from "@/api/system/config";
 	import supermapTaskDialog from '@/components/supermap' //超图
 	import TcPlayer from '@/components/TcPlayer' //视频预览
   import Cookies from 'js-cookie';

+ 6 - 7
src/views/monitor.vue

@@ -218,8 +218,8 @@ export default {
     this.bottomMenuList() //获取底部公共组件消息和任务
     this.getTreeselect()
     this.deptId = Cookies.get("deptId")
-    this.getSensorListByDeptId()
-    this.getDlblistBydeptId()
+    // this.getSensorListByDeptId()
+    // this.getDlblistBydeptId()
     this.selectDeviceType(-1)
     // this.showTVWall();
   },
@@ -617,11 +617,10 @@ export default {
             this.sourceData.push(aa)
           }
         }
-
+debugger
         that.visuForestCloudCameraBOList = res.data.visuForestCloudCameraBOList
         that.visuForestCloudCameraBOListSearch = res.data.visuForestCloudCameraBOList
-        if (res.data.visuForestCloudCameraBOList != null && res.data.visuForestCloudCameraBOList
-          .length > 0) {
+        if (res.data.visuForestCloudCameraBOList != null && res.data.visuForestCloudCameraBOList.length > 0) {
           for (let i = 0; i < res.data.visuForestCloudCameraBOList.length; i++) {
             let markersMap = {
               lng: 124.59,
@@ -701,7 +700,7 @@ export default {
           setTimeout(() => {
             that.$refs.supermap.clearM()
             that.$refs.supermap.setMarkers(this.cameraMarkersList)
-          }, 1000)
+          }, 3000)
         }
       })
     },
@@ -780,7 +779,7 @@ export default {
           setTimeout(() => {
             that.$refs.supermap.clearM()
             that.$refs.supermap.setMarkers(this.cameraMarkersList)
-          }, 1000)
+          }, 3000)
         } else {
           that.$refs.supermap.clearM()
         }