From 80a299edc215ed332beaa4096231ee2a81d941e2 Mon Sep 17 00:00:00 2001 From: wisonic Date: Mon, 4 Aug 2025 16:53:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E5=AD=98=E5=9C=A8=E7=9B=B8=E5=90=8C=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=97=B6=E5=9B=BE=E4=BE=8B=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=20#16203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/map/map.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 74b564e50f..d8b5229c54 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 @@ -313,7 +313,9 @@ export class Map extends L7PlotChartView { } }) if (colorScale.length) { - options.color['value'] = colorScale.map(item => (item.color ? item.color : item)) + options.color['value'] = colorScale.map(item => + item.color ? new ColorWrapper(item.color) : new ColorWrapper(item) + ) if (colorScale[0].value && !misc.mapAutoLegend) { options.color['scale']['domain'] = [ minValue ?? filterEmptyMinValue(sourceData, 'value'), @@ -623,3 +625,15 @@ export class Map extends L7PlotChartView { )(chart, options, context, this) } } + +class ColorWrapper { + private color: string + + constructor(color: string) { + this.color = color + } + + toString(): string { + return this.color + } +}