wangcc 2 lat temu
rodzic
commit
8e1d1a1dba
1 zmienionych plików z 10 dodań i 5 usunięć
  1. 10 5
      src/components/amapPow.vue

+ 10 - 5
src/components/amapPow.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2022-10-19 09:32:46
  * @LastEditors: wangcc
- * @LastEditTime: 2022-11-11 14:48:00
+ * @LastEditTime: 2022-11-11 18:00:23
  * @FilePath: \castgroup_bigscreen\src\components\amapPow.vue
  * @Copyright: Copyright (c) 2016~2022 by wangcc, All Rights Reserved. 
 -->
@@ -120,7 +120,7 @@ export default {
         // 加载小班边界
         // this.getSmallClass();
         this.parentId = val;
-
+        console.log(this.$store.state.addr.selectStreet);
         if (this.$store.state.addr.mapLevel == 'street') {
           this.parentId = val.substring(0, 6);
           if (this.map) {
@@ -177,9 +177,12 @@ export default {
     },
     '$store.state.addr.selectStreet'(val) {
       if (val.label && val.value && val.areaId) {
+        let _this = this;
         this.map.remove(this.polygon);
         let labelTown = val.label;
+        console.log(val);
         this.map.setCity(labelTown);
+
       }
     },
     '$store.state.addr.page': {
@@ -507,8 +510,8 @@ export default {
             });
             this.projectSmallClassArr.push(projectSmallClass);
             if (this.$store.state.addr.mapLevel == 'district') {
-            this.map.setFitView(projectSmallClass, false, false, 12);
-          }
+              this.map.setFitView(projectSmallClass, false, false, 12);
+            }
             projectSmallClass.on('click', (e) => {
               if (_this.projectPolygonArr) {
                 _this.map.remove(_this.projectPolygonArr);
@@ -561,7 +564,6 @@ export default {
               });
             });
           });
-          
         }
       }
     }
@@ -1068,7 +1070,10 @@ export default {
           });
           let areaCode = areaPolygon.properties.name;
           district.search(areaCode, function (status, result) {
+            console.log(status);
+            console.log(result);
             let streetArr = result.districtList[0].districtList;
+            _this.zoom = result.districtList[0]
             for (let elementLs in streetArr) {
               _this.streetMarker = new AMap.Text({
                 //c城市指示标