From e55517a4261958dede521c4c986b1e057c8e8426 Mon Sep 17 00:00:00 2001 From: yxh01132861 Date: Wed, 31 Jan 2024 16:31:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=BE=E4=BE=8B=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../li-analysis-assets/src/widgets/LegendWidget/helper.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/li-analysis-assets/src/widgets/LegendWidget/helper.ts b/packages/li-analysis-assets/src/widgets/LegendWidget/helper.ts index b25b3f3e..e30b7118 100644 --- a/packages/li-analysis-assets/src/widgets/LegendWidget/helper.ts +++ b/packages/li-analysis-assets/src/widgets/LegendWidget/helper.ts @@ -123,7 +123,11 @@ export const parserLegendData = (layer: Layer) => { .map((label, index) => ({ label, color: colors[index] })) .sort((a, b) => a.label.localeCompare(b.label, 'zh-CN')); // string 文本自定义的情况,需要展示出其他分类 - const unknownItem = { label: '其他', color: layer.options.fillColor.scale.unknown }; + // 线图层 layer.options.color 其他图层 layer.options.fillColor + const unknownItem = { + label: '其他', + color: layer.options.fillColor?.scale.unknown || layer.options.color?.scale.unknown, + }; const _labels = unknownItem.color ? [...catData.map((item) => item.label), unknownItem.label] : catData.map((item) => item.label); @@ -144,6 +148,8 @@ export const parserLegendData = (layer: Layer) => { }, }; + console.log(data, 'data'); + return data; } else if (['linear', 'quantile', 'quantize', 'threshold'].includes(type as string)) { const data: LegendRampData = {