Bella 2 роки тому
батько
коміт
bdb2509a5a
2 змінених файлів з 17 додано та 33 видалено
  1. 7 15
      src/components/map/BasemapChange.vue
  2. 10 18
      src/components/map/MapHolder.vue

+ 7 - 15
src/components/map/BasemapChange.vue

@@ -44,12 +44,6 @@ export default {
       state: {
         // 图片数组
         images: [
-          {
-            src: require("@/assets/map/darkmap.png"),
-            type: 1,
-            active: "SEA",
-            defalut: "SE",
-          },
           {
             src: require("@/assets/map/sat2019.png"),
             type: 0,
@@ -62,6 +56,12 @@ export default {
             active: "DXA1",
             defalut: "DX1",
           },
+          {
+            src: require("@/assets/map/darkmap.png"),
+            type: 1,
+            active: "SEA",
+            defalut: "SE",
+          },
         ],
         rightPX: 50, // 每张图片距离右侧的距离 * index
       },
@@ -119,9 +119,6 @@ export default {
         case 0:
           // console.log("影像图");
           if (!map2DViewer.map.hasLayer(map2DViewer.layers["imagery"])) {
-            map2DViewer.map.options.crs = systemConfig.imageryLayer.crs;
-            map2DViewer.map.options.minZoom = systemConfig.imageryLayer.minZoom;
-            map2DViewer.map.options.maxZoom = systemConfig.imageryLayer.maxZoom;
             map2DViewer.map.hasLayer(map2DViewer.layers["darkmap"]) &&
               map2DViewer.map.removeLayer(map2DViewer.layers["darkmap"]);
             map2DViewer.map.hasLayer(map2DViewer.layers["imagery2"]) &&
@@ -132,9 +129,6 @@ export default {
         case 1:
           // console.log("蓝黑图");
           if (!map2DViewer.map.hasLayer(map2DViewer.layers["darkmap"])) {
-            map2DViewer.map.options.crs = systemConfig.blueBlackMap.crs;
-            map2DViewer.map.options.minZoom = systemConfig.blueBlackMap.minZoom;
-            map2DViewer.map.options.maxZoom = systemConfig.blueBlackMap.maxZoom;
             map2DViewer.map.hasLayer(map2DViewer.layers["imagery"]) &&
               map2DViewer.map.removeLayer(map2DViewer.layers["imagery"]);
             map2DViewer.map.hasLayer(map2DViewer.layers["imagery2"]) &&
@@ -144,13 +138,11 @@ export default {
           break;
         case 2:
           if (!map2DViewer.map.hasLayer(map2DViewer.layers["imagery2"])) {
-            map2DViewer.map.options.crs = systemConfig.imageryLayer.crs;
-            map2DViewer.map.options.minZoom = systemConfig.imageryLayer.minZoom;
-            map2DViewer.map.options.maxZoom = systemConfig.imageryLayer.maxZoom;
             map2DViewer.map.hasLayer(map2DViewer.layers["darkmap"]) &&
               map2DViewer.map.removeLayer(map2DViewer.layers["darkmap"]);
             map2DViewer.map.hasLayer(map2DViewer.layers["imagery"]) &&
               map2DViewer.map.removeLayer(map2DViewer.layers["imagery"]);
+              map2DViewer.map.addLayer(map2DViewer.layers["imagery2"]);
           }
       }
 

+ 10 - 18
src/components/map/MapHolder.vue

@@ -577,10 +577,10 @@ export default {
       );
 
       map2DViewer.map = L.map("map2DViewer", {
-        crs: systemConfig.blueBlackMap.crs,
+        crs: systemConfig.imageryLayer.crs,
         zoom: 1,
-        minZoom: systemConfig.blueBlackMap.minZoom,
-        maxZoom: systemConfig.blueBlackMap.maxZoom,
+        minZoom: systemConfig.imageryLayer.minZoom,
+        maxZoom: systemConfig.imageryLayer.maxZoom,
         attributionControl: false,
         zoomControl: false,
         // preferCanvas: true,
@@ -590,26 +590,18 @@ export default {
       let guid = publicFun.buildGuid("baseLayer");
       let layer = L.esri
         .tiledMapLayer({
-          // url:
-          // "http://10.242.182.25:9099/8639b723819f4b63940b93cc28e1b3ed/operation?APPID=00d494ff5d7b27fae263410627ba52bd&AUTHKEY=zCcyaym9MSkH1FT3&ClientId=com.pudong.002456271.00d494ff5d7b27fae263410627ba52bd&OperationCode=com.pudong.esb.catalog.8639b723819f4b63940b93cc28e1b3ed.operation&AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM"
-          // systemConfig.mapService +
-          // "?servertype=Street_Purplish_Blue&token=" +
-          // systemConfig.token,
-          // url: "http://aimap.pudong.sh:5236/zjmap/reproduction-service/maps/rest/services/sat-2018s2/proxy?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM",
-          // http://aimap.pudong.sh:5236/zjmap/reproduction-service/maps/rest/services/sat-2019s4/proxy?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM
-          // url: "http://aimap.pudong.sh:5236/maps/rest/services/basemap-shanghai-gem-blue-sh2000/mapserver",
           tileSize: 512,
-          url: systemConfig.blueBlackMap.url,
+          url: systemConfig.imageryLayer.url,
         })
         .addTo(map2DViewer.map);
-      map2DViewer.layers["darkmap"] = layer;
+      map2DViewer.layers["imagery"] = layer;
 
       // 加载遥感影像sat-2019s1
-      let imageryLayer = L.esri.tiledMapLayer({
-        tileSize: 512,
-        url: systemConfig.imageryLayer.url,
-      });
-      map2DViewer.layers["imagery"] = imageryLayer;
+      // let imageryLayer = L.esri.tiledMapLayer({
+      //   tileSize: 512,
+      //   url: systemConfig.imageryLayer.url,
+      // });
+      // map2DViewer.layers["imagery"] = imageryLayer;
       // 加载遥感影像sat-2018s2
       let imageryLayer2 = L.esri.tiledMapLayer({
         tileSize: 512,