From 66e48ee8e286533a9614efa34d42297213c1da4b Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 04 六月 2025 17:34:11 +0800
Subject: [PATCH] 动态溯源(待完成)

---
 src/utils/map/marks.js |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/utils/map/marks.js b/src/utils/map/marks.js
index ba31891..03ebbc5 100644
--- a/src/utils/map/marks.js
+++ b/src/utils/map/marks.js
@@ -25,7 +25,7 @@
     for (let i = 0; i < lnglats.length; i++) {
       data.push({
         lnglat: lnglats[i], //鐐规爣璁颁綅缃�
-        name: `${fDatas.times[i]}<br/>${_factor.factorName}: ${_factor.datas[i].factorData} mg/m鲁`,
+        name: `${fDatas.times[i]}<br/>${_factor.factorName}: ${_factor.datas[i].factorData} 渭g/m鲁`,
         id: i
       });
     }
@@ -79,13 +79,20 @@
     }
   },
 
-  createLabelMarks(img, dataList) {
+  /**
+   * 鍒涘缓鏍囪鐐�
+   * @param {string | Array} img 鍥炬爣鎴栧浘鏍囨暟缁�
+   * @param {Array} dataList 鐩戞祴鏁版嵁
+   * @param {boolean} collision 鏍囨敞閬胯
+   * @returns
+   */
+  createLabelMarks(img, dataList, collision = true) {
     // eslint-disable-next-line no-undef
     const layer = new AMap.LabelsLayer({
       zooms: [3, 20],
       zIndex: 1000,
       // 寮�鍚爣娉ㄩ伩璁╋紝榛樿涓哄紑鍚紝v1.4.15 鏂板灞炴��
-      collision: true,
+      collision: collision,
       // 寮�鍚爣娉ㄦ贰鍏ュ姩鐢伙紝榛樿涓哄紑鍚紝v1.4.15 鏂板灞炴��
       animation: true
     });
@@ -103,7 +110,7 @@
         zIndex: 10,
         icon: {
           type: 'image',
-          image: img,
+          image: typeof img === 'string' ? img : img[i],
           // clipOrigin: [14, 92],
           // clipSize: [50, 68],
           size: [30, 30],

--
Gitblit v1.9.3