From 87e19b5a396ac8fed6a551828b87d263f6425c31 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 16 十月 2025 10:26:12 +0800
Subject: [PATCH] 2025.10.16 修改季度报告生成逻辑
---
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