@antv/l7-mapkit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +165 -0
  2. package/dist/component/Control/CustomControl.d.ts +22 -0
  3. package/dist/component/Control/ExportImageControl.d.ts +36 -0
  4. package/dist/component/Control/FullscreenControl.d.ts +38 -0
  5. package/dist/component/Control/GeoLocateControl.d.ts +34 -0
  6. package/dist/component/Control/MapThemeControl.d.ts +56 -0
  7. package/dist/component/Control/MouseLocationControl.d.ts +30 -0
  8. package/dist/component/Control/ScaleControl.d.ts +36 -0
  9. package/dist/component/Control/ZoomControl.d.ts +34 -0
  10. package/dist/component/Control/types.d.ts +17 -0
  11. package/dist/component/Control.d.ts +44 -0
  12. package/dist/component/CustomControl.d.ts +32 -0
  13. package/dist/component/Layer.d.ts +79 -0
  14. package/dist/component/LayerAttribute/BaseLayer.d.ts +14 -0
  15. package/dist/component/LayerAttribute/index.d.ts +136 -0
  16. package/dist/component/LayerContext.d.ts +29 -0
  17. package/dist/component/Legend/LegendCategories.d.ts +26 -0
  18. package/dist/component/Legend/LegendIcon.d.ts +26 -0
  19. package/dist/component/Legend/LegendProportion.d.ts +19 -0
  20. package/dist/component/Legend/LegendRamp.d.ts +23 -0
  21. package/dist/component/LoadImage.d.ts +49 -0
  22. package/dist/component/MapScene/GaodeMapScene.d.ts +17 -0
  23. package/dist/component/MapScene/MapScene.d.ts +18 -0
  24. package/dist/component/MapScene/interface.d.ts +31 -0
  25. package/dist/component/Marker.d.ts +40 -0
  26. package/dist/component/MarkerLayer.d.ts +56 -0
  27. package/dist/component/Popup.d.ts +36 -0
  28. package/dist/component/SceneContext.d.ts +32 -0
  29. package/dist/index.d.ts +67 -0
  30. package/dist/l7-mapkit.js +1218 -0
  31. package/dist/l7-mapkit.umd.cjs +16 -0
  32. package/dist/utils/style.d.ts +7 -0
  33. package/package.json +69 -0
package/README.md ADDED
@@ -0,0 +1,165 @@
1
+ # @antv/l7-mapkit
2
+
3
+ > React components for AntV L7 geospatial visualization library. Built on React 18+ and @antv/l7 2.25+.
4
+
5
+ ## Features
6
+
7
+ - **🎯 Flat Props API** - Direct props like `colorField`, `sizeValues`, `shape` instead of nested objects
8
+ - **⚡ Event Handling** - Events directly attached to components (`onClick`, `onMouseEnter`) without separate event components
9
+ - **🧩 Composable** - Component composition pattern inspired by mapcn design philosophy
10
+ - **📦 TypeScript First** - Complete type definitions with JSDoc documentation
11
+ - **🤖 LLM Friendly** - Includes `llms.txt` and comprehensive API docs for AI assistants
12
+ - **🗺️ Multiple Maps** - Supports GaodeMap (高德) and built-in Map (no third-party dependency)
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @antv/l7-mapkit @antv/l7 @antv/l7-maps
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ```tsx
23
+ import { GaodeMapScene, PointLayer } from '@antv/l7-mapkit';
24
+
25
+ const data = {
26
+ type: 'FeatureCollection',
27
+ features: [
28
+ { type: 'Feature', geometry: { type: 'Point', coordinates: [120.19, 30.26] }, properties: { value: 80 } },
29
+ { type: 'Feature', geometry: { type: 'Point', coordinates: [121.47, 31.23] }, properties: { value: 120 } },
30
+ ],
31
+ };
32
+
33
+ function App() {
34
+ return (
35
+ <GaodeMapScene
36
+ style={{ width: '100%', height: '400px' }}
37
+ mapConfig={{ zoom: 7, center: [120.5, 30.8] }}
38
+ >
39
+ <PointLayer
40
+ source={data}
41
+ colorField="value"
42
+ colorValues={['#fee5d9', '#fc4e2a', '#800026']}
43
+ size={8}
44
+ shape="circle"
45
+ onClick={(e) => console.log(e.feature.properties)}
46
+ />
47
+ </GaodeMapScene>
48
+ );
49
+ }
50
+ ```
51
+
52
+ ## Components
53
+
54
+ ### Scene Components
55
+
56
+ - **`<GaodeMapScene>`** - Gaode Map container component
57
+ - **`<MapScene>`** - Built-in map container (no third-party dependency)
58
+
59
+ ### Layer Components
60
+
61
+ All layer components share the same flat props interface:
62
+
63
+ - **`<PointLayer>`** - Point/scatter layer
64
+ - **`<LineLayer>`** - Line/path layer (supports arc, greatcircle shapes)
65
+ - **`<PolygonLayer>`** - Polygon/area layer
66
+ - **`<HeatmapLayer>`** - Heatmap layer (2D/3D/hexagon/grid)
67
+ - **`<RasterLayer>`** - Raster/tile layer
68
+ - **`<ImageLayer>`** - Image overlay layer
69
+ - **`<CityBuildingLayer>`** - 3D building layer
70
+
71
+ ### Interactive Components
72
+
73
+ - **`<Marker>`** - Map marker with custom React content
74
+ - **`<MarkerLayer>`** - Batch markers with clustering support
75
+ - **`<Popup>`** - Map popup with custom React content
76
+ - **`<Control>`** - Built-in controls (zoom/scale/logo/layerSwitch/etc.)
77
+ - **`<CustomControl>`** - Custom control with any React content
78
+ - **`<LoadImage>` / `<LoadImages>`** - Load image resources
79
+
80
+ ### Hooks
81
+
82
+ - **`useScene()`** - Get current Scene instance (must be used inside Scene components)
83
+ - **`useLayer()`** - Get current Layer instance (must be used inside layer children)
84
+
85
+ ## Layer Props Reference
86
+
87
+ | Prop | Type | Description |
88
+ |------|------|-------------|
89
+ | `source` | any | Data source (GeoJSON/array/URL) **required** |
90
+ | `sourceConfig` | object | Data parser config `{ parser: { type: 'json', x: 'lng', y: 'lat' } }` |
91
+ | `color` | string | Fixed color value |
92
+ | `colorField` | string | Color mapping field name |
93
+ | `colorValues` | string[] \| fn | Color mapping values or callback |
94
+ | `size` | number | Fixed size in pixels |
95
+ | `sizeField` | string | Size mapping field name |
96
+ | `sizeValues` | number[] \| fn | Size mapping range `[min, max]` |
97
+ | `shape` | string | Shape type (circle/triangle/arc/etc.) |
98
+ | `style` | object | Layer style `{ opacity, stroke, strokeWidth }` |
99
+ | `filterField` | string | Filter field name |
100
+ | `filterValues` | any[] \| fn | Filter values or callback |
101
+ | `animate` | object | Animation config `{ enable, speed, trailLength }` |
102
+ | `active` | boolean \| object | Hover highlight |
103
+ | `select` | boolean \| object | Click selection |
104
+ | `onClick` | fn | Click event handler |
105
+ | `onMouseEnter` | fn | Mouse enter handler |
106
+ | `onMouseLeave` | fn | Mouse leave handler |
107
+ | `onLoaded` | fn(layer, scene) | Layer loaded callback |
108
+
109
+ ## Migration from 2.x
110
+
111
+ L7-MapKit 3.0 is a complete rewrite with breaking changes:
112
+
113
+ ### Before (2.x)
114
+ ```tsx
115
+ <PointLayer
116
+ source={{ data }}
117
+ color={{ field: 'value', values: ['red', 'blue'] }}
118
+ size={{ field: 'count', values: [5, 20] }}
119
+ />
120
+ <LayerEvent type="click" handler={handleClick} />
121
+ ```
122
+
123
+ ### After (3.0)
124
+ ```tsx
125
+ <PointLayer
126
+ source={data}
127
+ colorField="value"
128
+ colorValues={['red', 'blue']}
129
+ sizeField="count"
130
+ sizeValues={[5, 20]}
131
+ onClick={handleClick}
132
+ />
133
+ ```
134
+
135
+ Key changes:
136
+ - ✅ Flat props instead of nested objects
137
+ - ✅ Events directly on components (no `LayerEvent`/`SceneEvent`)
138
+ - ✅ All class components converted to function components with hooks
139
+ - ✅ Only GaodeMap and built-in Map supported (Mapbox removed)
140
+ - ✅ React 18+ only (uses `useId`, strict mode safe)
141
+
142
+ ## Documentation
143
+
144
+ - [Full API Reference](docs/llms-full.md)
145
+ - [LLM-friendly docs](llms.txt)
146
+
147
+ ## Development
148
+
149
+ ```bash
150
+ # Install dependencies
151
+ npm install
152
+
153
+ # Type check
154
+ npm run type-check
155
+
156
+ # Build
157
+ npm run build
158
+
159
+ # Watch mode
160
+ npm run dev
161
+ ```
162
+
163
+ ## License
164
+
165
+ MIT
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 自定义控件属性
5
+ */
6
+ export interface CustomControlProps {
7
+ /** 控件位置 */
8
+ position?: ControlPosition;
9
+ /** 控件名称 */
10
+ name?: string;
11
+ /** 自定义类名 */
12
+ className?: string;
13
+ /** 自定义样式 */
14
+ style?: React.CSSProperties;
15
+ /** 子组件 */
16
+ children?: React.ReactNode;
17
+ }
18
+ /**
19
+ * 自定义控件组件
20
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
21
+ */
22
+ export declare const CustomControl: React.FC<CustomControlProps>;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 导出图片控件属性
5
+ */
6
+ export interface ExportImageControlProps {
7
+ /** 控件位置 */
8
+ position?: ControlPosition;
9
+ /** 图片类型 */
10
+ imageType?: 'png' | 'jpeg';
11
+ /** 按钮文本 */
12
+ btnText?: string;
13
+ /** 按钮标题 */
14
+ title?: string;
15
+ /** 是否垂直布局 */
16
+ vertical?: boolean;
17
+ /** 自定义类名 */
18
+ className?: string;
19
+ /** 自定义样式 */
20
+ style?: React.CSSProperties;
21
+ /** 控件添加回调 */
22
+ onAdd?: () => void;
23
+ /** 控件移除回调 */
24
+ onRemove?: () => void;
25
+ /** 控件显示回调 */
26
+ onShow?: () => void;
27
+ /** 控件隐藏回调 */
28
+ onHide?: () => void;
29
+ /** 导出回调 */
30
+ onExport?: (dataUrl: string) => void;
31
+ }
32
+ /**
33
+ * 导出图片控件组件
34
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
35
+ */
36
+ export declare const ExportImageControl: React.FC<ExportImageControlProps>;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 全屏控件属性
5
+ */
6
+ export interface FullscreenControlProps {
7
+ /** 控件位置 */
8
+ position?: ControlPosition;
9
+ /** 按钮文本 */
10
+ btnText?: string;
11
+ /** 按钮标题 */
12
+ title?: string;
13
+ /** 是否垂直布局 */
14
+ vertical?: boolean;
15
+ /** 退出按钮文本 */
16
+ exitBtnText?: string;
17
+ /** 退出按钮标题 */
18
+ exitTitle?: string;
19
+ /** 自定义类名 */
20
+ className?: string;
21
+ /** 自定义样式 */
22
+ style?: React.CSSProperties;
23
+ /** 控件添加回调 */
24
+ onAdd?: () => void;
25
+ /** 控件移除回调 */
26
+ onRemove?: () => void;
27
+ /** 控件显示回调 */
28
+ onShow?: () => void;
29
+ /** 控件隐藏回调 */
30
+ onHide?: () => void;
31
+ /** 全屏状态变化回调 */
32
+ onFullscreenChange?: (isFullscreen: boolean) => void;
33
+ }
34
+ /**
35
+ * 全屏控件组件
36
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
37
+ */
38
+ export declare const FullscreenControl: React.FC<FullscreenControlProps>;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 定位控件属性
5
+ */
6
+ export interface GeoLocateControlProps {
7
+ /** 控件位置 */
8
+ position?: ControlPosition;
9
+ /** 按钮文本 */
10
+ btnText?: string;
11
+ /** 按钮标题 */
12
+ title?: string;
13
+ /** 是否垂直布局 */
14
+ vertical?: boolean;
15
+ /** 坐标转换函数 */
16
+ transform?: (lnglat: [number, number]) => [number, number];
17
+ /** 自定义类名 */
18
+ className?: string;
19
+ /** 自定义样式 */
20
+ style?: React.CSSProperties;
21
+ /** 控件添加回调 */
22
+ onAdd?: () => void;
23
+ /** 控件移除回调 */
24
+ onRemove?: () => void;
25
+ /** 控件显示回调 */
26
+ onShow?: () => void;
27
+ /** 控件隐藏回调 */
28
+ onHide?: () => void;
29
+ }
30
+ /**
31
+ * 定位控件组件
32
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
33
+ */
34
+ export declare const GeoLocateControl: React.FC<GeoLocateControlProps>;
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 地图主题选项
5
+ */
6
+ export interface MapThemeOption {
7
+ /** 主题值 */
8
+ value: string;
9
+ /** 显示文本 */
10
+ text: string;
11
+ [key: string]: any;
12
+ }
13
+ /**
14
+ * 地图主题控件属性
15
+ */
16
+ export interface MapThemeControlProps {
17
+ /** 控件位置 */
18
+ position?: ControlPosition;
19
+ /** 主题选项列表 */
20
+ options?: MapThemeOption[];
21
+ /** 按钮文本 */
22
+ btnText?: string;
23
+ /** 按钮标题 */
24
+ title?: string;
25
+ /** 是否垂直布局 */
26
+ vertical?: boolean;
27
+ /** Popper 放置位置 */
28
+ popperPlacement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
29
+ /** Popper 触发方式 */
30
+ popperTrigger?: 'click' | 'hover';
31
+ /** Popper 类名 */
32
+ popperClassName?: string;
33
+ /** 自定义类名 */
34
+ className?: string;
35
+ /** 自定义样式 */
36
+ style?: React.CSSProperties;
37
+ /** 控件添加回调 */
38
+ onAdd?: () => void;
39
+ /** 控件移除回调 */
40
+ onRemove?: () => void;
41
+ /** 控件显示回调 */
42
+ onShow?: () => void;
43
+ /** 控件隐藏回调 */
44
+ onHide?: () => void;
45
+ /** Popper 显示回调 */
46
+ onPopperShow?: () => void;
47
+ /** Popper 隐藏回调 */
48
+ onPopperHide?: () => void;
49
+ /** 选择变化回调 */
50
+ onSelectChange?: (value: string) => void;
51
+ }
52
+ /**
53
+ * 地图主题控件组件
54
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
55
+ */
56
+ export declare const MapThemeControl: React.FC<MapThemeControlProps>;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 鼠标位置控件属性
5
+ */
6
+ export interface MouseLocationControlProps {
7
+ /** 控件位置 */
8
+ position?: ControlPosition;
9
+ /** 自定义类名 */
10
+ className?: string;
11
+ /** 自定义样式 */
12
+ style?: React.CSSProperties;
13
+ /** 坐标转换函数 */
14
+ transform?: (position: any) => any;
15
+ /** 控件添加回调 */
16
+ onAdd?: () => void;
17
+ /** 控件移除回调 */
18
+ onRemove?: () => void;
19
+ /** 控件显示回调 */
20
+ onShow?: () => void;
21
+ /** 控件隐藏回调 */
22
+ onHide?: () => void;
23
+ /** 位置变化回调 */
24
+ onLocationChange?: (lnglat: [number, number]) => void;
25
+ }
26
+ /**
27
+ * 鼠标位置控件组件
28
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
29
+ */
30
+ export declare const MouseLocationControl: React.FC<MouseLocationControlProps>;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 比例尺控件属性
5
+ */
6
+ export interface ScaleControlProps {
7
+ /** 控件位置 */
8
+ position?: ControlPosition;
9
+ /** 自定义类名 */
10
+ className?: string;
11
+ /** 自定义样式 */
12
+ style?: React.CSSProperties;
13
+ /** 是否锁定宽度 */
14
+ lockWidth?: boolean;
15
+ /** 最大宽度 */
16
+ maxWidth?: number;
17
+ /** 是否显示公制单位 */
18
+ metric?: boolean;
19
+ /** 是否显示英制单位 */
20
+ imperial?: boolean;
21
+ /** 是否在地图静止时更新 */
22
+ updateWhenIdle?: boolean;
23
+ /** 控件添加回调 */
24
+ onAdd?: () => void;
25
+ /** 控件移除回调 */
26
+ onRemove?: () => void;
27
+ /** 控件显示回调 */
28
+ onShow?: () => void;
29
+ /** 控件隐藏回调 */
30
+ onHide?: () => void;
31
+ }
32
+ /**
33
+ * 比例尺控件组件
34
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
35
+ */
36
+ export declare const ScaleControl: React.FC<ScaleControlProps>;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import type { ControlPosition } from './types';
3
+ /**
4
+ * 缩放控件属性
5
+ */
6
+ export interface ZoomControlProps {
7
+ /** 控件位置 */
8
+ position?: ControlPosition;
9
+ /** 缩放按钮文本 */
10
+ zoomInText?: React.ReactNode;
11
+ zoomOutText?: React.ReactNode;
12
+ /** 缩放按钮标题 */
13
+ zoomInTitle?: string;
14
+ zoomOutTitle?: string;
15
+ /** 是否显示缩放级别 */
16
+ showZoom?: boolean;
17
+ /** 自定义类名 */
18
+ className?: string;
19
+ /** 自定义样式 */
20
+ style?: React.CSSProperties;
21
+ /** 控件添加回调 */
22
+ onAdd?: () => void;
23
+ /** 控件移除回调 */
24
+ onRemove?: () => void;
25
+ /** 控件显示回调 */
26
+ onShow?: () => void;
27
+ /** 控件隐藏回调 */
28
+ onHide?: () => void;
29
+ }
30
+ /**
31
+ * 缩放控件组件
32
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
33
+ */
34
+ export declare const ZoomControl: React.FC<ZoomControlProps>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 控件位置类型
3
+ */
4
+ export type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
5
+ /**
6
+ * 控件回调接口
7
+ */
8
+ export interface IControlCallback<T> {
9
+ /** 控件添加回调 */
10
+ onAdd?: () => void;
11
+ /** 控件移除回调 */
12
+ onRemove?: () => void;
13
+ /** 控件显示回调 */
14
+ onShow?: () => void;
15
+ /** 控件隐藏回调 */
16
+ onHide?: () => void;
17
+ }
@@ -0,0 +1,44 @@
1
+ import type { PositionName } from '@antv/l7';
2
+ import React from 'react';
3
+ /**
4
+ * 内置控件类型
5
+ * - zoom: 缩放控件
6
+ * - scale: 比例尺控件
7
+ * - logo: Logo 控件
8
+ * - layerSwitch: 图层切换控件
9
+ * - mouseLocation: 鼠标坐标控件
10
+ * - mapTheme: 地图主题控件
11
+ * - geoLocate: 定位控件
12
+ * - exportImage: 导出图片控件
13
+ * - fullscreen: 全屏控件
14
+ * - swipe: 卷帘对比控件
15
+ */
16
+ export type ControlType = 'zoom' | 'scale' | 'logo' | 'layerSwitch' | 'mouseLocation' | 'mapTheme' | 'geoLocate' | 'exportImage' | 'fullscreen' | 'swipe';
17
+ export interface IControlProps {
18
+ /**
19
+ * 控件类型
20
+ * @see ControlType
21
+ */
22
+ type: ControlType;
23
+ /**
24
+ * 控件位置
25
+ * @default 'bottomright'
26
+ */
27
+ position?: PositionName;
28
+ /** 透传给控件构造器的其他配置项 */
29
+ [key: string]: any;
30
+ }
31
+ /**
32
+ * 内置地图控件组件,必须在 GaodeMapScene 或 MapScene 内部使用。
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <GaodeMapScene ...>
37
+ * <Control type="zoom" position="topleft" />
38
+ * <Control type="scale" position="bottomleft" />
39
+ * <Control type="layerSwitch" position="topright" />
40
+ * </GaodeMapScene>
41
+ * ```
42
+ */
43
+ declare const _default: React.NamedExoticComponent<IControlProps>;
44
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import type { PositionName } from '@antv/l7';
2
+ import React from 'react';
3
+ export interface ICustomControlProps {
4
+ /**
5
+ * 控件位置
6
+ * @default 'topright'
7
+ */
8
+ position?: PositionName;
9
+ /** 控件容器 className */
10
+ className?: string;
11
+ /** 控件容器内联样式 */
12
+ style?: React.CSSProperties;
13
+ /** 自定义控件内容 */
14
+ children?: React.ReactNode;
15
+ }
16
+ /**
17
+ * 自定义地图控件组件,支持将任意 React 内容渲染到地图控件区域。
18
+ * 必须在 GaodeMapScene 或 MapScene 内部使用。
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <GaodeMapScene ...>
23
+ * <CustomControl position="topright" className="my-legend">
24
+ * <div style={{ background: 'white', padding: 8 }}>
25
+ * <h4>图例</h4>
26
+ * <span style={{ color: '#f00' }}>● 高值</span>
27
+ * </div>
28
+ * </CustomControl>
29
+ * </GaodeMapScene>
30
+ * ```
31
+ */
32
+ export default function CustomControl(props: ICustomControlProps): React.ReactPortal | null;
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import type { ILayerProps } from './LayerAttribute/index';
3
+ /**
4
+ * 点图层,适合渲染散点、气泡、热力等点数据。
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <PointLayer
9
+ * source={data}
10
+ * sourceConfig={{ parser: { type: 'json', x: 'lng', y: 'lat' } }}
11
+ * colorField="value"
12
+ * colorValues={['#f0f9e8', '#08589e']}
13
+ * size={6}
14
+ * shape="circle"
15
+ * onClick={(e) => console.log(e)}
16
+ * />
17
+ * ```
18
+ */
19
+ export declare const PointLayer: React.NamedExoticComponent<ILayerProps>;
20
+ /**
21
+ * 线图层,适合渲染路径、边界、轨迹等线数据。
22
+ * shape 支持:'line' | 'arc' | 'arc3d' | 'greatcircle'
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <LineLayer
27
+ * source={geojson}
28
+ * color="#1890ff"
29
+ * size={2}
30
+ * style={{ opacity: 0.8 }}
31
+ * />
32
+ * ```
33
+ */
34
+ export declare const LineLayer: React.NamedExoticComponent<ILayerProps>;
35
+ /**
36
+ * 面图层,适合渲染行政区划、围栏、区域填充等面数据。
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * <PolygonLayer
41
+ * source={geoData}
42
+ * colorField="value"
43
+ * colorValues={['#edf8e9', '#006d2c']}
44
+ * style={{ opacity: 0.6 }}
45
+ * active
46
+ * />
47
+ * ```
48
+ */
49
+ export declare const PolygonLayer: React.NamedExoticComponent<ILayerProps>;
50
+ /**
51
+ * 热力图层,适合渲染密度分布、强度分布等热力数据。
52
+ * shape 支持:'heatmap' | 'heatmap3d' | 'hexagon' | 'grid'
53
+ *
54
+ * @example
55
+ * ```tsx
56
+ * <HeatmapLayer
57
+ * source={points}
58
+ * sourceConfig={{ parser: { type: 'json', x: 'lng', y: 'lat' } }}
59
+ * colorValues={['#f7fbff', '#08306b']}
60
+ * shape="heatmap"
61
+ * />
62
+ * ```
63
+ */
64
+ export declare const HeatmapLayer: React.NamedExoticComponent<ILayerProps>;
65
+ /**
66
+ * 栅格图层,适合渲染影像、遥感等栅格数据。
67
+ */
68
+ export declare const RasterLayer: React.NamedExoticComponent<ILayerProps>;
69
+ /**
70
+ * 图片图层,将一张图片叠加到地图指定范围。
71
+ *
72
+ * @example
73
+ * ```tsx
74
+ * <ImageLayer
75
+ * source={{ data: 'https://example.com/image.png', bounds: [73, 3, 135, 53] }}
76
+ * />
77
+ * ```
78
+ */
79
+ export declare const ImageLayer: React.NamedExoticComponent<ILayerProps>;
@@ -0,0 +1,14 @@
1
+ import type { ILayerProps } from './index';
2
+ interface IBaseLayerProps extends ILayerProps {
3
+ layerType: string;
4
+ }
5
+ /**
6
+ * 所有图层组件的基础实现,负责:
7
+ * 1. 创建 L7 图层实例
8
+ * 2. 将扁平 props 映射到图层 API 调用
9
+ * 3. 响应 props 变化并更新图层
10
+ * 4. 注册/注销事件监听
11
+ * 5. 提供 LayerContext 供子组件使用
12
+ */
13
+ export declare function BaseLayer(props: IBaseLayerProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};