Pārlūkot izejas kodu

首页页面全部街镇地图定位异常修复。

DESKTOP-6LTVLN7\Liumouren 2 gadi atpakaļ
vecāks
revīzija
9a6a680970

+ 3 - 3
public/static/config/config.js

@@ -11,8 +11,8 @@ var systemConfig = {
   latCorrectParams:-0.00018,
   assetsUrl: "http://localhost:2013",
   mapViewer: {
-    center: [31.095589678244445, 121.72894516017521],
-    zoom: 6,
+    center: [31.14785322514787, 121.50195320451814],
+    zoom: 1,
   },
   // 暂时无法使用
   // token: "65463DEE-620A-0ED5-2385-17ECD07CD351", //公共地图资源token
@@ -49,7 +49,7 @@ var myLabelNameMap = new Map();
 
 // 存储各镇域中心区域位置
 var townLocationMap = new Map();
-townLocationMap.set("全部", [31.105589678244445, 121.67894516017521]);
+townLocationMap.set("全部", [31.14785322514787, 121.50195320451814]);
 
 // 各镇域几何体 -- 方便定位
 var townPolygonMap = new Map();

+ 2 - 2
src/components/map/Map.vue

@@ -85,8 +85,8 @@ export default {
       );
       this.map = L.map(this.$refs.map, {
         crs: crs,
-        zoom: 2,
-        minZoom: 1,
+        zoom: 1,
+        minZoom: 0,
         maxZoom: 6,
         attributionControl: false,
         zoomControl: false,

+ 4 - 4
src/components/map/MapHolder.vue

@@ -534,11 +534,11 @@ export default {
 
       map2DViewer.map = L.map("map2DViewer", {
         crs: crs,
-        zoom: 0,
+        zoom: 1,
         minZoom: 0,
-        maxZoom: 8,
+        maxZoom: 6,
         attributionControl: false,
-        zoomControl: false
+        zoomControl: true
         // preferCanvas: true,
       }).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
 
@@ -624,7 +624,7 @@ export default {
         if (this.$store.state.homeSpecialTown === "全部") {
           this.setView(
             townLocationMap.get(this.$store.state.homeSpecialTown),
-            10
+            1
           );
         } else {
           let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);

+ 1 - 1
src/views/ComprehensiveAnalysis.vue

@@ -1661,7 +1661,7 @@ export default {
         if (data.featureType === "点") {
           this.$store.state.mapMethodsCollection
             .get("RENDER")
-            .setView(data.coord, 16);
+            .setView(data.coord, 6);
         } else {
           map2DViewer.map.fitBounds(
             map2DViewer.myLabels[`label_${data.id}`].getBounds()

+ 2 - 2
src/views/HomeView.vue

@@ -350,7 +350,7 @@ export default {
     homeSelect(val) {
       this.$store.commit("changeHomeSpecialTown", val);
       if (val === "全部") {
-        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 10);
+        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 1);
       } else {
         let polygon = townPolygonMap.get(val);
         map2DViewer.map.fitBounds(polygon.getBounds());
@@ -360,7 +360,7 @@ export default {
     specialTownSelect(val) {
       this.$store.commit("changeHomeSpecialTown", val);
       if (val === "全部") {
-        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 10);
+        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 1);
       } else {
         let polygon = townPolygonMap.get(val);
         map2DViewer.map.fitBounds(polygon.getBounds());