From 8f21f239e218b06074b0d903719f3fecdf171d8c Mon Sep 17 00:00:00 2001 From: RoXoM Date: Mon, 20 Nov 2023 15:50:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20amapPolygonPat?= =?UTF-8?q?h2GeoJSONCoords=20=E7=9B=B8=E5=85=B3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stories/amapPolygonPath2GeoJSONCoords.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/helpers/stories/amapPolygonPath2GeoJSONCoords.mdx diff --git a/src/helpers/stories/amapPolygonPath2GeoJSONCoords.mdx b/src/helpers/stories/amapPolygonPath2GeoJSONCoords.mdx new file mode 100644 index 0000000..34bfe71 --- /dev/null +++ b/src/helpers/stories/amapPolygonPath2GeoJSONCoords.mdx @@ -0,0 +1,18 @@ +import { Meta } from "@storybook/blocks"; + + + +# amapPolygonPath2GeoJSONCoords + +将 `AMap.Polygon` 的 `path` 数据转换成 `GeoJSON.Polygon` 的 coords。 + +由于 `AMap.Polygon` 的 `path` 允许最后一个点与起始点不需要一致,这不符合 `GeoJSON` 规范中对 `RingLine` 的定义。 +因此在实际使用时需要进行数据转换。 + +类型声明: + +```ts +const amapPolygonPath2GeoJSONCoords: ( + path: ReturnType +) => GeoJSON.Position[] | GeoJSON.Position[][] | GeoJSON.Position[][][] +``` \ No newline at end of file From 83fd00dd3dd0c6f948229a0745d3d91038ee512e Mon Sep 17 00:00:00 2001 From: RoXoM Date: Mon, 20 Nov 2023 15:50:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20coordsOfGeoJSO?= =?UTF-8?q?N2AMapPolygonPath=20=E7=9B=B8=E5=85=B3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coordsOfGeoJSON2AMapPolygonPath.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/helpers/stories/coordsOfGeoJSON2AMapPolygonPath.mdx diff --git a/src/helpers/stories/coordsOfGeoJSON2AMapPolygonPath.mdx b/src/helpers/stories/coordsOfGeoJSON2AMapPolygonPath.mdx new file mode 100644 index 0000000..f7fd8ad --- /dev/null +++ b/src/helpers/stories/coordsOfGeoJSON2AMapPolygonPath.mdx @@ -0,0 +1,18 @@ +import { Meta } from "@storybook/blocks"; + + + +# coordsOfGeoJSON2AMapPolygonPath + +将 `GeoJSON.Polygon` 的 `coords` 转换成 `AMap.Polygon` 的 `path` 需要的数据 。 + +由于 `AMap.Polygon` 的 `path` 允许最后一个点与起始点不需要一致,这不符合 `GeoJSON` 规范中对 `RingLine` 的定义。 +因此在实际使用时需要进行数据转换。 + +类型声明: + +```ts +const coordsOfGeoJSON2AMapPolygonPath: ( + coords: GeoJSON.Position[] | GeoJSON.Polygon['coordinates'] | GeoJSON.MultiPolygon['coordinates'] +) => Position[] | Position[][] | Position[][][] +``` \ No newline at end of file