From 5d916326e7b16ca01eb503a05539b55a6f68ff33 Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 14 Sep 2021 11:15:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=82=B9=E4=BD=8D?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E8=A2=AB=E9=87=8D=E5=A4=8D=E7=9A=84=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=B8=A6=E6=9D=A5=E7=82=B9=E4=BD=8D=E5=81=8F=E7=A7=BB?= =?UTF-8?q?=EF=BC=88=E7=94=B1=E6=95=B0=E6=8D=AE=E6=98=A0=E5=B0=84=E5=BC=95?= =?UTF-8?q?=E5=8F=91=E7=9A=84=20updateStyleAttribute=20=E5=BC=95=E5=8F=91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- packages/layers/src/plugins/DataMappingPlugin.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c2635b1a06..b5950f886c 100644 --- a/.gitignore +++ b/.gitignore @@ -86,4 +86,5 @@ yarn.lock # npm command lines publish.sh latest.sh -beta.sh \ No newline at end of file +beta.sh +mini.sh \ No newline at end of file diff --git a/packages/layers/src/plugins/DataMappingPlugin.ts b/packages/layers/src/plugins/DataMappingPlugin.ts index 7809c20f55..28d00a0a3a 100644 --- a/packages/layers/src/plugins/DataMappingPlugin.ts +++ b/packages/layers/src/plugins/DataMappingPlugin.ts @@ -150,7 +150,10 @@ export default class DataMappingPlugin implements ILayerPlugin { if (typeof mappedData[0].coordinates[0] === 'number') { // 单个的点数据 // @ts-ignore - mappedData.map((d) => { + mappedData + // TODO: 避免经纬度被重复计算导致坐标位置偏移 + .filter((d) => !d.originCoordinates) + .map((d) => { d.version = 'GAODE2.x'; // @ts-ignore d.originCoordinates = cloneDeep(d.coordinates); // 为了兼容高德1.x 需要保存一份原始的经纬度坐标数据(许多上层逻辑依赖经纬度数据) @@ -161,7 +164,10 @@ export default class DataMappingPlugin implements ILayerPlugin { } else { // 连续的线、面数据 // @ts-ignore - mappedData.map((d) => { + mappedData + // TODO: 避免经纬度被重复计算导致坐标位置偏移 + .filter((d) => !d.originCoordinates) + .map((d) => { d.version = 'GAODE2.x'; // @ts-ignore d.originCoordinates = cloneDeep(d.coordinates); // 为了兼容高德1.x 需要保存一份原始的经纬度坐标数据(许多上层逻辑依赖经纬度数据)