From b6a34f9d0ec2a3f43990d3c0095e32d15579da01 Mon Sep 17 00:00:00 2001 From: Cmen <1176967590@qq.com> Date: Fri, 11 Mar 2022 15:02:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5geoj?= =?UTF-8?q?son=E5=9C=86=E8=A6=86=E7=9B=96=E7=89=A9=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/utils/getMapOptions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store/utils/getMapOptions.ts b/src/store/utils/getMapOptions.ts index 2bc6975..761f2ab 100644 --- a/src/store/utils/getMapOptions.ts +++ b/src/store/utils/getMapOptions.ts @@ -23,7 +23,7 @@ export function getMapOptions(geojson: GeoJSON.FeatureCollection) { const addPolygon = (feature: GeoJSON.Feature) => { const { geometry, properties } = feature; - const { name, fineType, lngLat, radius, building, water, grass, height } = + const { name, fineType, center, radius, building, water, grass, height } = properties as any; const { coordinates } = geometry as GeoJSON.Polygon; const path = convertPath(coordinates[0]); @@ -32,11 +32,11 @@ export function getMapOptions(geojson: GeoJSON.FeatureCollection) { name, type: OverlayTypes.Polygon, }; - if (fineType === "rect") { + if (fineType === OverlayTypes.Rectangle) { overlay.path = path; overlay.type = OverlayTypes.Rectangle; - } else if (fineType === "circle") { - overlay.lngLat = lngLat; + } else if (fineType === OverlayTypes.Circle) { + overlay.lngLat = center; overlay.radius = radius; overlay.type = OverlayTypes.Circle; } else {