diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts index c7809aae30..0dd99fa78b 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts @@ -330,6 +330,15 @@ export class SymbolicMap extends L7ChartView { 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 { */ 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 || []