@antv/l7-mapkit 0.4.0 → 0.4.4

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 (34) hide show
  1. package/es/index.d.ts +990 -0
  2. package/lib/index.js +16 -0
  3. package/package.json +11 -9
  4. package/dist/component/Control/CustomControl.d.ts +0 -22
  5. package/dist/component/Control/ExportImageControl.d.ts +0 -36
  6. package/dist/component/Control/FullscreenControl.d.ts +0 -38
  7. package/dist/component/Control/GeoLocateControl.d.ts +0 -34
  8. package/dist/component/Control/MapThemeControl.d.ts +0 -56
  9. package/dist/component/Control/MouseLocationControl.d.ts +0 -30
  10. package/dist/component/Control/ScaleControl.d.ts +0 -36
  11. package/dist/component/Control/ZoomControl.d.ts +0 -34
  12. package/dist/component/Control/types.d.ts +0 -17
  13. package/dist/component/Control.d.ts +0 -44
  14. package/dist/component/CustomControl.d.ts +0 -32
  15. package/dist/component/Layer.d.ts +0 -79
  16. package/dist/component/LayerAttribute/BaseLayer.d.ts +0 -14
  17. package/dist/component/LayerAttribute/index.d.ts +0 -136
  18. package/dist/component/LayerContext.d.ts +0 -29
  19. package/dist/component/Legend/LegendCategories.d.ts +0 -26
  20. package/dist/component/Legend/LegendIcon.d.ts +0 -26
  21. package/dist/component/Legend/LegendProportion.d.ts +0 -19
  22. package/dist/component/Legend/LegendRamp.d.ts +0 -23
  23. package/dist/component/LoadImage.d.ts +0 -49
  24. package/dist/component/MapScene/GaodeMapScene.d.ts +0 -17
  25. package/dist/component/MapScene/MapScene.d.ts +0 -18
  26. package/dist/component/MapScene/interface.d.ts +0 -31
  27. package/dist/component/Marker.d.ts +0 -40
  28. package/dist/component/MarkerLayer.d.ts +0 -56
  29. package/dist/component/Popup.d.ts +0 -36
  30. package/dist/component/SceneContext.d.ts +0 -32
  31. package/dist/index.d.ts +0 -67
  32. package/dist/l7-mapkit.umd.cjs +0 -16
  33. package/dist/utils/style.d.ts +0 -7
  34. /package/{dist/l7-mapkit.js → es/index.js} +0 -0
package/es/index.d.ts ADDED
@@ -0,0 +1,990 @@
1
+ import { Context } from 'react';
2
+ import { default as default_2 } from 'react';
3
+ import { IActiveOption } from '@antv/l7';
4
+ import { IAnimateOption } from '@antv/l7';
5
+ import { ILayer } from '@antv/l7';
6
+ import { IMapConfig } from '@antv/l7';
7
+ import { IMarkerLayerOption } from '@antv/l7';
8
+ import { IMarkerOption } from '@antv/l7';
9
+ import { IPopupOption } from '@antv/l7';
10
+ import { ISceneConfig } from '@antv/l7';
11
+ import { ISourceCFG } from '@antv/l7';
12
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
13
+ import { Marker as Marker_2 } from '@antv/l7';
14
+ import { MarkerLayer as MarkerLayer_2 } from '@antv/l7';
15
+ import { PositionName } from '@antv/l7';
16
+ import { Scene } from '@antv/l7';
17
+
18
+ /**
19
+ * 内置地图控件组件,必须在 GaodeMapScene 或 MapScene 内部使用。
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <GaodeMapScene ...>
24
+ * <Control type="zoom" position="topleft" />
25
+ * <Control type="scale" position="bottomleft" />
26
+ * <Control type="layerSwitch" position="topright" />
27
+ * </GaodeMapScene>
28
+ * ```
29
+ */
30
+ export declare const Control: default_2.NamedExoticComponent<IControlProps>;
31
+
32
+ /**
33
+ * 控件位置类型
34
+ */
35
+ declare type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
36
+
37
+ /**
38
+ * 内置控件类型
39
+ * - zoom: 缩放控件
40
+ * - scale: 比例尺控件
41
+ * - logo: Logo 控件
42
+ * - layerSwitch: 图层切换控件
43
+ * - mouseLocation: 鼠标坐标控件
44
+ * - mapTheme: 地图主题控件
45
+ * - geoLocate: 定位控件
46
+ * - exportImage: 导出图片控件
47
+ * - fullscreen: 全屏控件
48
+ * - swipe: 卷帘对比控件
49
+ */
50
+ export declare type ControlType = 'zoom' | 'scale' | 'logo' | 'layerSwitch' | 'mouseLocation' | 'mapTheme' | 'geoLocate' | 'exportImage' | 'fullscreen' | 'swipe';
51
+
52
+ /**
53
+ * 自定义地图控件组件,支持将任意 React 内容渲染到地图控件区域。
54
+ * 必须在 GaodeMapScene 或 MapScene 内部使用。
55
+ *
56
+ * @example
57
+ * ```tsx
58
+ * <GaodeMapScene ...>
59
+ * <CustomControl position="topright" className="my-legend">
60
+ * <div style={{ background: 'white', padding: 8 }}>
61
+ * <h4>图例</h4>
62
+ * <span style={{ color: '#f00' }}>● 高值</span>
63
+ * </div>
64
+ * </CustomControl>
65
+ * </GaodeMapScene>
66
+ * ```
67
+ */
68
+ export declare function CustomControl(props: ICustomControlProps): default_2.ReactPortal | null;
69
+
70
+ /**
71
+ * 导出图片控件组件
72
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
73
+ */
74
+ export declare const ExportImageControl: default_2.FC<ExportImageControlProps>;
75
+
76
+ /**
77
+ * 导出图片控件属性
78
+ */
79
+ export declare interface ExportImageControlProps {
80
+ /** 控件位置 */
81
+ position?: ControlPosition;
82
+ /** 图片类型 */
83
+ imageType?: 'png' | 'jpeg';
84
+ /** 按钮文本 */
85
+ btnText?: string;
86
+ /** 按钮标题 */
87
+ title?: string;
88
+ /** 是否垂直布局 */
89
+ vertical?: boolean;
90
+ /** 自定义类名 */
91
+ className?: string;
92
+ /** 自定义样式 */
93
+ style?: default_2.CSSProperties;
94
+ /** 控件添加回调 */
95
+ onAdd?: () => void;
96
+ /** 控件移除回调 */
97
+ onRemove?: () => void;
98
+ /** 控件显示回调 */
99
+ onShow?: () => void;
100
+ /** 控件隐藏回调 */
101
+ onHide?: () => void;
102
+ /** 导出回调 */
103
+ onExport?: (dataUrl: string) => void;
104
+ }
105
+
106
+ /**
107
+ * 全屏控件组件
108
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
109
+ */
110
+ export declare const FullscreenControl: default_2.FC<FullscreenControlProps>;
111
+
112
+ /**
113
+ * 全屏控件属性
114
+ */
115
+ export declare interface FullscreenControlProps {
116
+ /** 控件位置 */
117
+ position?: ControlPosition;
118
+ /** 按钮文本 */
119
+ btnText?: string;
120
+ /** 按钮标题 */
121
+ title?: string;
122
+ /** 是否垂直布局 */
123
+ vertical?: boolean;
124
+ /** 退出按钮文本 */
125
+ exitBtnText?: string;
126
+ /** 退出按钮标题 */
127
+ exitTitle?: string;
128
+ /** 自定义类名 */
129
+ className?: string;
130
+ /** 自定义样式 */
131
+ style?: default_2.CSSProperties;
132
+ /** 控件添加回调 */
133
+ onAdd?: () => void;
134
+ /** 控件移除回调 */
135
+ onRemove?: () => void;
136
+ /** 控件显示回调 */
137
+ onShow?: () => void;
138
+ /** 控件隐藏回调 */
139
+ onHide?: () => void;
140
+ /** 全屏状态变化回调 */
141
+ onFullscreenChange?: (isFullscreen: boolean) => void;
142
+ }
143
+
144
+ /**
145
+ * 高德地图 Scene 组件,基于 @antv/l7 和高德地图 JS API。
146
+ *
147
+ * @example
148
+ * ```tsx
149
+ * <GaodeMapScene
150
+ * style={{ width: '100%', height: '400px' }}
151
+ * mapConfig={{ zoom: 10, center: [120.19, 30.26] }}
152
+ * onLoaded={(scene) => console.log('loaded', scene)}
153
+ * >
154
+ * <PointLayer source={data} colorField="value" colorValues={['#f00','#00f']} />
155
+ * </GaodeMapScene>
156
+ * ```
157
+ */
158
+ export declare function GaodeMapScene(props: ISceneProps): JSX_2.Element;
159
+
160
+ /**
161
+ * 定位控件组件
162
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
163
+ */
164
+ export declare const GeoLocateControl: default_2.FC<GeoLocateControlProps>;
165
+
166
+ /**
167
+ * 定位控件属性
168
+ */
169
+ export declare interface GeoLocateControlProps {
170
+ /** 控件位置 */
171
+ position?: ControlPosition;
172
+ /** 按钮文本 */
173
+ btnText?: string;
174
+ /** 按钮标题 */
175
+ title?: string;
176
+ /** 是否垂直布局 */
177
+ vertical?: boolean;
178
+ /** 坐标转换函数 */
179
+ transform?: (lnglat: [number, number]) => [number, number];
180
+ /** 自定义类名 */
181
+ className?: string;
182
+ /** 自定义样式 */
183
+ style?: default_2.CSSProperties;
184
+ /** 控件添加回调 */
185
+ onAdd?: () => void;
186
+ /** 控件移除回调 */
187
+ onRemove?: () => void;
188
+ /** 控件显示回调 */
189
+ onShow?: () => void;
190
+ /** 控件隐藏回调 */
191
+ onHide?: () => void;
192
+ }
193
+
194
+ /**
195
+ * 热力图层,适合渲染密度分布、强度分布等热力数据。
196
+ * shape 支持:'heatmap' | 'heatmap3d' | 'hexagon' | 'grid'
197
+ *
198
+ * @example
199
+ * ```tsx
200
+ * <HeatmapLayer
201
+ * source={points}
202
+ * sourceConfig={{ parser: { type: 'json', x: 'lng', y: 'lat' } }}
203
+ * colorValues={['#f7fbff', '#08306b']}
204
+ * shape="heatmap"
205
+ * />
206
+ * ```
207
+ */
208
+ export declare const HeatmapLayer: default_2.NamedExoticComponent<ILayerProps>;
209
+
210
+ export declare interface IControlProps {
211
+ /**
212
+ * 控件类型
213
+ * @see ControlType
214
+ */
215
+ type: ControlType;
216
+ /**
217
+ * 控件位置
218
+ * @default 'bottomright'
219
+ */
220
+ position?: PositionName;
221
+ /** 透传给控件构造器的其他配置项 */
222
+ [key: string]: any;
223
+ }
224
+
225
+ export declare interface ICustomControlProps {
226
+ /**
227
+ * 控件位置
228
+ * @default 'topright'
229
+ */
230
+ position?: PositionName;
231
+ /** 控件容器 className */
232
+ className?: string;
233
+ /** 控件容器内联样式 */
234
+ style?: default_2.CSSProperties;
235
+ /** 自定义控件内容 */
236
+ children?: default_2.ReactNode;
237
+ }
238
+
239
+ /**
240
+ * 所有图层组件的通用 Props 接口。
241
+ * 采用扁平设计,所有视觉映射字段直接作为顶层 props。
242
+ *
243
+ * @example
244
+ * ```tsx
245
+ * <PointLayer
246
+ * source={data}
247
+ * sourceConfig={{ parser: { type: 'json', x: 'lng', y: 'lat' } }}
248
+ * colorField="value"
249
+ * colorValues={['#f00', '#0f0', '#00f']}
250
+ * size={8}
251
+ * shape="circle"
252
+ * onClick={(e) => console.log(e)}
253
+ * />
254
+ * ```
255
+ */
256
+ export declare interface ILayerProps {
257
+ /** 图层名称,用于 LayerSwitch 控件中显示 */
258
+ name?: string;
259
+ /** 是否可见,默认 true */
260
+ visible?: boolean;
261
+ /** 图层层级,数值越大越靠上,默认 0 */
262
+ zIndex?: number;
263
+ /** 最小显示缩放层级 */
264
+ minZoom?: number;
265
+ /** 最大显示缩放层级 */
266
+ maxZoom?: number;
267
+ /** 混合模式,如 'normal' | 'additive' | 'subtractive' */
268
+ blend?: string;
269
+ /** 是否在图层加载后自动缩放到数据范围,默认 false */
270
+ autoFit?: boolean;
271
+ /**
272
+ * 数据源,支持:
273
+ * - GeoJSON FeatureCollection
274
+ * - 普通数组(需配合 sourceConfig.parser 使用)
275
+ * - URL 字符串(CSV/GeoJSON 远程地址)
276
+ */
277
+ source: any;
278
+ /**
279
+ * 数据源配置,用于指定 parser(解析器)和 transforms(数据转换)。
280
+ * @example
281
+ * ```ts
282
+ * sourceConfig={{ parser: { type: 'json', x: 'lng', y: 'lat' } }}
283
+ * sourceConfig={{ parser: { type: 'csv', x: 'longitude', y: 'latitude' } }}
284
+ * ```
285
+ */
286
+ sourceConfig?: Omit<ISourceCFG, 'data'>;
287
+ /**
288
+ * 固定颜色值,如 '#ff0000' 或 'red'。
289
+ * 与 colorField/colorValues 互斥。
290
+ */
291
+ color?: string;
292
+ /** 颜色映射的数据字段名 */
293
+ colorField?: string;
294
+ /**
295
+ * 颜色映射值,与 colorField 配合使用。
296
+ * - 数组:按数据值范围映射到颜色列表
297
+ * - 函数:自定义映射逻辑
298
+ * @example colorValues={['#fee5d9', '#fc4e2a', '#800026']}
299
+ */
300
+ colorValues?: string[] | ((fieldValue: any) => string);
301
+ /** 固定尺寸值(像素) */
302
+ size?: number;
303
+ /** 尺寸映射的数据字段名 */
304
+ sizeField?: string;
305
+ /**
306
+ * 尺寸映射范围,与 sizeField 配合使用。
307
+ * @example sizeValues={[2, 20]}
308
+ */
309
+ sizeValues?: number[] | ((fieldValue: any) => number);
310
+ /**
311
+ * 形状,具体值取决于图层类型:
312
+ * - PointLayer: 'circle' | 'triangle' | 'square' | 'hexagon' | 'cylinder' 等
313
+ * - LineLayer: 'line' | 'arc' | 'arc3d' | 'greatcircle' 等
314
+ */
315
+ shape?: string;
316
+ /** 形状映射的数据字段名 */
317
+ shapeField?: string;
318
+ /** 形状映射值,与 shapeField 配合使用 */
319
+ shapeValues?: string[] | ((fieldValue: any) => string);
320
+ /**
321
+ * 图层样式对象,属性取决于图层类型:
322
+ * - 通用: { opacity: 0.8 }
323
+ * - LineLayer: { lineWidth: 2, lineColor: '#f00' }
324
+ * - PointLayer: { stroke: '#fff', strokeWidth: 2 }
325
+ */
326
+ style?: Record<string, any>;
327
+ /** 数据过滤字段名 */
328
+ filterField?: string;
329
+ /**
330
+ * 数据过滤值或过滤函数,与 filterField 配合使用。
331
+ * @example filterValues={(val) => val > 100}
332
+ */
333
+ filterValues?: any[] | ((fieldValue: any) => boolean);
334
+ /**
335
+ * 动画配置,开启图层动画效果。
336
+ * @example animate={{ enable: true, speed: 1, trailLength: 0.5 }}
337
+ */
338
+ animate?: Partial<IAnimateOption>;
339
+ /**
340
+ * 高亮(hover)配置:
341
+ * - true: 使用默认高亮效果
342
+ * - IActiveOption: 自定义高亮颜色 { color: '#00f' }
343
+ */
344
+ active?: IActiveOption | boolean;
345
+ /**
346
+ * 选中(click)配置:
347
+ * - true: 使用默认选中效果
348
+ * - IActiveOption: 自定义选中颜色 { color: '#f00' }
349
+ */
350
+ select?: IActiveOption | boolean;
351
+ /**
352
+ * 图层加载完成回调。
353
+ * @param layer - L7 ILayer 实例
354
+ * @param scene - L7 Scene 实例
355
+ */
356
+ onLoaded?: (layer: ILayer, scene: Scene) => void;
357
+ /** 点击图层要素时触发 */
358
+ onClick?: (e: any) => void;
359
+ /** 双击图层要素时触发 */
360
+ onDblClick?: (e: any) => void;
361
+ /** 鼠标移入图层要素时触发 */
362
+ onMouseEnter?: (e: any) => void;
363
+ /** 鼠标移出图层要素时触发 */
364
+ onMouseLeave?: (e: any) => void;
365
+ /** 鼠标在图层要素上移动时触发 */
366
+ onMouseMove?: (e: any) => void;
367
+ /** 点击图层空白区域时触发 */
368
+ onUnClick?: (e: any) => void;
369
+ /** 上下文菜单(右键)事件 */
370
+ onContextMenu?: (e: any) => void;
371
+ children?: default_2.ReactNode;
372
+ }
373
+
374
+ export declare interface ILoadImageProps {
375
+ /** 图片名称,用于在图层中引用(如 shape 字段的值) */
376
+ name: string;
377
+ /**
378
+ * 图片地址,支持:
379
+ * - URL 字符串(网络图片)
380
+ * - base64 字符串
381
+ * - HTMLImageElement
382
+ */
383
+ url: string | HTMLImageElement;
384
+ }
385
+
386
+ export declare interface ILoadImagesProps {
387
+ /**
388
+ * 批量加载图片列表
389
+ */
390
+ images: ILoadImageProps[];
391
+ }
392
+
393
+ /**
394
+ * 图片图层,将一张图片叠加到地图指定范围。
395
+ *
396
+ * @example
397
+ * ```tsx
398
+ * <ImageLayer
399
+ * source={{ data: 'https://example.com/image.png', bounds: [73, 3, 135, 53] }}
400
+ * />
401
+ * ```
402
+ */
403
+ export declare const ImageLayer: default_2.NamedExoticComponent<ILayerProps>;
404
+
405
+ export declare interface IMarkerLayerProps {
406
+ /**
407
+ * Marker 数据列表,每条数据需包含经纬度字段
408
+ */
409
+ data: Array<{
410
+ longitude: number;
411
+ latitude: number;
412
+ [key: string]: any;
413
+ }>;
414
+ /**
415
+ * 是否开启聚合,默认 false
416
+ */
417
+ cluster?: boolean;
418
+ /**
419
+ * 聚合配置
420
+ */
421
+ clusterOption?: IMarkerLayerOption['clusterOption'];
422
+ /**
423
+ * 自定义 Marker 渲染函数,返回 HTMLElement
424
+ * @param item - 单条数据
425
+ */
426
+ renderMarker?: (item: any) => HTMLElement;
427
+ /**
428
+ * MarkerLayer 加载完成回调
429
+ */
430
+ onLoaded?: (markerLayer: MarkerLayer_2) => void;
431
+ }
432
+
433
+ export declare interface IMarkerProps {
434
+ /** 经度 */
435
+ longitude: number;
436
+ /** 纬度 */
437
+ latitude: number;
438
+ /** Marker 配置项(color/draggable/anchor/offsets 等) */
439
+ option?: Partial<IMarkerOption>;
440
+ /**
441
+ * Marker 加载完成回调
442
+ * @param marker - L7 Marker 实例
443
+ */
444
+ onLoaded?: (marker: Marker_2) => void;
445
+ /** 点击 Marker 时触发 */
446
+ onClick?: (e: MouseEvent) => void;
447
+ /** 鼠标移入 Marker 时触发 */
448
+ onMouseEnter?: (e: MouseEvent) => void;
449
+ /** 鼠标移出 Marker 时触发 */
450
+ onMouseLeave?: (e: MouseEvent) => void;
451
+ /** 自定义 Marker 内容,支持任意 React 元素 */
452
+ children?: default_2.ReactNode;
453
+ }
454
+
455
+ export declare interface IPopupProps {
456
+ /** 经度 */
457
+ longitude: number;
458
+ /** 纬度 */
459
+ latitude: number;
460
+ /** Popup 配置项 */
461
+ option?: Partial<IPopupOption>;
462
+ /** 是否显示关闭按钮,默认 false */
463
+ closeButton?: boolean;
464
+ /** Popup 关闭时的回调 */
465
+ onClose?: () => void;
466
+ /** Popup 内容,支持任意 React 元素 */
467
+ children?: default_2.ReactNode;
468
+ }
469
+
470
+ /**
471
+ * GaodeMapScene / MapScene 组件的通用 Props
472
+ */
473
+ export declare interface ISceneProps {
474
+ /** 地图容器 CSS 样式 */
475
+ style?: default_2.CSSProperties;
476
+ /** 地图容器 className */
477
+ className?: string;
478
+ /**
479
+ * 地图初始化配置,支持 zoom/center/pitch/rotation/style 等。
480
+ * 变更后会自动同步到地图实例。
481
+ * @see https://larkmap.antv.antgroup.com/docs/api/scene
482
+ */
483
+ mapConfig?: Partial<IMapConfig>;
484
+ /** Scene 全局配置(renderer 等) */
485
+ sceneConfig?: Partial<ISceneConfig>;
486
+ /**
487
+ * Scene 加载完成回调,可在此时添加图层或执行地图操作。
488
+ * @param scene - L7 Scene 实例
489
+ */
490
+ onLoaded?: (scene: Scene) => void;
491
+ /** 点击地图空白区域时触发 */
492
+ onClick?: (e: any) => void;
493
+ /** 鼠标在地图上移动时触发 */
494
+ onMouseMove?: (e: any) => void;
495
+ /** 地图缩放层级变化时触发 */
496
+ onZoomChange?: (e: any) => void;
497
+ children?: default_2.ReactNode;
498
+ }
499
+
500
+ /**
501
+ * L7 Layer 上下文,由各图层组件(PointLayer/LineLayer 等)内部自动提供。
502
+ * 通常不需要直接使用此 Context,推荐使用 {@link useLayer} hook。
503
+ */
504
+ export declare const LayerContext: Context<ILayer | undefined>;
505
+
506
+ /**
507
+ * 分类图例组件
508
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
509
+ */
510
+ export declare const LegendCategories: default_2.FC<LegendCategoriesProps>;
511
+
512
+ /**
513
+ * 分类图例属性
514
+ */
515
+ export declare interface LegendCategoriesProps {
516
+ /** 标签列表 */
517
+ labels: string[];
518
+ /** 颜色列表或渐变色配置 */
519
+ colors: string[] | {
520
+ startColor: string;
521
+ endColor: string;
522
+ };
523
+ /** 几何图形类型 */
524
+ geometryType?: 'circle' | 'square' | 'rectangle';
525
+ /** 是否使用描边颜色 */
526
+ isStrokeColor?: boolean;
527
+ /** 自定义类名 */
528
+ className?: string;
529
+ /** 自定义样式 */
530
+ style?: default_2.CSSProperties;
531
+ }
532
+
533
+ /**
534
+ * 图标图例组件
535
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
536
+ */
537
+ export declare const LegendIcon: default_2.FC<LegendIconProps>;
538
+
539
+ /**
540
+ * 图标图例项
541
+ */
542
+ export declare interface LegendIconItem {
543
+ /** 图标 URL 或 SVG */
544
+ icon: string;
545
+ /** 标签文本 */
546
+ label: string;
547
+ }
548
+
549
+ /**
550
+ * 图标图例属性
551
+ */
552
+ export declare interface LegendIconProps {
553
+ /** 图标列表 */
554
+ items: LegendIconItem[];
555
+ /** 自定义类名 */
556
+ className?: string;
557
+ /** 自定义样式 */
558
+ style?: default_2.CSSProperties;
559
+ }
560
+
561
+ /**
562
+ * 比例图例组件
563
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
564
+ */
565
+ export declare const LegendProportion: default_2.FC<LegendProportionProps>;
566
+
567
+ /**
568
+ * 比例图例属性
569
+ */
570
+ export declare interface LegendProportionProps {
571
+ /** 标签列表 [最小值, 最大值] */
572
+ labels: [number, number];
573
+ /** 填充颜色 */
574
+ fillColor?: string;
575
+ /** 自定义类名 */
576
+ className?: string;
577
+ /** 自定义样式 */
578
+ style?: default_2.CSSProperties;
579
+ }
580
+
581
+ /**
582
+ * 渐变图例组件
583
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
584
+ */
585
+ export declare const LegendRamp: default_2.FC<LegendRampProps>;
586
+
587
+ /**
588
+ * 渐变图例属性
589
+ */
590
+ export declare interface LegendRampProps {
591
+ /** 标签列表 */
592
+ labels: (string | number)[];
593
+ /** 颜色列表 */
594
+ colors: string[];
595
+ /** 是否连续 */
596
+ isContinuous?: boolean;
597
+ /** 标签单位 */
598
+ labelUnit?: string;
599
+ /** 自定义类名 */
600
+ className?: string;
601
+ /** 自定义样式 */
602
+ style?: default_2.CSSProperties;
603
+ }
604
+
605
+ /**
606
+ * 线图层,适合渲染路径、边界、轨迹等线数据。
607
+ * shape 支持:'line' | 'arc' | 'arc3d' | 'greatcircle'
608
+ *
609
+ * @example
610
+ * ```tsx
611
+ * <LineLayer
612
+ * source={geojson}
613
+ * color="#1890ff"
614
+ * size={2}
615
+ * style={{ opacity: 0.8 }}
616
+ * />
617
+ * ```
618
+ */
619
+ export declare const LineLayer: default_2.NamedExoticComponent<ILayerProps>;
620
+
621
+ /**
622
+ * 加载单张图片到地图场景,使其可在图层中通过名称引用。
623
+ * 必须在 GaodeMapScene 或 MapScene 内部使用。
624
+ *
625
+ * @example
626
+ * ```tsx
627
+ * <GaodeMapScene ...>
628
+ * <LoadImage name="car" url="/icons/car.png" />
629
+ * <PointLayer
630
+ * source={data}
631
+ * shape="car"
632
+ * />
633
+ * </GaodeMapScene>
634
+ * ```
635
+ */
636
+ export declare function LoadImage(props: ILoadImageProps): null;
637
+
638
+ /**
639
+ * 批量加载多张图片到地图场景。
640
+ * 必须在 GaodeMapScene 或 MapScene 内部使用。
641
+ *
642
+ * @example
643
+ * ```tsx
644
+ * <LoadImages
645
+ * images={[
646
+ * { name: 'car', url: '/icons/car.png' },
647
+ * { name: 'bus', url: '/icons/bus.png' },
648
+ * ]}
649
+ * />
650
+ * ```
651
+ */
652
+ export declare function LoadImages(props: ILoadImagesProps): JSX_2.Element;
653
+
654
+ /**
655
+ * 内置地图 Scene 组件,使用 L7 内置地图,无需第三方地图服务。
656
+ * 适合离线、内网或不需要真实底图的场景。
657
+ *
658
+ * @example
659
+ * ```tsx
660
+ * <MapScene
661
+ * style={{ width: '100%', height: '400px' }}
662
+ * mapConfig={{ zoom: 3, center: [105, 35] }}
663
+ * onLoaded={(scene) => console.log('loaded', scene)}
664
+ * >
665
+ * <PolygonLayer source={geoData} color="#1890ff" opacity={0.6} />
666
+ * </MapScene>
667
+ * ```
668
+ */
669
+ export declare function MapScene(props: ISceneProps): JSX_2.Element;
670
+
671
+ /**
672
+ * 地图主题控件组件
673
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
674
+ */
675
+ export declare const MapThemeControl: default_2.FC<MapThemeControlProps>;
676
+
677
+ /**
678
+ * 地图主题控件属性
679
+ */
680
+ export declare interface MapThemeControlProps {
681
+ /** 控件位置 */
682
+ position?: ControlPosition;
683
+ /** 主题选项列表 */
684
+ options?: MapThemeOption[];
685
+ /** 按钮文本 */
686
+ btnText?: string;
687
+ /** 按钮标题 */
688
+ title?: string;
689
+ /** 是否垂直布局 */
690
+ vertical?: boolean;
691
+ /** Popper 放置位置 */
692
+ popperPlacement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
693
+ /** Popper 触发方式 */
694
+ popperTrigger?: 'click' | 'hover';
695
+ /** Popper 类名 */
696
+ popperClassName?: string;
697
+ /** 自定义类名 */
698
+ className?: string;
699
+ /** 自定义样式 */
700
+ style?: default_2.CSSProperties;
701
+ /** 控件添加回调 */
702
+ onAdd?: () => void;
703
+ /** 控件移除回调 */
704
+ onRemove?: () => void;
705
+ /** 控件显示回调 */
706
+ onShow?: () => void;
707
+ /** 控件隐藏回调 */
708
+ onHide?: () => void;
709
+ /** Popper 显示回调 */
710
+ onPopperShow?: () => void;
711
+ /** Popper 隐藏回调 */
712
+ onPopperHide?: () => void;
713
+ /** 选择变化回调 */
714
+ onSelectChange?: (value: string) => void;
715
+ }
716
+
717
+ /**
718
+ * 地图主题选项
719
+ */
720
+ declare interface MapThemeOption {
721
+ /** 主题值 */
722
+ value: string;
723
+ /** 显示文本 */
724
+ text: string;
725
+ [key: string]: any;
726
+ }
727
+
728
+ /**
729
+ * 地图标记点组件,支持自定义 React 内容作为 Marker 图标。
730
+ * 必须在 GaodeMapScene 或 MapScene 内部使用。
731
+ *
732
+ * @example
733
+ * ```tsx
734
+ * // 默认样式 Marker
735
+ * <Marker longitude={120.19} latitude={30.26} />
736
+ *
737
+ * // 自定义内容 Marker
738
+ * <Marker longitude={120.19} latitude={30.26} onClick={(e) => console.log(e)}>
739
+ * <div style={{ background: 'red', borderRadius: '50%', width: 24, height: 24 }} />
740
+ * </Marker>
741
+ * ```
742
+ */
743
+ export declare function Marker(props: IMarkerProps): default_2.ReactPortal | null;
744
+
745
+ /**
746
+ * 批量 Marker 图层组件,支持聚合功能。
747
+ * 适合渲染大量标记点,性能优于多个独立 Marker 组件。
748
+ * 必须在 GaodeMapScene 或 MapScene 内部使用。
749
+ *
750
+ * @example
751
+ * ```tsx
752
+ * // 基础用法
753
+ * <MarkerLayer
754
+ * data={points}
755
+ * renderMarker={(item) => {
756
+ * const el = document.createElement('div');
757
+ * el.className = 'my-marker';
758
+ * el.textContent = item.name;
759
+ * return el;
760
+ * }}
761
+ * />
762
+ *
763
+ * // 开启聚合
764
+ * <MarkerLayer
765
+ * data={points}
766
+ * cluster
767
+ * clusterOption={{ radius: 80, maxZoom: 16 }}
768
+ * />
769
+ * ```
770
+ */
771
+ export declare function MarkerLayer(props: IMarkerLayerProps): null;
772
+
773
+ /**
774
+ * 鼠标位置控件组件
775
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
776
+ */
777
+ export declare const MouseLocationControl: default_2.FC<MouseLocationControlProps>;
778
+
779
+ /**
780
+ * 鼠标位置控件属性
781
+ */
782
+ export declare interface MouseLocationControlProps {
783
+ /** 控件位置 */
784
+ position?: ControlPosition;
785
+ /** 自定义类名 */
786
+ className?: string;
787
+ /** 自定义样式 */
788
+ style?: default_2.CSSProperties;
789
+ /** 坐标转换函数 */
790
+ transform?: (position: any) => any;
791
+ /** 控件添加回调 */
792
+ onAdd?: () => void;
793
+ /** 控件移除回调 */
794
+ onRemove?: () => void;
795
+ /** 控件显示回调 */
796
+ onShow?: () => void;
797
+ /** 控件隐藏回调 */
798
+ onHide?: () => void;
799
+ /** 位置变化回调 */
800
+ onLocationChange?: (lnglat: [number, number]) => void;
801
+ }
802
+
803
+ /**
804
+ * 点图层,适合渲染散点、气泡、热力等点数据。
805
+ *
806
+ * @example
807
+ * ```tsx
808
+ * <PointLayer
809
+ * source={data}
810
+ * sourceConfig={{ parser: { type: 'json', x: 'lng', y: 'lat' } }}
811
+ * colorField="value"
812
+ * colorValues={['#f0f9e8', '#08589e']}
813
+ * size={6}
814
+ * shape="circle"
815
+ * onClick={(e) => console.log(e)}
816
+ * />
817
+ * ```
818
+ */
819
+ export declare const PointLayer: default_2.NamedExoticComponent<ILayerProps>;
820
+
821
+ /**
822
+ * 面图层,适合渲染行政区划、围栏、区域填充等面数据。
823
+ *
824
+ * @example
825
+ * ```tsx
826
+ * <PolygonLayer
827
+ * source={geoData}
828
+ * colorField="value"
829
+ * colorValues={['#edf8e9', '#006d2c']}
830
+ * style={{ opacity: 0.6 }}
831
+ * active
832
+ * />
833
+ * ```
834
+ */
835
+ export declare const PolygonLayer: default_2.NamedExoticComponent<ILayerProps>;
836
+
837
+ /**
838
+ * 地图弹窗组件,支持自定义 React 内容。
839
+ * 必须在 GaodeMapScene 或 MapScene 内部使用。
840
+ *
841
+ * @example
842
+ * ```tsx
843
+ * <Popup
844
+ * longitude={120.19}
845
+ * latitude={30.26}
846
+ * closeButton
847
+ * onClose={() => setVisible(false)}
848
+ * >
849
+ * <div>
850
+ * <h4>上海</h4>
851
+ * <p>人口:2400万</p>
852
+ * </div>
853
+ * </Popup>
854
+ * ```
855
+ */
856
+ export declare function Popup(props: IPopupProps): default_2.ReactPortal | null;
857
+
858
+ /**
859
+ * 栅格图层,适合渲染影像、遥感等栅格数据。
860
+ */
861
+ export declare const RasterLayer: default_2.NamedExoticComponent<ILayerProps>;
862
+
863
+ /**
864
+ * 比例尺控件组件
865
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
866
+ */
867
+ export declare const ScaleControl: default_2.FC<ScaleControlProps>;
868
+
869
+ /**
870
+ * 比例尺控件属性
871
+ */
872
+ export declare interface ScaleControlProps {
873
+ /** 控件位置 */
874
+ position?: ControlPosition;
875
+ /** 自定义类名 */
876
+ className?: string;
877
+ /** 自定义样式 */
878
+ style?: default_2.CSSProperties;
879
+ /** 是否锁定宽度 */
880
+ lockWidth?: boolean;
881
+ /** 最大宽度 */
882
+ maxWidth?: number;
883
+ /** 是否显示公制单位 */
884
+ metric?: boolean;
885
+ /** 是否显示英制单位 */
886
+ imperial?: boolean;
887
+ /** 是否在地图静止时更新 */
888
+ updateWhenIdle?: boolean;
889
+ /** 控件添加回调 */
890
+ onAdd?: () => void;
891
+ /** 控件移除回调 */
892
+ onRemove?: () => void;
893
+ /** 控件显示回调 */
894
+ onShow?: () => void;
895
+ /** 控件隐藏回调 */
896
+ onHide?: () => void;
897
+ }
898
+
899
+ /**
900
+ * L7 Scene 上下文,由 GaodeMapScene / MapScene 组件内部自动提供。
901
+ * 通常不需要直接使用此 Context,推荐使用 {@link useScene} hook。
902
+ *
903
+ * @example
904
+ * ```tsx
905
+ * // 在 GaodeMapScene 内部的子组件中获取 Scene 实例
906
+ * const scene = useScene();
907
+ * scene.addLayer(myLayer);
908
+ * ```
909
+ */
910
+ export declare const SceneContext: Context<Scene | undefined>;
911
+
912
+ /**
913
+ * 获取当前图层的 ILayer 实例。
914
+ * 必须在图层组件(PointLayer/LineLayer 等)的 children 内部使用。
915
+ *
916
+ * @returns L7 ILayer 实例
917
+ *
918
+ * @example
919
+ * ```tsx
920
+ * function MyLayerChild() {
921
+ * const layer = useLayer();
922
+ * useEffect(() => {
923
+ * layer.setBlend('normal');
924
+ * }, [layer]);
925
+ * return null;
926
+ * }
927
+ *
928
+ * // 使用方式
929
+ * <PointLayer source={data} color="red">
930
+ * <MyLayerChild />
931
+ * </PointLayer>
932
+ * ```
933
+ */
934
+ export declare function useLayer(): ILayer;
935
+
936
+ /**
937
+ * 获取当前地图场景的 Scene 实例。
938
+ * 必须在 `<GaodeMapScene>` 或 `<MapScene>` 组件内部使用。
939
+ *
940
+ * @returns L7 Scene 实例
941
+ * @throws 如果在 Scene 组件外部使用,将返回 undefined
942
+ *
943
+ * @example
944
+ * ```tsx
945
+ * function MyLayer() {
946
+ * const scene = useScene();
947
+ * useEffect(() => {
948
+ * console.log('Scene loaded:', scene);
949
+ * }, [scene]);
950
+ * return null;
951
+ * }
952
+ * ```
953
+ */
954
+ export declare function useScene(): Scene;
955
+
956
+ /**
957
+ * 缩放控件组件
958
+ * 支持 PC 和移动端响应式布局,使用 Tailwind CSS 样式
959
+ */
960
+ export declare const ZoomControl: default_2.FC<ZoomControlProps>;
961
+
962
+ /**
963
+ * 缩放控件属性
964
+ */
965
+ export declare interface ZoomControlProps {
966
+ /** 控件位置 */
967
+ position?: ControlPosition;
968
+ /** 缩放按钮文本 */
969
+ zoomInText?: default_2.ReactNode;
970
+ zoomOutText?: default_2.ReactNode;
971
+ /** 缩放按钮标题 */
972
+ zoomInTitle?: string;
973
+ zoomOutTitle?: string;
974
+ /** 是否显示缩放级别 */
975
+ showZoom?: boolean;
976
+ /** 自定义类名 */
977
+ className?: string;
978
+ /** 自定义样式 */
979
+ style?: default_2.CSSProperties;
980
+ /** 控件添加回调 */
981
+ onAdd?: () => void;
982
+ /** 控件移除回调 */
983
+ onRemove?: () => void;
984
+ /** 控件显示回调 */
985
+ onShow?: () => void;
986
+ /** 控件隐藏回调 */
987
+ onHide?: () => void;
988
+ }
989
+
990
+ export { }