From 0f6f73971c9c3db3d591018a8e6c2272ea07088a Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Mon, 28 Mar 2022 11:14:18 +0800
Subject: [PATCH] +抚州数据以及缩放调整,活动底图数据获取

---
 src/components/mobileActivity/index.vue |   72 +++++++++++++++++++++++++++++++++++-
 1 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/src/components/mobileActivity/index.vue b/src/components/mobileActivity/index.vue
index 8648b4d..7c60640 100644
--- a/src/components/mobileActivity/index.vue
+++ b/src/components/mobileActivity/index.vue
@@ -50,7 +50,7 @@
     <div class="mobileActivity_coutrol" :style="{ bottom: bottom + 'px' }">
       <ul>
         <li
-          v-for="(item, index) in leftNavData"
+          v-for="(item, index) in ourLeftData"
           :key="index"
           @click="mobileActivityCoutrolClick(item)"
           v-show="!item.notShow"
@@ -66,6 +66,8 @@
 <script>
 import { mapGetters } from "vuex";
 import moveWindow from "./move";
+import { getdetail } from "@/api/mobile/hd/hd";
+window.serviceMapSee = {};
 export default {
   name: "mobileActivity",
   computed: {
@@ -75,6 +77,9 @@
       // 'drawALineLayerMany',
       // 'drawAPointLayerMany'
     ]),
+    ourLeftData() {
+      return [...this.serviceMap, ...this.leftNavData];
+    },
   },
   data() {
     const heig = 135;
@@ -124,6 +129,19 @@
         //   layer: "sceneLayer",
         //   imgSrc: "img/leftnav/map-panorama.png",
         //   // imgSrc: "img/mobile/blue.png",
+        // },
+      ],
+      //底图
+      serviceMap: [
+        // {
+        //   flag: true,
+        //   label: "底图1",
+        //   img: "/img/leftnav/way-checked.png",
+        //   normal: "/img/leftnav/way.png",
+        //   checked: "/img/leftnav/way-checked.png",
+        //   layer: "wayLayer",
+        //   imgSrc: "img/mobile/green.png",
+        //   layer: null,
         // },
       ],
     };
@@ -190,6 +208,51 @@
               that.domMove.opens(false, true);
             },
           ]);
+
+          //绘画底图
+          //获取详细信息,来获取底图
+          // console.log(this.showActivityData, "see");
+          that.serviceMap = [];
+          getdetail(this.showActivityData.opendata.id).then((res) => {
+            let name = res.data.data.mapname.split(",");
+            let url = res.data.data.url.split(",");
+            for (let k in name) {
+              let d = {
+                flag: true,
+                label: name[k],
+                img: "/img/leftnav/way-checked.png",
+                normal: "/img/leftnav/way.png",
+                checked: "/img/leftnav/way-checked.png",
+                layer: "wayLayer",
+                imgSrc: "img/mobile/green.png",
+                layer: "serviceMap" + that.serviceMap.length,
+                url: url[k],
+                to: "serviceMap",
+              };
+              // this.leftNavData.shift(d);
+              // console.log(d, "see");
+              // that.serviceMap.push(d);
+              // window.serviceMapSee[d.layer] =
+              //   global.DC.ImageryLayerFactory.createArcGisImageryLayer({
+              //     url: url[k],
+              //   });
+              // global.viewer.addBaseLayer(window.serviceMapSee[d.layer], {
+              //   iconUrl: "examples/images/icon/elec.png",
+              //   name: d.layer,
+              // });
+            }
+            // const baselayer_shaded =
+            //   global.DC.ImageryLayerFactory.createArcGisImageryLayer({
+            //     url: "https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer",
+            //   });
+            // global.viewer.addBaseLayer(baselayer_shaded, {
+            //   iconUrl: "examples/images/icon/elec.png",
+            //   name: "电子",
+            // });
+
+            // console.log(window.serviceMapSee, "see");
+            // }
+          });
         };
       }
     },
@@ -270,6 +333,10 @@
         item.img = item.checked;
       } else {
         item.img = item.normal;
+      }
+      if (item.to == "serviceMap") {
+        console.log(item);
+        return;
       }
       this.$store.commit("showLineOrPoint", {
         layer: item.layer,
@@ -473,13 +540,14 @@
     margin-bottom: 6px;
     font-weight: 400;
     display: block;
-    width: 80px;
+    // width: 80px;
     height: 30px;
     line-height: 30px;
     background-color: #fff;
     border-radius: 15px;
     text-align: center;
     font-size: 0;
+    padding: 0 6px;
     cursor: pointer;
 
     img {

--
Gitblit v1.9.3