Merge pull request #13137 from dataease/pr@dev-v2@chart-symbolic-tooltip-fix

fix(图表): 修复符号地图提示显示错乱的问题
This commit is contained in:
jianneng-fit2cloud 2024-11-05 16:47:55 +08:00 committed by GitHub
commit 0f3ad8af4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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 || []