From 30cf71affd5149a1310d84f658b028d267beee8b Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 11 六月 2025 17:30:22 +0800
Subject: [PATCH] 动态溯源(编写中)

---
 src/utils/map/marks.js |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/utils/map/marks.js b/src/utils/map/marks.js
index ba31891..0b1ccce 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, showTxt = 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],
@@ -112,7 +119,7 @@
           retina: true
         },
         text: {
-          content: data.name,
+          content: showTxt ? data.name : '',
           direction: 'top',
           offset: [0, -5],
           style: {

--
Gitblit v1.9.3