From 1ecab5c32f54ebd8d66d18c416408b5ffaf4d861 Mon Sep 17 00:00:00 2001 From: yunji Date: Mon, 8 Aug 2022 11:38:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20=E8=B0=83=E6=95=B4=E5=9B=BE?= =?UTF-8?q?=E5=B1=82=E7=BB=84=E4=BB=B6=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HeatmapLayer/demos/default.tsx | 0 .../{ => BaseLayers}/HeatmapLayer/index.md | 4 +-- .../{ => BaseLayers}/HeatmapLayer/index.tsx | 2 +- .../{ => BaseLayers}/HeatmapLayer/types.ts | 2 +- .../LineLayer/demos/default.tsx | 0 .../{ => BaseLayers}/LineLayer/index.md | 4 +-- .../{ => BaseLayers}/LineLayer/index.tsx | 2 +- .../{ => BaseLayers}/LineLayer/types.ts | 2 +- .../PointLayer/demos/default.tsx | 0 .../{ => BaseLayers}/PointLayer/index.md | 4 +-- .../{ => BaseLayers}/PointLayer/index.tsx | 2 +- .../{ => BaseLayers}/PointLayer/types.ts | 0 .../PolygonLayer/demos/default.tsx | 0 .../PolygonLayer}/demos/xihu-district.json | 0 .../{ => BaseLayers}/PolygonLayer/index.md | 4 +-- .../{ => BaseLayers}/PolygonLayer/index.tsx | 2 +- .../{ => BaseLayers}/PolygonLayer/types.ts | 0 .../TextLayer/demos/default.tsx | 0 .../{ => BaseLayers}/TextLayer/index.md | 4 +-- .../{ => BaseLayers}/TextLayer/index.tsx | 2 +- .../{ => BaseLayers}/TextLayer/types.ts | 0 .../BubbleLayer/demos/default.tsx | 0 .../BubbleLayer/index.md | 2 +- .../BubbleLayer/index.tsx | 2 +- .../BubbleLayer/types.ts | 2 +- .../ChoroplethLayer/demos/default.tsx | 0 .../ChoroplethLayer}/demos/xihu-district.json | 0 .../ChoroplethLayer/index.md | 2 +- .../ChoroplethLayer/index.tsx | 2 +- .../ChoroplethLayer/types.ts | 0 src/components/Layers/index.ts | 29 ++++++++++--------- .../{Zoom => ScaleControl}/demos/default.tsx | 4 +-- .../{Scale => ScaleControl}/index.md | 2 +- .../{Scale => ScaleControl}/index.tsx | 4 +-- .../{Scale => ScaleControl}/types.ts | 2 +- .../{Scale => ZoomControl}/demos/default.tsx | 4 +-- src/components/{Zoom => ZoomControl}/index.md | 2 +- .../{Zoom => ZoomControl}/index.tsx | 4 +-- src/components/{Zoom => ZoomControl}/types.ts | 2 +- src/index.ts | 9 +++--- 40 files changed, 54 insertions(+), 52 deletions(-) rename src/components/Layers/{ => BaseLayers}/HeatmapLayer/demos/default.tsx (100%) rename src/components/Layers/{ => BaseLayers}/HeatmapLayer/index.md (92%) rename src/components/Layers/{ => BaseLayers}/HeatmapLayer/index.tsx (88%) rename src/components/Layers/{ => BaseLayers}/HeatmapLayer/types.ts (76%) rename src/components/Layers/{ => BaseLayers}/LineLayer/demos/default.tsx (100%) rename src/components/Layers/{ => BaseLayers}/LineLayer/index.md (92%) rename src/components/Layers/{ => BaseLayers}/LineLayer/index.tsx (87%) rename src/components/Layers/{ => BaseLayers}/LineLayer/types.ts (75%) rename src/components/Layers/{ => BaseLayers}/PointLayer/demos/default.tsx (100%) rename src/components/Layers/{ => BaseLayers}/PointLayer/index.md (92%) rename src/components/Layers/{ => BaseLayers}/PointLayer/index.tsx (87%) rename src/components/Layers/{ => BaseLayers}/PointLayer/types.ts (100%) rename src/components/Layers/{ => BaseLayers}/PolygonLayer/demos/default.tsx (100%) rename src/components/Layers/{ChoroplethLayer => BaseLayers/PolygonLayer}/demos/xihu-district.json (100%) rename src/components/Layers/{ => BaseLayers}/PolygonLayer/index.md (92%) rename src/components/Layers/{ => BaseLayers}/PolygonLayer/index.tsx (88%) rename src/components/Layers/{ => BaseLayers}/PolygonLayer/types.ts (100%) rename src/components/Layers/{ => BaseLayers}/TextLayer/demos/default.tsx (100%) rename src/components/Layers/{ => BaseLayers}/TextLayer/index.md (92%) rename src/components/Layers/{ => BaseLayers}/TextLayer/index.tsx (87%) rename src/components/Layers/{ => BaseLayers}/TextLayer/types.ts (100%) rename src/components/Layers/{ => CompositeLayers}/BubbleLayer/demos/default.tsx (100%) rename src/components/Layers/{ => CompositeLayers}/BubbleLayer/index.md (99%) rename src/components/Layers/{ => CompositeLayers}/BubbleLayer/index.tsx (87%) rename src/components/Layers/{ => CompositeLayers}/BubbleLayer/types.ts (83%) rename src/components/Layers/{ => CompositeLayers}/ChoroplethLayer/demos/default.tsx (100%) rename src/components/Layers/{PolygonLayer => CompositeLayers/ChoroplethLayer}/demos/xihu-district.json (100%) rename src/components/Layers/{ => CompositeLayers}/ChoroplethLayer/index.md (98%) rename src/components/Layers/{ => CompositeLayers}/ChoroplethLayer/index.tsx (88%) rename src/components/Layers/{ => CompositeLayers}/ChoroplethLayer/types.ts (100%) rename src/components/{Zoom => ScaleControl}/demos/default.tsx (59%) rename src/components/{Scale => ScaleControl}/index.md (90%) rename src/components/{Scale => ScaleControl}/index.tsx (86%) rename src/components/{Scale => ScaleControl}/types.ts (79%) rename src/components/{Scale => ZoomControl}/demos/default.tsx (59%) rename src/components/{Zoom => ZoomControl}/index.md (91%) rename src/components/{Zoom => ZoomControl}/index.tsx (86%) rename src/components/{Zoom => ZoomControl}/types.ts (79%) diff --git a/src/components/Layers/HeatmapLayer/demos/default.tsx b/src/components/Layers/BaseLayers/HeatmapLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/HeatmapLayer/demos/default.tsx rename to src/components/Layers/BaseLayers/HeatmapLayer/demos/default.tsx diff --git a/src/components/Layers/HeatmapLayer/index.md b/src/components/Layers/BaseLayers/HeatmapLayer/index.md similarity index 92% rename from src/components/Layers/HeatmapLayer/index.md rename to src/components/Layers/BaseLayers/HeatmapLayer/index.md index 898faf0b..2779060c 100644 --- a/src/components/Layers/HeatmapLayer/index.md +++ b/src/components/Layers/BaseLayers/HeatmapLayer/index.md @@ -1,8 +1,8 @@ --- toc: content -order: 6 +order: 4 group: - title: 图层组件 + title: 基础图层 order: 1 nav: title: 组件 diff --git a/src/components/Layers/HeatmapLayer/index.tsx b/src/components/Layers/BaseLayers/HeatmapLayer/index.tsx similarity index 88% rename from src/components/Layers/HeatmapLayer/index.tsx rename to src/components/Layers/BaseLayers/HeatmapLayer/index.tsx index 2772ea00..c5143e62 100644 --- a/src/components/Layers/HeatmapLayer/index.tsx +++ b/src/components/Layers/BaseLayers/HeatmapLayer/index.tsx @@ -1,6 +1,6 @@ import { HeatmapLayer as L7HeatmapLayer } from '@antv/l7-composite-layers'; import { forwardRef, memo, useImperativeHandle } from 'react'; -import { useCreateLayer } from '../hooks/use-create-layer'; +import { useCreateLayer } from '../../hooks/use-create-layer'; import type { HeatmapLayerProps } from './types'; export const HeatmapLayer = memo( diff --git a/src/components/Layers/HeatmapLayer/types.ts b/src/components/Layers/BaseLayers/HeatmapLayer/types.ts similarity index 76% rename from src/components/Layers/HeatmapLayer/types.ts rename to src/components/Layers/BaseLayers/HeatmapLayer/types.ts index 66533bd6..67c31b6a 100644 --- a/src/components/Layers/HeatmapLayer/types.ts +++ b/src/components/Layers/BaseLayers/HeatmapLayer/types.ts @@ -1,5 +1,5 @@ import type { HeatmapLayer, HeatmapLayerOptions } from '@antv/l7-composite-layers'; -import type { LayerCommonProps } from '../../../types/common'; +import type { LayerCommonProps } from '../../../../types/common'; /** * 组件类型定义 diff --git a/src/components/Layers/LineLayer/demos/default.tsx b/src/components/Layers/BaseLayers/LineLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/LineLayer/demos/default.tsx rename to src/components/Layers/BaseLayers/LineLayer/demos/default.tsx diff --git a/src/components/Layers/LineLayer/index.md b/src/components/Layers/BaseLayers/LineLayer/index.md similarity index 92% rename from src/components/Layers/LineLayer/index.md rename to src/components/Layers/BaseLayers/LineLayer/index.md index 9e28ad4a..6dca30d4 100644 --- a/src/components/Layers/LineLayer/index.md +++ b/src/components/Layers/BaseLayers/LineLayer/index.md @@ -1,8 +1,8 @@ --- toc: content -order: 4 +order: 2 group: - title: 图层组件 + title: 基础图层 order: 1 nav: title: 组件 diff --git a/src/components/Layers/LineLayer/index.tsx b/src/components/Layers/BaseLayers/LineLayer/index.tsx similarity index 87% rename from src/components/Layers/LineLayer/index.tsx rename to src/components/Layers/BaseLayers/LineLayer/index.tsx index 2f43ec69..4f5d4934 100644 --- a/src/components/Layers/LineLayer/index.tsx +++ b/src/components/Layers/BaseLayers/LineLayer/index.tsx @@ -1,6 +1,6 @@ import { LineLayer as L7LineLayer } from '@antv/l7-composite-layers'; import { forwardRef, memo, useImperativeHandle } from 'react'; -import { useCreateLayer } from '../hooks/use-create-layer'; +import { useCreateLayer } from '../../hooks/use-create-layer'; import type { LineLayerProps } from './types'; export const LineLayer = memo( diff --git a/src/components/Layers/LineLayer/types.ts b/src/components/Layers/BaseLayers/LineLayer/types.ts similarity index 75% rename from src/components/Layers/LineLayer/types.ts rename to src/components/Layers/BaseLayers/LineLayer/types.ts index 9f34f211..fd9919ea 100644 --- a/src/components/Layers/LineLayer/types.ts +++ b/src/components/Layers/BaseLayers/LineLayer/types.ts @@ -1,5 +1,5 @@ import type { LineLayer, LineLayerOptions } from '@antv/l7-composite-layers'; -import type { LayerCommonProps } from '../../../types/common'; +import type { LayerCommonProps } from '../../../../types/common'; /** * 组件类型定义 diff --git a/src/components/Layers/PointLayer/demos/default.tsx b/src/components/Layers/BaseLayers/PointLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/PointLayer/demos/default.tsx rename to src/components/Layers/BaseLayers/PointLayer/demos/default.tsx diff --git a/src/components/Layers/PointLayer/index.md b/src/components/Layers/BaseLayers/PointLayer/index.md similarity index 92% rename from src/components/Layers/PointLayer/index.md rename to src/components/Layers/BaseLayers/PointLayer/index.md index 9405d375..a1dc8949 100644 --- a/src/components/Layers/PointLayer/index.md +++ b/src/components/Layers/BaseLayers/PointLayer/index.md @@ -1,8 +1,8 @@ --- toc: content -order: 3 +order: 1 group: - title: 图层组件 + title: 基础图层 order: 1 nav: title: 组件 diff --git a/src/components/Layers/PointLayer/index.tsx b/src/components/Layers/BaseLayers/PointLayer/index.tsx similarity index 87% rename from src/components/Layers/PointLayer/index.tsx rename to src/components/Layers/BaseLayers/PointLayer/index.tsx index 7bdaf690..2b65402b 100644 --- a/src/components/Layers/PointLayer/index.tsx +++ b/src/components/Layers/BaseLayers/PointLayer/index.tsx @@ -1,6 +1,6 @@ import { PointLayer as L7PointLayer } from '@antv/l7-composite-layers'; import { forwardRef, memo, useImperativeHandle } from 'react'; -import { useCreateLayer } from '../hooks/use-create-layer'; +import { useCreateLayer } from '../../hooks/use-create-layer'; import type { PointLayerProps } from './types'; export const PointLayer = memo( diff --git a/src/components/Layers/PointLayer/types.ts b/src/components/Layers/BaseLayers/PointLayer/types.ts similarity index 100% rename from src/components/Layers/PointLayer/types.ts rename to src/components/Layers/BaseLayers/PointLayer/types.ts diff --git a/src/components/Layers/PolygonLayer/demos/default.tsx b/src/components/Layers/BaseLayers/PolygonLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/PolygonLayer/demos/default.tsx rename to src/components/Layers/BaseLayers/PolygonLayer/demos/default.tsx diff --git a/src/components/Layers/ChoroplethLayer/demos/xihu-district.json b/src/components/Layers/BaseLayers/PolygonLayer/demos/xihu-district.json similarity index 100% rename from src/components/Layers/ChoroplethLayer/demos/xihu-district.json rename to src/components/Layers/BaseLayers/PolygonLayer/demos/xihu-district.json diff --git a/src/components/Layers/PolygonLayer/index.md b/src/components/Layers/BaseLayers/PolygonLayer/index.md similarity index 92% rename from src/components/Layers/PolygonLayer/index.md rename to src/components/Layers/BaseLayers/PolygonLayer/index.md index aed4fe61..6cfaa477 100644 --- a/src/components/Layers/PolygonLayer/index.md +++ b/src/components/Layers/BaseLayers/PolygonLayer/index.md @@ -1,8 +1,8 @@ --- toc: content -order: 5 +order: 3 group: - title: 图层组件 + title: 基础图层 order: 1 nav: title: 组件 diff --git a/src/components/Layers/PolygonLayer/index.tsx b/src/components/Layers/BaseLayers/PolygonLayer/index.tsx similarity index 88% rename from src/components/Layers/PolygonLayer/index.tsx rename to src/components/Layers/BaseLayers/PolygonLayer/index.tsx index bed5b9a3..9749f2a3 100644 --- a/src/components/Layers/PolygonLayer/index.tsx +++ b/src/components/Layers/BaseLayers/PolygonLayer/index.tsx @@ -1,6 +1,6 @@ import { PolygonLayer as L7PolygonLayer } from '@antv/l7-composite-layers'; import { forwardRef, memo, useImperativeHandle } from 'react'; -import { useCreateLayer } from '../hooks/use-create-layer'; +import { useCreateLayer } from '../../hooks/use-create-layer'; import type { PolygonLayerProps } from './types'; export const PolygonLayer = memo( diff --git a/src/components/Layers/PolygonLayer/types.ts b/src/components/Layers/BaseLayers/PolygonLayer/types.ts similarity index 100% rename from src/components/Layers/PolygonLayer/types.ts rename to src/components/Layers/BaseLayers/PolygonLayer/types.ts diff --git a/src/components/Layers/TextLayer/demos/default.tsx b/src/components/Layers/BaseLayers/TextLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/TextLayer/demos/default.tsx rename to src/components/Layers/BaseLayers/TextLayer/demos/default.tsx diff --git a/src/components/Layers/TextLayer/index.md b/src/components/Layers/BaseLayers/TextLayer/index.md similarity index 92% rename from src/components/Layers/TextLayer/index.md rename to src/components/Layers/BaseLayers/TextLayer/index.md index 00be67f5..8506a997 100644 --- a/src/components/Layers/TextLayer/index.md +++ b/src/components/Layers/BaseLayers/TextLayer/index.md @@ -1,8 +1,8 @@ --- toc: content -order: 7 +order: 5 group: - title: 图层组件 + title: 基础图层 order: 1 nav: title: 组件 diff --git a/src/components/Layers/TextLayer/index.tsx b/src/components/Layers/BaseLayers/TextLayer/index.tsx similarity index 87% rename from src/components/Layers/TextLayer/index.tsx rename to src/components/Layers/BaseLayers/TextLayer/index.tsx index 59b5e34d..c44ef7ad 100644 --- a/src/components/Layers/TextLayer/index.tsx +++ b/src/components/Layers/BaseLayers/TextLayer/index.tsx @@ -1,6 +1,6 @@ import { TextLayer as L7TextLayer } from '@antv/l7-composite-layers'; import { forwardRef, memo, useImperativeHandle } from 'react'; -import { useCreateLayer } from '../hooks/use-create-layer'; +import { useCreateLayer } from '../../hooks/use-create-layer'; import type { TextLayerProps } from './types'; export const TextLayer = memo( diff --git a/src/components/Layers/TextLayer/types.ts b/src/components/Layers/BaseLayers/TextLayer/types.ts similarity index 100% rename from src/components/Layers/TextLayer/types.ts rename to src/components/Layers/BaseLayers/TextLayer/types.ts diff --git a/src/components/Layers/BubbleLayer/demos/default.tsx b/src/components/Layers/CompositeLayers/BubbleLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/BubbleLayer/demos/default.tsx rename to src/components/Layers/CompositeLayers/BubbleLayer/demos/default.tsx diff --git a/src/components/Layers/BubbleLayer/index.md b/src/components/Layers/CompositeLayers/BubbleLayer/index.md similarity index 99% rename from src/components/Layers/BubbleLayer/index.md rename to src/components/Layers/CompositeLayers/BubbleLayer/index.md index 1b497e74..889a5aa5 100644 --- a/src/components/Layers/BubbleLayer/index.md +++ b/src/components/Layers/CompositeLayers/BubbleLayer/index.md @@ -2,7 +2,7 @@ toc: content order: 1 group: - title: 图层组件 + title: 复合图层 order: 1 nav: title: 组件 diff --git a/src/components/Layers/BubbleLayer/index.tsx b/src/components/Layers/CompositeLayers/BubbleLayer/index.tsx similarity index 87% rename from src/components/Layers/BubbleLayer/index.tsx rename to src/components/Layers/CompositeLayers/BubbleLayer/index.tsx index 7d7c4ec4..fd3926d8 100644 --- a/src/components/Layers/BubbleLayer/index.tsx +++ b/src/components/Layers/CompositeLayers/BubbleLayer/index.tsx @@ -1,6 +1,6 @@ import { BubbleLayer as L7BubbleLayer } from '@antv/l7-composite-layers'; import { forwardRef, memo, useImperativeHandle } from 'react'; -import { useCreateLayer } from '../hooks/use-create-layer'; +import { useCreateLayer } from '../../hooks/use-create-layer'; import type { BubbleLayerProps } from './types'; export const BubbleLayer = memo( diff --git a/src/components/Layers/BubbleLayer/types.ts b/src/components/Layers/CompositeLayers/BubbleLayer/types.ts similarity index 83% rename from src/components/Layers/BubbleLayer/types.ts rename to src/components/Layers/CompositeLayers/BubbleLayer/types.ts index bb1b8b44..6929b011 100644 --- a/src/components/Layers/BubbleLayer/types.ts +++ b/src/components/Layers/CompositeLayers/BubbleLayer/types.ts @@ -6,7 +6,7 @@ import type { SourceOptions, TextLayerOptions, } from '@antv/l7-composite-layers'; -import type { LayerCommonProps } from '../../../types/common'; +import type { LayerCommonProps } from '../../../../types/common'; export type { SourceOptions, ColorAttr, SizeAttr, TextLayerOptions }; diff --git a/src/components/Layers/ChoroplethLayer/demos/default.tsx b/src/components/Layers/CompositeLayers/ChoroplethLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/ChoroplethLayer/demos/default.tsx rename to src/components/Layers/CompositeLayers/ChoroplethLayer/demos/default.tsx diff --git a/src/components/Layers/PolygonLayer/demos/xihu-district.json b/src/components/Layers/CompositeLayers/ChoroplethLayer/demos/xihu-district.json similarity index 100% rename from src/components/Layers/PolygonLayer/demos/xihu-district.json rename to src/components/Layers/CompositeLayers/ChoroplethLayer/demos/xihu-district.json diff --git a/src/components/Layers/ChoroplethLayer/index.md b/src/components/Layers/CompositeLayers/ChoroplethLayer/index.md similarity index 98% rename from src/components/Layers/ChoroplethLayer/index.md rename to src/components/Layers/CompositeLayers/ChoroplethLayer/index.md index a94b9665..0845d65f 100644 --- a/src/components/Layers/ChoroplethLayer/index.md +++ b/src/components/Layers/CompositeLayers/ChoroplethLayer/index.md @@ -2,7 +2,7 @@ toc: content order: 2 group: - title: 图层组件 + title: 复合图层 order: 1 nav: title: 组件 diff --git a/src/components/Layers/ChoroplethLayer/index.tsx b/src/components/Layers/CompositeLayers/ChoroplethLayer/index.tsx similarity index 88% rename from src/components/Layers/ChoroplethLayer/index.tsx rename to src/components/Layers/CompositeLayers/ChoroplethLayer/index.tsx index c31042b5..e9e32429 100644 --- a/src/components/Layers/ChoroplethLayer/index.tsx +++ b/src/components/Layers/CompositeLayers/ChoroplethLayer/index.tsx @@ -1,6 +1,6 @@ import { ChoroplethLayer as L7ChoroplethLayer } from '@antv/l7-composite-layers'; import { forwardRef, memo, useImperativeHandle } from 'react'; -import { useCreateLayer } from '../hooks/use-create-layer'; +import { useCreateLayer } from '../../hooks/use-create-layer'; import type { ChoroplethLayerProps } from './types'; export const ChoroplethLayer = memo( diff --git a/src/components/Layers/ChoroplethLayer/types.ts b/src/components/Layers/CompositeLayers/ChoroplethLayer/types.ts similarity index 100% rename from src/components/Layers/ChoroplethLayer/types.ts rename to src/components/Layers/CompositeLayers/ChoroplethLayer/types.ts diff --git a/src/components/Layers/index.ts b/src/components/Layers/index.ts index d0bfba4f..dd4cfe97 100644 --- a/src/components/Layers/index.ts +++ b/src/components/Layers/index.ts @@ -1,14 +1,15 @@ -export { BubbleLayer } from './BubbleLayer'; -export { BubbleLayerProps } from './BubbleLayer/types'; -export { ChoroplethLayer } from './ChoroplethLayer'; -export { ChoroplethLayerProps } from './ChoroplethLayer/types'; -export { HeatmapLayer } from './HeatmapLayer'; -export { HeatmapLayerProps } from './HeatmapLayer/types'; -export { LineLayer } from './LineLayer'; -export { LineLayerProps } from './LineLayer/types'; -export { PointLayer } from './PointLayer'; -export { PointLayerProps } from './PointLayer/types'; -export { PolygonLayer } from './PolygonLayer'; -export { PolygonLayerProps } from './PolygonLayer/types'; -export { TextLayer } from './TextLayer'; -export { TextLayerProps } from './TextLayer/types'; +export { HeatmapLayer } from './BaseLayers/HeatmapLayer'; +export { HeatmapLayerProps } from './BaseLayers/HeatmapLayer/types'; +export { LineLayer } from './BaseLayers/LineLayer'; +export { LineLayerProps } from './BaseLayers/LineLayer/types'; +export { PointLayer } from './BaseLayers/PointLayer'; +export { PointLayerProps } from './BaseLayers/PointLayer/types'; +export { PolygonLayer } from './BaseLayers/PolygonLayer'; +export { PolygonLayerProps } from './BaseLayers/PolygonLayer/types'; +export { TextLayer } from './BaseLayers/TextLayer'; +export { TextLayerProps } from './BaseLayers/TextLayer/types'; + +export { BubbleLayer } from './CompositeLayers/BubbleLayer'; +export { BubbleLayerProps } from './CompositeLayers/BubbleLayer/types'; +export { ChoroplethLayer } from './CompositeLayers/ChoroplethLayer'; +export { ChoroplethLayerProps } from './CompositeLayers/ChoroplethLayer/types'; diff --git a/src/components/Zoom/demos/default.tsx b/src/components/ScaleControl/demos/default.tsx similarity index 59% rename from src/components/Zoom/demos/default.tsx rename to src/components/ScaleControl/demos/default.tsx index dd8cd4ef..1fa9a9a4 100644 --- a/src/components/Zoom/demos/default.tsx +++ b/src/components/ScaleControl/demos/default.tsx @@ -1,10 +1,10 @@ -import { LarkMap, Zoom } from '@antv/larkmap'; +import { LarkMap, ScaleControl } from '@antv/larkmap'; import React from 'react'; export default () => { return ( - + ); }; diff --git a/src/components/Scale/index.md b/src/components/ScaleControl/index.md similarity index 90% rename from src/components/Scale/index.md rename to src/components/ScaleControl/index.md index 384eaa3c..11f90506 100644 --- a/src/components/Scale/index.md +++ b/src/components/ScaleControl/index.md @@ -9,7 +9,7 @@ nav: path: /components --- -# 比例尺 - Scale +# 比例尺 - ScaleControl ## 介绍 diff --git a/src/components/Scale/index.tsx b/src/components/ScaleControl/index.tsx similarity index 86% rename from src/components/Scale/index.tsx rename to src/components/ScaleControl/index.tsx index 18fc8aad..5599cd0d 100644 --- a/src/components/Scale/index.tsx +++ b/src/components/ScaleControl/index.tsx @@ -2,9 +2,9 @@ import { Scale as L7Scale } from '@antv/l7'; import { useUpdateEffect } from 'ahooks'; import { memo, useEffect, useRef } from 'react'; import { useScene } from '../LarkMap/hooks/use-scene'; -import type { ScaleProps } from './types'; +import type { ScaleControlProps } from './types'; -export const Scale = memo((props) => { +export const ScaleControl = memo((props) => { const scene = useScene(); const scaleRef = useRef(); const { position } = props; diff --git a/src/components/Scale/types.ts b/src/components/ScaleControl/types.ts similarity index 79% rename from src/components/Scale/types.ts rename to src/components/ScaleControl/types.ts index 1ff2b40a..f169397b 100644 --- a/src/components/Scale/types.ts +++ b/src/components/ScaleControl/types.ts @@ -4,7 +4,7 @@ import type { IScaleControlOption } from '@antv/l7-component'; /** * 组件类型定义 */ -export interface ScaleProps extends Partial> { +export interface ScaleControlProps extends Partial> { /** 位置,支持 'topright'、'topleft'、'bottomright'、'bottomleft'、'topcenter'、'bottomcenter'、'leftcenter'、'rightcenter' * @default "bottomleft" */ diff --git a/src/components/Scale/demos/default.tsx b/src/components/ZoomControl/demos/default.tsx similarity index 59% rename from src/components/Scale/demos/default.tsx rename to src/components/ZoomControl/demos/default.tsx index 40c7db42..5a90f8fe 100644 --- a/src/components/Scale/demos/default.tsx +++ b/src/components/ZoomControl/demos/default.tsx @@ -1,10 +1,10 @@ -import { LarkMap, Scale } from '@antv/larkmap'; +import { LarkMap, ZoomControl } from '@antv/larkmap'; import React from 'react'; export default () => { return ( - + ); }; diff --git a/src/components/Zoom/index.md b/src/components/ZoomControl/index.md similarity index 91% rename from src/components/Zoom/index.md rename to src/components/ZoomControl/index.md index f25a7ec0..68e99aa1 100644 --- a/src/components/Zoom/index.md +++ b/src/components/ZoomControl/index.md @@ -9,7 +9,7 @@ nav: path: /components --- -# 缩放器 - Zoom +# 缩放器 - ZoomControl ## 介绍 diff --git a/src/components/Zoom/index.tsx b/src/components/ZoomControl/index.tsx similarity index 86% rename from src/components/Zoom/index.tsx rename to src/components/ZoomControl/index.tsx index d27475d9..f5be3588 100644 --- a/src/components/Zoom/index.tsx +++ b/src/components/ZoomControl/index.tsx @@ -3,9 +3,9 @@ import { useUpdateEffect } from 'ahooks'; import type React from 'react'; import { useEffect, useRef } from 'react'; import { useScene } from '../LarkMap/hooks/use-scene'; -import type { ZoomProps } from './types'; +import type { ZoomControlProps } from './types'; -export const Zoom: React.FC = (props) => { +export const ZoomControl: React.FC = (props) => { const scene = useScene(); const zoomRef = useRef(); const { position } = props; diff --git a/src/components/Zoom/types.ts b/src/components/ZoomControl/types.ts similarity index 79% rename from src/components/Zoom/types.ts rename to src/components/ZoomControl/types.ts index ba5388af..fb4e9f64 100644 --- a/src/components/Zoom/types.ts +++ b/src/components/ZoomControl/types.ts @@ -4,7 +4,7 @@ import type { IZoomControlOption } from '@antv/l7-component'; /** * 组件类型定义 */ -export interface ZoomProps extends Partial> { +export interface ZoomControlProps extends Partial> { /** 位置,支持 'topright'、'topleft'、'bottomright'、'bottomleft'、'topcenter'、'bottomcenter'、'leftcenter'、'rightcenter' * @default "topleft" */ diff --git a/src/index.ts b/src/index.ts index 1cf4a80c..c53f8d48 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,10 +16,11 @@ export * from './components/Layers'; * */ export { CustomControl } from './components/CustomControl'; export { CustomControlProps } from './components/CustomControl/types'; -export { Scale } from './components/Scale'; -export { ScaleProps } from './components/Scale/types'; -export { Zoom } from './components/Zoom'; -export { ZoomProps } from './components/Zoom/types'; +// 兼容修改组件名称,带布局属性的组件加 Control 后缀 +export { ScaleControl, ScaleControl as Scale } from './components/ScaleControl'; +export { ScaleControlProps, ScaleControlProps as ScaleProps } from './components/ScaleControl/types'; +export { ZoomControl, ZoomControl as Zoom } from './components/ZoomControl'; +export { ZoomControlProps, ZoomControlProps as ZoomProps } from './components/ZoomControl/types'; /** * 分析组件 From c50204302e8b3700822d7134f74fa590f0d850f4 Mon Sep 17 00:00:00 2001 From: yunji Date: Mon, 8 Aug 2022 11:44:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=BC=95=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layers/BaseLayers/PointLayer/types.ts | 2 +- src/components/Layers/BaseLayers/PolygonLayer/types.ts | 2 +- src/components/Layers/BaseLayers/TextLayer/types.ts | 2 +- src/components/Layers/CompositeLayers/ChoroplethLayer/types.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Layers/BaseLayers/PointLayer/types.ts b/src/components/Layers/BaseLayers/PointLayer/types.ts index 647f0a1b..77f28fb6 100644 --- a/src/components/Layers/BaseLayers/PointLayer/types.ts +++ b/src/components/Layers/BaseLayers/PointLayer/types.ts @@ -1,5 +1,5 @@ import type { PointLayer, PointLayerOptions } from '@antv/l7-composite-layers'; -import type { LayerCommonProps } from '../../../types/common'; +import type { LayerCommonProps } from '../../../../types/common'; /** * 组件类型定义 diff --git a/src/components/Layers/BaseLayers/PolygonLayer/types.ts b/src/components/Layers/BaseLayers/PolygonLayer/types.ts index 0843d51f..40c8ab69 100644 --- a/src/components/Layers/BaseLayers/PolygonLayer/types.ts +++ b/src/components/Layers/BaseLayers/PolygonLayer/types.ts @@ -1,5 +1,5 @@ import type { PolygonLayer, PolygonLayerOptions } from '@antv/l7-composite-layers'; -import type { LayerCommonProps } from '../../../types/common'; +import type { LayerCommonProps } from '../../../../types/common'; /** * 组件类型定义 diff --git a/src/components/Layers/BaseLayers/TextLayer/types.ts b/src/components/Layers/BaseLayers/TextLayer/types.ts index baacca15..0d3b78cb 100644 --- a/src/components/Layers/BaseLayers/TextLayer/types.ts +++ b/src/components/Layers/BaseLayers/TextLayer/types.ts @@ -1,5 +1,5 @@ import type { TextLayer, TextLayerOptions } from '@antv/l7-composite-layers'; -import type { LayerCommonProps } from '../../../types/common'; +import type { LayerCommonProps } from '../../../../types/common'; /** * 组件类型定义 diff --git a/src/components/Layers/CompositeLayers/ChoroplethLayer/types.ts b/src/components/Layers/CompositeLayers/ChoroplethLayer/types.ts index dbc048fe..90d549e5 100644 --- a/src/components/Layers/CompositeLayers/ChoroplethLayer/types.ts +++ b/src/components/Layers/CompositeLayers/ChoroplethLayer/types.ts @@ -4,7 +4,7 @@ import type { ChoroplethLayerOptions, ChoroplethLayerSourceOptions, } from '@antv/l7-composite-layers'; -import type { LayerCommonProps } from '../../../types/common'; +import type { LayerCommonProps } from '../../../../types/common'; export type { ChoroplethLayerActiveOptions, ChoroplethLayerSourceOptions };