wang_xy 2 роки тому
батько
коміт
2dead63a8a
3 змінених файлів з 85 додано та 6 видалено
  1. 79 0
      src/components/supermap-2.5d.vue
  2. 2 2
      src/router/index.js
  3. 4 4
      src/utils/request.js

+ 79 - 0
src/components/supermap-2.5d.vue

@@ -227,6 +227,85 @@ export default {
       that.createRightClickDescription();
     },
     /**
+     * 地图落点
+     */
+    setMarkers(makerList){
+      let that = this;
+      that.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
+      clearInterval(that.aac);
+      for (let i in makerList) {
+        let longitude = makerList[i].lng;
+        let latitude = makerList[i].lat;
+        that.viewer.entities.add({
+          name:"",
+          position: Cesium.Cartesian3.fromDegrees(longitude, latitude),
+          billboard: {
+            image: iconList[makerList[i].icon],
+            width: 48,
+            height: 48,
+            heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+            disableDepthTestDistance:Number.POSITIVE_INFINITY
+          },
+          description: makerList[i].bindPopupHtml,
+          click: makerList[i].click,
+          parameter: makerList[i].parameter,
+        });
+      }
+      // const carmodel = [];
+      // carmodel[0] = that.viewer.entities.add({
+      //   name:"",
+      //   position: Cesium.Cartesian3.fromDegrees(makerList[0].lng, makerList[0].lat),
+      //   billboard: {
+      //     image: iconList[makerList[0].icon],
+      //     width: 48,
+      //     height: 48,
+      //     heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+      //     disableDepthTestDistance:Number.POSITIVE_INFINITY
+      //   },
+      //   description: makerList[0].bindPopupHtml,
+      //   click: makerList[0].click,
+      //   parameter: makerList[0].parameter,
+      // });
+      // carmodel[0].ellipse = {
+      //   semiMinorAxis: makerList[0].radius
+      //   semiMajorAxis: makerList[0].radius
+      //   height: 0.0,
+      //   material: Cesium.Color.RED.withAlpha(e),
+      //   outline: true,
+      //   outlineColor: Cesium.Color.BLUE.withAlpha(0.5),
+      //   outlineWidth: 2,
+      //   heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+      // }
+      // carmodel[1] = that.viewer.entities.add({
+      //   name:"",
+      //   position: Cesium.Cartesian3.fromDegrees(makerList[1].lng, makerList[1].lat),
+      //   billboard: {
+      //     image: iconList[makerList[1].icon],
+      //     width: 48,
+      //     height: 48,
+      //     heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+      //     disableDepthTestDistance:Number.POSITIVE_INFINITY
+      //   },
+      //   description: makerList[1].bindPopupHtml,
+      //   click: makerList[1].click,
+      //   parameter: makerList[1].parameter,
+      // });
+      // carmodel[0].ellipse = {
+      //   semiMinorAxis: makerList[0].radius
+      //   semiMajorAxis: makerList[0].radius
+      //   height: 0.0,
+      //   material: Cesium.Color.RED.withAlpha(e),
+      //   outline: true,
+      //   outlineColor: Cesium.Color.BLUE.withAlpha(0.5),
+      //   outlineWidth: 2,
+      //   heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+      // }
+
+      that.viewer.scene.globe.depthTestAgainstTerrain=false;
+      that.createLeftClickDescription();
+      that.createRightClickDescription();
+    },
+    /**
      *鼠标左击事件是原来的气泡
      */
     createLeftClickDescription() {

+ 2 - 2
src/router/index.js

@@ -31,7 +31,7 @@ import Layout from '@/layout'
 // 公共路由(可视化首页头部链接)
 export const constantRoutes = [{
 		path: '/',
-		redirect: 'datacenter',
+		redirect: 'forest',
 	},
 	{
 		//林业中心
@@ -91,7 +91,7 @@ export const constantRoutes = [{
 // 公共路由
 export const constantRoutesNew = [{
 		path: '/',
-		redirect: 'datacenter',
+		redirect: 'forest',
 	},
 	{
 		//林业中心

+ 4 - 4
src/utils/request.js

@@ -59,8 +59,8 @@ service.interceptors.request.use(config => {
       if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
         const message = '数据正在处理,请勿重复提交';
         console.warn(`[${s_url}]: ` + message)
-        //Promise.reject(new Error(message))
-        return null
+        // Promise.reject(new Error(message))
+        return
       } else {
         cache.session.setJSON('sessionObj', requestObj)
       }
@@ -134,8 +134,8 @@ service.interceptors.response.use(res => {
       type: 'error',
       duration: 5 * 1000
     })
-    //Promise.reject(error)
-    return null
+    // Promise.reject(error)
+    return
   }
 )