diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts index c04b42d228..4d17ae08f5 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts @@ -135,7 +135,7 @@ export class BubbleMap extends L7PlotChartView { }) dotLayer.once('loaded', () => { chart.container = container - configCarouselTooltip(chart, view, chart.data?.data || [], null, areaId) + configCarouselTooltip(chart, view, chart.data?.data || [], null) }) }) return view diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts index b6690065c3..b67ec32794 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts @@ -178,7 +178,7 @@ export class Map extends L7PlotChartView { }) }) chart.container = container - configCarouselTooltip(chart, view, data, null, areaId) + configCarouselTooltip(chart, view, data, null) }) return view } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts index 5a0f2fb1d9..bf91cbf1b0 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts @@ -6,19 +6,13 @@ import { parseJson } from '@/views/chart/components/js/util' import { Scene } from '@antv/l7-scene' import { deepCopy } from '@/utils/utils' -export const configCarouselTooltip = (chart, view, data, scene, areaId?) => { +export const configCarouselTooltip = (chart, view, data, scene) => { if (['bubble-map', 'map'].includes(chart.type)) { data = view.source.data.dataArray ?.filter(i => i.dimensionList?.length > 0) .reduce((acc, current) => { const existingItem = acc.find(obj => { - if (areaId.startsWith('000')) { - return obj.name === current.name - } else if (areaId.startsWith('156')) { - return obj.adcode === current.adcode - } else { - return obj.name === current.name - } + return obj.name === current.name || (obj.adcode && obj.adcode === current.adcode) }) if (!existingItem) { acc.push(current)