From bbf310e33a08db8efa4e44cac65c954045d8a8ef Mon Sep 17 00:00:00 2001 From: Cmen <1176967590@qq.com> Date: Fri, 11 Mar 2022 14:44:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BAgeoj?= =?UTF-8?q?son=E6=9E=84=E5=BB=BA=E4=B8=89=E7=BB=B4=E5=A2=99=E9=9D=A2?= =?UTF-8?q?=E6=9C=9D=E5=86=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/utils/getGeoJSON.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/utils/getGeoJSON.ts b/src/store/utils/getGeoJSON.ts index fa558de..91076ee 100644 --- a/src/store/utils/getGeoJSON.ts +++ b/src/store/utils/getGeoJSON.ts @@ -31,7 +31,7 @@ export function getGeoJSON(state: IMapOptions): GeoJSON.FeatureCollection { properties.water = true; } - coordinates.forEach((shape) => { + coordinates = coordinates.map((shape) => { if (turf.booleanClockwise(shape)) { shape = shape.reverse(); } @@ -43,6 +43,7 @@ export function getGeoJSON(state: IMapOptions): GeoJSON.FeatureCollection { shape.push([...shape[0]]); } } + return shape; }); features.push({ type: "Feature",