From 4fb101b7e307b4f4c8a5158d9db9efa80590c4fd Mon Sep 17 00:00:00 2001 From: haishan <710328466@qq.com> Date: Mon, 3 Jun 2024 16:21:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(ts):=20=E6=B7=BB=E5=8A=A0ts=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/map/src/drawControl/DrawControl.tsx | 1 - packages/map/src/utils/index.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/map/src/drawControl/DrawControl.tsx b/packages/map/src/drawControl/DrawControl.tsx index 53e50f8..7e2bbfe 100644 --- a/packages/map/src/drawControl/DrawControl.tsx +++ b/packages/map/src/drawControl/DrawControl.tsx @@ -4,7 +4,6 @@ import { forwardRef, useImperativeHandle, useRef, } from 'react' import MapboxDraw from '@mapbox/mapbox-gl-draw'; import { - CircleMode, DragCircleMode, DirectMode, SimpleSelectMode diff --git a/packages/map/src/utils/index.ts b/packages/map/src/utils/index.ts index f7222c7..ef5c2ae 100644 --- a/packages/map/src/utils/index.ts +++ b/packages/map/src/utils/index.ts @@ -196,6 +196,7 @@ export const lineToPoly = (geojson: { geometry: { coordinates: string | any[] } let _union; try { //todo: 新版本union和老版本行为不一致 先用老版本 后续观察原因 + // @ts-ignore _union = turf.union(...circlePolygon, ...linesPolygon); // _union = union(...circlePolygon, ...linesPolygon); } catch (e) { @@ -241,7 +242,7 @@ export const getDistancesByStringLine = ( const tempDistance = turf.distance(pointA, pointB, config); totalLength += tempDistance distanceArr.push({ - distance: tempDistance.toFixed(2), + distance: Number(tempDistance.toFixed(2)), totalLength: totalLength.toFixed(2), from: pointA, to: pointB