Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 调整图层组件分类 #32

Merged
merged 2 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
toc: content
order: 6
order: 4
group:
title: 图层组件
title: 基础图层
order: 1
nav:
title: 组件
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
* 组件类型定义
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
toc: content
order: 4
order: 2
group:
title: 图层组件
title: 基础图层
order: 1
nav:
title: 组件
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
* 组件类型定义
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
toc: content
order: 3
order: 1
group:
title: 图层组件
title: 基础图层
order: 1
nav:
title: 组件
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
* 组件类型定义
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
toc: content
order: 5
order: 3
group:
title: 图层组件
title: 基础图层
order: 1
nav:
title: 组件
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
* 组件类型定义
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
toc: content
order: 7
order: 5
group:
title: 图层组件
title: 基础图层
order: 1
nav:
title: 组件
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
* 组件类型定义
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
toc: content
order: 1
group:
title: 图层组件
title: 复合图层
order: 1
nav:
title: 组件
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
toc: content
order: 2
group:
title: 图层组件
title: 复合图层
order: 1
nav:
title: 组件
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
29 changes: 15 additions & 14 deletions src/components/Layers/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { LarkMap, Scale } from '@antv/larkmap';
import { LarkMap, ScaleControl } from '@antv/larkmap';
import React from 'react';

export default () => {
return (
<LarkMap mapType="GaodeV1" style={{ height: '300px' }}>
<Scale position="bottomleft" />
<ScaleControl position="bottomleft" />
</LarkMap>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nav:
path: /components
---

# 比例尺 - Scale
# 比例尺 - ScaleControl

## 介绍

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ScaleProps>((props) => {
export const ScaleControl = memo<ScaleControlProps>((props) => {
const scene = useScene();
const scaleRef = useRef<L7Scale>();
const { position } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IScaleControlOption } from '@antv/l7-component';
/**
* 组件类型定义
*/
export interface ScaleProps extends Partial<Omit<IScaleControlOption, 'name'>> {
export interface ScaleControlProps extends Partial<Omit<IScaleControlOption, 'name'>> {
/** 位置,支持 'topright'、'topleft'、'bottomright'、'bottomleft'、'topcenter'、'bottomcenter'、'leftcenter'、'rightcenter'
* @default "bottomleft"
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { LarkMap, Zoom } from '@antv/larkmap';
import { LarkMap, ZoomControl } from '@antv/larkmap';
import React from 'react';

export default () => {
return (
<LarkMap mapType="GaodeV1" style={{ height: '300px' }}>
<Zoom position="bottomright" />
<ZoomControl position="bottomright" />
</LarkMap>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nav:
path: /components
---

# 缩放器 - Zoom
# 缩放器 - ZoomControl

## 介绍

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ZoomProps> = (props) => {
export const ZoomControl: React.FC<ZoomControlProps> = (props) => {
const scene = useScene();
const zoomRef = useRef<L7Zoom>();
const { position } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IZoomControlOption } from '@antv/l7-component';
/**
* 组件类型定义
*/
export interface ZoomProps extends Partial<Omit<IZoomControlOption, 'name'>> {
export interface ZoomControlProps extends Partial<Omit<IZoomControlOption, 'name'>> {
/** 位置,支持 'topright'、'topleft'、'bottomright'、'bottomleft'、'topcenter'、'bottomcenter'、'leftcenter'、'rightcenter'
* @default "topleft"
*/
Expand Down
9 changes: 5 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
* 分析组件
Expand Down