Pārlūkot izejas kodu

fix: 移除地圖上多餘的「勤務路線」

sequoia tungfang 2 nedēļas atpakaļ
vecāks
revīzija
4209f874e5
1 mainītis faili ar 4 papildinājumiem un 11 dzēšanām
  1. 4 11
      src/components/TongzhouTrafficMap.vue

+ 4 - 11
src/components/TongzhouTrafficMap.vue

@@ -318,13 +318,7 @@ export default {
           { start: [116.6445, 39.9075], end: [116.6846, 39.9075], color: "#13C373" }
         ],
         "勤务路线": [
-          { start: [116.6900, 39.9225], end: [116.6900, 39.8971], color: "#BC301D" },
-          { start: [116.6965, 39.9225], end: [116.6965, 39.8971], color: "#BC301D" },
-          { start: [116.7021, 39.9225], end: [116.7021, 39.8971], color: "#BC301D" },
-          { start: [116.7120, 39.9225], end: [116.7120, 39.8971], color: "#BC301D" },
-          { start: [116.7234, 39.9225], end: [116.7234, 39.8971], color: "#BC301D" },
-          { start: [116.7290, 39.9225], end: [116.7290, 39.8971], color: "#BC301D" },
-          { start: [116.7350, 39.9170], end: [116.7350, 39.9000], color: "#BC301D" }
+          { start: [116.7120, 39.9225], end: [116.7120, 39.8971], color: "#BC301D" }
         ]
       };
 
@@ -489,10 +483,9 @@ export default {
         basePath = this.buildFallbackLinePath(line.start, line.end, 30);
       }
 
-      // --- 核心优化:物理分散偏移 (Dispersal Offset) ---
-      // 根据 lineIdx 为每条路径应用微小偏移,避免多条线路完全重合
-      // 0.00015 度约等于 15 米,(lineIdx - 3) 将多条线在中心点两侧排开
-      const offsetVal = (Number(lineIdx) - 3) * 0.00015;
+      // --- 核心优化:确保线路准确贴合真实道路 ---
+      // 取消原本的微小物理解散偏移,以保证所有线路(包含但不限单条调整后)严格绘制在导航真实道路上
+      const offsetVal = 0;
       const applyOffset = (p) => {
         const lng = p.lng || (p.getLng ? p.getLng() : (Array.isArray(p) ? Number(p[0]) : 0));
         const lat = p.lat || (p.getLat ? p.getLat() : (Array.isArray(p) ? Number(p[1]) : 0));