From ce2905c5d8c4e13536d1ce54b63755215b5b2ffc Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Tue, 4 Apr 2023 14:47:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E6=B5=81=E5=90=91?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE):=20=E6=B5=81=E5=90=91=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=EF=BC=8C=E6=97=A0=E6=95=B0=E6=8D=AE=E5=8F=AF?= =?UTF-8?q?=E8=B0=83=E8=8A=82=E5=80=BE=E8=A7=92=E5=92=8C=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/map/map_antv.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/chart/chart/map/map_antv.js b/frontend/src/views/chart/chart/map/map_antv.js index 7c62c2bce7..d6470552cf 100644 --- a/frontend/src/views/chart/chart/map/map_antv.js +++ b/frontend/src/views/chart/chart/map/map_antv.js @@ -11,7 +11,7 @@ export function baseFlowMapOption(chartDom, chartId, chart, action) { } const size = customAttr.size const color = customAttr.color - const mapStyle = `amap://styles/${color.mapStyle}` + const mapStyle = `amap://styles/${color.mapStyle ? color.mapStyle : 'normal'}` const lang = getLanguage().includes('zh') ? 'zh' : 'en' let init = false if (!chartDom) { @@ -25,6 +25,9 @@ export function baseFlowMapOption(chartDom, chartId, chart, action) { logoVisible: false }) init = true + } else { + chartDom.setPitch(size.mapPitch) + chartDom.setMapStyle(mapStyle) } if (xAxis?.length < 2 || xAxisExt?.length < 2) { return chartDom @@ -66,8 +69,6 @@ export function baseFlowMapOption(chartDom, chartId, chart, action) { .color(color.mapLineSourceColor) } if (!init) { - chartDom.setPitch(size.mapPitch) - chartDom.setMapStyle(mapStyle) chartDom.addLayer(lineLayer) } chartDom.on('loaded', () => {