fix(图表): 修复符号地图提示显示错乱的问题

This commit is contained in:
jianneng-fit2cloud 2024-11-05 16:44:19 +08:00
parent 8e5911a045
commit 00b948768b

View File

@ -330,6 +330,15 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
return resultMap
}
/**
* 清除 popup
* @param container
*/
clearPopup = container => {
const containerElement = document.getElementById(container)
containerElement?.querySelectorAll('.l7-popup').forEach((element: Element) => element.remove())
}
/**
* 构建 tooltip
* @param chart
@ -337,6 +346,7 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
*/
buildTooltip = (chart, container, pointLayer) => {
const customAttr = chart.customAttr ? parseJson(chart.customAttr) : null
this.clearPopup(container)
if (customAttr?.tooltip?.show) {
const { tooltip } = deepCopy(customAttr)
let showFields = tooltip.showFields || []