| | |
| | | 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 |
| | | }); |
| | | } |
| | |
| | | * @param {boolean} collision 标注避让 |
| | | * @returns |
| | | */ |
| | | createLabelMarks(img, dataList, collision = true) { |
| | | createLabelMarks(img, dataList, collision = true, showTxt = true) { |
| | | // eslint-disable-next-line no-undef |
| | | const layer = new AMap.LabelsLayer({ |
| | | zooms: [3, 20], |
| | |
| | | retina: true |
| | | }, |
| | | text: { |
| | | content: data.name, |
| | | content: showTxt ? data.name : '', |
| | | direction: 'top', |
| | | offset: [0, -5], |
| | | style: { |