From 24b0b99f7125880bdee544caec0bd68d372050ab Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 07 Dec 2023 16:17:51 +0800
Subject: [PATCH] 更换底图

---
 src/components/mobilemap/index.vue           |   21 +++++-----
 src/components/arcNavBar/index.vue           |    5 ++
 src/components/mobileCortrolButtom/index.vue |    4 +-
 src/components/map/index.vue                 |   23 ++++++-----
 src/store/modules/openlayerData.js           |   42 +--------------------
 5 files changed, 32 insertions(+), 63 deletions(-)

diff --git a/src/components/arcNavBar/index.vue b/src/components/arcNavBar/index.vue
index cf41d18..bd7f3d0 100644
--- a/src/components/arcNavBar/index.vue
+++ b/src/components/arcNavBar/index.vue
@@ -193,7 +193,10 @@
                             item,
                             text: item.mechanismName,
                             url: this.publicPath + 'img/icon/bubble.png',
-                            anchor: [16, 34]
+                            anchor: [16, 34],
+                            event: (e) => {
+                                that.mapPopup(item)
+                            }
                         }))
                     })
 
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index 8112c63..262de91 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -47,17 +47,19 @@
 let campusLayers = [
     {
         key: 1,
-        tileUrl: "https://fkxt.jxstnu.edu.cn/changjing/arcgis/rest/services/ksd1/MapServer/tile/{z}/{y}/{x}",
-        center: [112.63716735643777, -0.087080937773012637833],
-        resolution: 0.00014276766034981682,
-        origin: [-400.0, 399.9999999999998],
+        tileUrl: "https://fkxt.jxstnu.edu.cn/changjing/arcgis/rest/services/ksd1206/MapServer/tile/{z}/{y}/{x}",
+        center: [10800, -4900],
+        resolution: 4.233341800016934,
+        origin: [-5123200.0, 10002100],
+        projection: 'EPSG:4548',
         resolutions: [
-            0.00019035688046642243, 0.00014276766034981682, 0.00009517844023321122,
-            0.00004758922011660561,
+            16.933367200067735, 8.466683600033868, 4.233341800016934,
+            2.116670900008467, 1.0583354500042335, 0.5291677250021167,
+            0.26458386250105836
         ],
         fullExtent: [
-            112.51302281804038, -0.17416638494176828, 112.76131189483516,
-            0.000004509395743004334,
+            -0.5, -11468.5, 18506.5,
+            0.5,
         ],
         polygonUrl: 'https://fkxt.jxstnu.edu.cn/changjing/lkarcgisapp'
     },
@@ -68,6 +70,7 @@
         center: [115.79624983, 28.6416099],
         resolution: 0.000007138383017490841,
         origin: [-400.0, 400.0],
+        projection: '4548',
         resolutions: [
             0.000014276766034981682, 0.000007138383017490841, 0.00000475892201166056,
             0.00000237946100583028,
@@ -398,7 +401,7 @@
             // 瓦片数据源
             const tileArcGISXYZ = new XYZ({
                 tileGrid: tileGrid,
-                projection: "EPSG:4326",
+                // projection: curCampus.projection,
                 url: curCampus.tileUrl,
             })
 
@@ -428,7 +431,7 @@
                 // 初始化中心点坐标
                 center: curCampus.center,
                 resolution: curCampus.resolution,
-                projection: "EPSG:4326",
+                // projection: curCampus.projection,
                 extent: curCampus.fullExtent,
             }))
         }
diff --git a/src/components/mobileCortrolButtom/index.vue b/src/components/mobileCortrolButtom/index.vue
index 0e079e3..6a19ac7 100644
--- a/src/components/mobileCortrolButtom/index.vue
+++ b/src/components/mobileCortrolButtom/index.vue
@@ -195,8 +195,8 @@
             //     }
             //     return;
             //   }
-            this.map2D.getView().setCenter([112.63716735643777, -0.087080937773012637833])
-            this.map2D.getView().setResolution(0.00009517844023321122)
+            this.map2D.getView().setCenter([11000, -4900])
+            this.map2D.getView().setResolution(2.116670900008467)
         },
 
         openActivity () {
diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index 5ba092b..114fb4d 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -81,20 +81,23 @@
 let campusLayers = [
     {
         key: 1,
-        tileUrl: "https://fkxt.jxstnu.edu.cn/changjing/arcgis/rest/services/ksd1/MapServer/tile/{z}/{y}/{x}",
-        center: [112.63716735643777, -0.087080937773012637833],
-        resolution: 0.00014276766034981682,
-        origin: [-400.0, 399.9999999999998],
+        tileUrl: "https://fkxt.jxstnu.edu.cn/changjing/arcgis/rest/services/ksd1206/MapServer/tile/{z}/{y}/{x}",
+        center: [11000, -4900],
+        resolution: 2.116670900008467,
+        origin: [-5123200.0, 10002100],
+        projection: 'EPSG:4548',
         resolutions: [
-            0.00019035688046642243, 0.00014276766034981682, 0.00009517844023321122,
-            0.00004758922011660561,
+            16.933367200067735, 8.466683600033868, 4.233341800016934,
+            2.116670900008467, 1.0583354500042335, 0.5291677250021167,
+            0.26458386250105836
         ],
         fullExtent: [
-            112.51302281804038, -0.17416638494176828, 112.76131189483516,
-            0.000004509395743004334,
+            -0.5, -11468.5, 18506.5,
+            0.5,
         ],
         polygonUrl: 'https://fkxt.jxstnu.edu.cn/changjing/lkarcgisapp'
     },
+
     {
         key: 2,
         tileUrl: "https://dev.jxpskj.com:8023/arcgis156/rest/services/cc/MapServer/tile/{z}/{y}/{x}",
@@ -392,7 +395,6 @@
             // 瓦片数据源
             const tileArcGISXYZ = new XYZ({
                 tileGrid: tileGrid,
-                projection: "EPSG:4326",
                 url: curCampus.tileUrl,
             })
 
@@ -422,7 +424,6 @@
                 // 初始化中心点坐标
                 center: curCampus.center,
                 resolution: curCampus.resolution,
-                projection: "EPSG:4326",
                 extent: curCampus.fullExtent,
             }))
         },
diff --git a/src/store/modules/openlayerData.js b/src/store/modules/openlayerData.js
index 292dc53..a6bf70a 100644
--- a/src/store/modules/openlayerData.js
+++ b/src/store/modules/openlayerData.js
@@ -42,32 +42,6 @@
 
 import TilegridTileGrid from "ol/tilegrid/TileGrid";
 
-const tileUrl =
-  "https://fkxt.jxstnu.edu.cn/changjing/arcgis/rest/services/ksd1/MapServer/tile/{z}/{y}/{x}";
-// 坐标原点
-const origin = [-400.0, 399.9999999999998];
-// 分辨率
-const resolutions = [
-  0.00019035688046642243, 0.00014276766034981682, 0.00009517844023321122,
-  0.00004758922011660561,
-];
-const fullExtent = [
-  112.51302281804038, -0.17416638494176828, 112.76131189483516,
-  0.000004509395743004334,
-];
-const tileGrid = new TilegridTileGrid({
-  tileSize: 256,
-  origin: origin,
-  extent: fullExtent,
-  resolutions: resolutions,
-});
-// 瓦片数据源
-const tileArcGISXYZ = new XYZ({
-  tileGrid: tileGrid,
-  projection: "EPSG:4326",
-  url: tileUrl,
-});
-
 const openlayerData = {
   state: {
     mapscene: {
@@ -75,20 +49,8 @@
     },
     openlayers: {
       map2D: new OlMap({
-        layers: [
-          // 瓦片图层
-          //   new OlLayerTile({
-          //     source: tileArcGISXYZ,
-          //   }),
-        ],
-        view: new OlView({
-          // 初始化中心点坐标
-          //   center: [112.63716735643777, -0.087080937773012637833],
-          // 注意:此处指定缩放级别不能通过zoom来指定,指定了也无效,必须通过resolution来指定
-          //   resolution: 0.00014276766034981682,
-          projection: "EPSG:4326",
-          //   extent: fullExtent,
-        }),
+        layers: [],
+        view: new OlView({}),
       }),
       map3D: null,
 

--
Gitblit v1.9.3