فهرست منبع

1. 标记疑点图标样式调整;2. 图例跟随右侧面板移动;3.切换到综合分析scale调整

Bella 2 سال پیش
والد
کامیت
8ba159c893
3فایلهای تغییر یافته به همراه86 افزوده شده و 63 حذف شده
  1. 3 3
      src/assets/global.css
  2. 78 59
      src/components/map/MapHolder.vue
  3. 5 1
      src/views/ComprehensiveAnalysis.vue

+ 3 - 3
src/assets/global.css

@@ -299,10 +299,10 @@ body iframe {
   z-index: -1;
 }
 
-.leaflet-touch .leaflet-bar a {
+.leaflet-bar{
   position: fixed;
-  left: 23%;
-  top: 150px;
+  left: 300px;
+  top: 50px;
   z-index: 100000000000000000;
 }
 

+ 78 - 59
src/components/map/MapHolder.vue

@@ -1,5 +1,10 @@
 <template>
-  <div id="map2DViewer">
+  <div
+    id="map2DViewer"
+    :class="
+      $ifMenu('1', '') || $ifMenu('2', '') ? 'scaleClass' : 'unScaleClass'
+    "
+  >
     <!-- 特殊地图属性弹窗 -- 有审计功能 -->
     <CaseAuditPopup
       v-show="auditPopupShow"
@@ -743,62 +748,67 @@ export default {
     getJSonData() {
       if (!map2DViewer.map) {
         this.mapInit();
-      } else if (
-        // 切换到首页和疑点筛查页且图层不存在时重新渲染区域图
-        this.$ifMenu("1", "") &&
-        !map2DViewer.map.hasLayer(map2DViewer.groups["浦东新区_polygon"])
-      ) {
-        this.getJSonDataToStreet("", "");
-        // 切换到首页时需定位到当前图层
-        if (this.$store.state.homeSpecialTown === "全部") {
-          this.setView(
-            townLocationMap.get(this.$store.state.homeSpecialTown),
-            1
-          );
-        } else {
-          let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);
-          map2DViewer.map.fitBounds(polygon.getBounds());
-        }
-      } else if (this.$ifMenu("2", "5")) {
-        this.getJSonDataToStreet("", "");
-        // 切换到镇域专题是时均往左偏移一些
-        if (this.$store.state.homeSpecialTown === "全部") {
-          let locationArr = townLocationMap.get(
-            this.$store.state.homeSpecialTown
-          );
-          this.setView([locationArr[0], locationArr[1] + 0.15], 1);
-        } else {
-          let locationArr = townLocationMap.get(
-            this.$store.state.homeSpecialTown
-          );
-          this.setView([locationArr[0], locationArr[1]], 5);
-          // let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);
-          // map2DViewer.map.fitBounds(polygon.getBounds());
-        }
-      } else if (
-        this.$ifMenu("2", "1") ||
-        this.$ifMenu("2", "2") ||
-        this.$ifMenu("2", "3") ||
-        this.$ifMenu("2", "4")
-      ) {
-        this.getJSonDataToStreet("", "");
-        // 切换到疑点筛查时均往右偏移一些
-        if (this.$store.state.homeSpecialTown === "全部") {
-          this.setView(
-            townLocationMap.get(this.$store.state.homeSpecialTown),
-            1
-          );
-        } else {
-          let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);
-          map2DViewer.map.fitBounds(polygon.getBounds());
+      } else {
+        if (
+          // 切换到首页和疑点筛查页且图层不存在时重新渲染区域图
+          this.$ifMenu("1", "") &&
+          !map2DViewer.map.hasLayer(map2DViewer.groups["浦东新区_polygon"])
+        ) {
+          this.getJSonDataToStreet("", "");
+          // 切换到首页时需定位到当前图层
+          if (this.$store.state.homeSpecialTown === "全部") {
+            this.setView(
+              townLocationMap.get(this.$store.state.homeSpecialTown),
+              1
+            );
+          } else {
+            let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);
+            map2DViewer.map.fitBounds(polygon.getBounds());
+          }
+        } else if (this.$ifMenu("2", "5")) {
+          this.getJSonDataToStreet("", "");
+          // 切换到镇域专题是时均往左偏移一些
+          if (this.$store.state.homeSpecialTown === "全部") {
+            let locationArr = townLocationMap.get(
+              this.$store.state.homeSpecialTown
+            );
+            this.setView([locationArr[0], locationArr[1] + 0.15], 1);
+          } else {
+            let locationArr = townLocationMap.get(
+              this.$store.state.homeSpecialTown
+            );
+            this.setView([locationArr[0], locationArr[1]], 5);
+            // let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);
+            // map2DViewer.map.fitBounds(polygon.getBounds());
+          }
+        } else if (
+          this.$ifMenu("2", "1") ||
+          this.$ifMenu("2", "2") ||
+          this.$ifMenu("2", "3") ||
+          this.$ifMenu("2", "4")
+        ) {
+          this.getJSonDataToStreet("", "");
+          // 切换到疑点筛查时均往右偏移一些
+          if (this.$store.state.homeSpecialTown === "全部") {
+            this.setView(
+              townLocationMap.get(this.$store.state.homeSpecialTown),
+              1
+            );
+          } else {
+            let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);
+            map2DViewer.map.fitBounds(polygon.getBounds());
+          }
+        } else if (
+          !(this.$ifMenu("1", "") || this.$ifMenu("2", "")) &&
+          map2DViewer.map.hasLayer(map2DViewer.groups["浦东新区_polygon"])
+        ) {
+          // 当前页不是首页和疑点筛查页时移除区域图且图层存在时
+          map2DViewer.groups["浦东新区_label"].remove();
+          map2DViewer.groups["浦东新区_polygon"].remove();
         }
-      } else if (
-        !(this.$ifMenu("1", "") || this.$ifMenu("2", "")) &&
-        map2DViewer.map.hasLayer(map2DViewer.groups["浦东新区_polygon"])
-      ) {
-        // 当前页不是首页和疑点筛查页时移除区域图且图层存在时
-        map2DViewer.groups["浦东新区_label"].remove();
-        map2DViewer.groups["浦东新区_polygon"].remove();
+        setTimeout(() => {
+          map2DViewer.map.invalidateSize(true);
+        }, 500);
       }
     },
     setView: function (coord, zoom) {
@@ -1132,12 +1142,21 @@ export default {
 <style lang="less" scoped>
 #map2DViewer {
   position: absolute;
-  width: 200vw;
-  height: 200vh;
   background-color: rgb(0, 47, 71);
   z-index: 1;
+}
+.scaleClass {
+  width: 200vw;
+  height: 200vh;
   top: -50vh;
   left: -50vw;
-  transform:scale(0.62);
+  transform: scale(0.62);
+}
+.unScaleClass {
+  width: 100vw;
+  height: calc(100vh - 60px);
+  top: 60px;
+  left: 0px;
+  transform: scale(1);
 }
 </style>

+ 5 - 1
src/views/ComprehensiveAnalysis.vue

@@ -141,6 +141,7 @@
     <Legend
       v-show="legendShow"
       class="comprehensive-analysis-legendbox"
+      :class="{'closePanel':rightBoxBtn}"
       @deleteLegend="deleteLegend"
       :legendData="{
         deleteLegendEdit: true,
@@ -2926,8 +2927,11 @@ export default {
   &-legendbox {
     position: absolute;
     right: 410px;
-    top: 30px;
+    top: 40px;
     z-index: 1;
+    &.closePanel{
+      right:30px;
+    }
   }
   /* 弹窗 */
   &-popup {