@antv/aimapui 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.
- package/dist/aimapui.css +1 -0
- package/dist/deflate-CKwHDg50.js +11 -0
- package/dist/deflate-Cq-pPdUv.cjs +1 -0
- package/dist/geotiff-DgvKp-KZ.cjs +8 -0
- package/dist/geotiff-PfJx4HFE.js +3921 -0
- package/dist/index.cjs.js +30 -0
- package/dist/index.d.ts +3117 -0
- package/dist/index.es.js +7408 -0
- package/dist/jpeg-Cl2NW-cY.cjs +1 -0
- package/dist/jpeg-MQp7oMmw.js +614 -0
- package/dist/lerc-AFFztCrB.cjs +1 -0
- package/dist/lerc-Dvdjzjn6.js +1040 -0
- package/dist/lzw-C8QOYcsP.js +87 -0
- package/dist/lzw-D_DqLmmY.cjs +1 -0
- package/dist/packbits-8Fw6ZvFU.cjs +1 -0
- package/dist/packbits-CD5k4UmY.js +25 -0
- package/dist/pako.esm-Bx5X36Wo.js +1074 -0
- package/dist/pako.esm-DZC2QrbJ.cjs +1 -0
- package/dist/raw-BDe9dy08.cjs +1 -0
- package/dist/raw-Dy8BlXYp.js +10 -0
- package/dist/webimage-5Mm5RWK-.js +36 -0
- package/dist/webimage-DwMB2kar.cjs +1 -0
- package/dist/zstd-4hT92z0t.js +66 -0
- package/dist/zstd-CS7WJjVM.cjs +1 -0
- package/package.json +75 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3117 @@
|
|
|
1
|
+
import { BaiduMap } from '@antv/l7-maps';
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
import { default as default_2 } from 'react';
|
|
4
|
+
import { default as default_3 } from '@antv/l7-maps/es/amap-next';
|
|
5
|
+
import { GoogleMap } from '@antv/l7-maps';
|
|
6
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
7
|
+
import { Map as Map_2 } from '@antv/l7-maps';
|
|
8
|
+
import { Mapbox } from '@antv/l7-maps';
|
|
9
|
+
import { MapLibre } from '@antv/l7-maps';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
11
|
+
import { Scene } from '@antv/l7';
|
|
12
|
+
import { TencentMap } from '@antv/l7-maps';
|
|
13
|
+
import { TMap } from '@antv/l7-maps';
|
|
14
|
+
|
|
15
|
+
export declare type ActiveConfig = boolean | {
|
|
16
|
+
color: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Heatmap 图层适配器
|
|
21
|
+
*/
|
|
22
|
+
export declare function adaptHeatmapLayer(schema: LayerSchema): {
|
|
23
|
+
type: "HeatmapLayer";
|
|
24
|
+
sourceConfig: {
|
|
25
|
+
data: unknown;
|
|
26
|
+
options: {
|
|
27
|
+
transforms?: Record<string, unknown>[] | undefined;
|
|
28
|
+
parser: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
data: unknown;
|
|
32
|
+
options: {
|
|
33
|
+
transforms: Record<string, unknown>[];
|
|
34
|
+
} | undefined;
|
|
35
|
+
};
|
|
36
|
+
visual: {
|
|
37
|
+
color: ColorConfig | undefined;
|
|
38
|
+
size: {
|
|
39
|
+
field: string;
|
|
40
|
+
values: number[] | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
shape: ShapeConfig | undefined;
|
|
43
|
+
style: {
|
|
44
|
+
[x: string]: unknown;
|
|
45
|
+
} | undefined;
|
|
46
|
+
};
|
|
47
|
+
schema: LayerSchema;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Image 图层适配器
|
|
52
|
+
*/
|
|
53
|
+
export declare function adaptImageLayer(schema: LayerSchema): {
|
|
54
|
+
type: "ImageLayer";
|
|
55
|
+
sourceConfig: {
|
|
56
|
+
data: unknown;
|
|
57
|
+
options: {
|
|
58
|
+
parser: Record<string, unknown> | undefined;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
visual: {
|
|
62
|
+
color: undefined;
|
|
63
|
+
size: undefined;
|
|
64
|
+
shape: undefined;
|
|
65
|
+
style: {
|
|
66
|
+
[x: string]: unknown;
|
|
67
|
+
} | undefined;
|
|
68
|
+
};
|
|
69
|
+
schema: LayerSchema;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Line 图层适配器
|
|
74
|
+
*/
|
|
75
|
+
export declare function adaptLineLayer(schema: LayerSchema): {
|
|
76
|
+
type: "LineLayer";
|
|
77
|
+
sourceConfig: SourceOutput;
|
|
78
|
+
visual: VisualConfig;
|
|
79
|
+
schema: LayerSchema;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Point 图层适配器
|
|
84
|
+
* 将 LayerSchema 转换为 L7 PointLayer 配置
|
|
85
|
+
*/
|
|
86
|
+
export declare function adaptPointLayer(schema: LayerSchema): {
|
|
87
|
+
type: "PointLayer";
|
|
88
|
+
sourceConfig: SourceOutput;
|
|
89
|
+
visual: VisualConfig;
|
|
90
|
+
schema: LayerSchema;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Polygon 图层适配器
|
|
95
|
+
*/
|
|
96
|
+
export declare function adaptPolygonLayer(schema: LayerSchema): {
|
|
97
|
+
type: "PolygonLayer";
|
|
98
|
+
sourceConfig: SourceOutput;
|
|
99
|
+
visual: VisualConfig;
|
|
100
|
+
schema: LayerSchema;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Raster 图层适配器
|
|
105
|
+
*/
|
|
106
|
+
export declare function adaptRasterLayer(schema: LayerSchema): {
|
|
107
|
+
type: "RasterLayer";
|
|
108
|
+
sourceConfig: {
|
|
109
|
+
data: unknown;
|
|
110
|
+
options: {
|
|
111
|
+
parser: Record<string, unknown>;
|
|
112
|
+
};
|
|
113
|
+
} | {
|
|
114
|
+
data: unknown;
|
|
115
|
+
options: {
|
|
116
|
+
parser: {
|
|
117
|
+
type: string;
|
|
118
|
+
extent: number[];
|
|
119
|
+
tileSize?: undefined;
|
|
120
|
+
zoomOffset?: undefined;
|
|
121
|
+
};
|
|
122
|
+
} | {
|
|
123
|
+
parser: {
|
|
124
|
+
type: string;
|
|
125
|
+
tileSize: number;
|
|
126
|
+
zoomOffset: number;
|
|
127
|
+
extent?: undefined;
|
|
128
|
+
};
|
|
129
|
+
} | undefined;
|
|
130
|
+
};
|
|
131
|
+
visual: {
|
|
132
|
+
color: undefined;
|
|
133
|
+
size: undefined;
|
|
134
|
+
shape: undefined;
|
|
135
|
+
style: {
|
|
136
|
+
[x: string]: unknown;
|
|
137
|
+
} | undefined;
|
|
138
|
+
};
|
|
139
|
+
schema: LayerSchema;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** 色阶预设(低值到高值,确保低值区域也有足够辨识度) */
|
|
143
|
+
export declare const ADMIN_SEQUENTIAL_COLORS: readonly ["#eff6ff", "#bfdbfe", "#60a5fa", "#2563eb", "#1d4ed8", "#1e3a8a"];
|
|
144
|
+
|
|
145
|
+
/** 行政层级 */
|
|
146
|
+
export declare type AdministrativeLevel = 'province' | 'city' | 'district';
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* AiMap 主入口组件
|
|
150
|
+
*
|
|
151
|
+
* 支持两种使用模式:
|
|
152
|
+
*
|
|
153
|
+
* 1. 组件化模式(推荐 — 开发者友好,自由组合)
|
|
154
|
+
* ```tsx
|
|
155
|
+
* <AiMap map={{ basemap: 'gaode', center: [116, 39], zoom: 10 }}>
|
|
156
|
+
* <PointLayer source={data} color="#5B8FF9" size={12} onClick={handleClick} />
|
|
157
|
+
* <LineLayer source={flowData} color="#F6BD16" />
|
|
158
|
+
* <ZoomControl position="topright" />
|
|
159
|
+
* <Marker longitude={116.4} latitude={39.9} content="北京" />
|
|
160
|
+
* </AiMap>
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* 2. Schema 模式(AI 生成、JSON 配置)
|
|
164
|
+
* ```tsx
|
|
165
|
+
* <AiMap schema={fullSchema} />
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
export declare function AiMap({ map, schema, theme, onSceneReady, onLayerClick, onLayerMouseMove, onLayerMouseEnter, onLayerMouseLeave, onMapMove, onMapZoom, autoFit, events, children, className, style, }: AiMapProps): JSX_2.Element;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* JSON Schema 导出 — 供 AI / LLM 理解 Schema 结构
|
|
172
|
+
* 可用于验证、自动补全、文档生成等场景
|
|
173
|
+
*/
|
|
174
|
+
export declare const AiMapJSONSchema: {
|
|
175
|
+
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
176
|
+
readonly title: "AiMapSchema";
|
|
177
|
+
readonly description: "Schema-driven React map visualization component configuration";
|
|
178
|
+
readonly type: "object";
|
|
179
|
+
readonly required: readonly ["map", "layers"];
|
|
180
|
+
readonly properties: {
|
|
181
|
+
readonly map: {
|
|
182
|
+
readonly type: "object";
|
|
183
|
+
readonly required: readonly ["basemap"];
|
|
184
|
+
readonly properties: {
|
|
185
|
+
readonly basemap: {
|
|
186
|
+
readonly type: "string";
|
|
187
|
+
readonly enum: readonly ["gaode", "mapbox", "maplibre", "tianditu", "tencent", "baidu", "google", "map"];
|
|
188
|
+
readonly description: "Map base tile provider";
|
|
189
|
+
};
|
|
190
|
+
readonly token: {
|
|
191
|
+
readonly type: "string";
|
|
192
|
+
readonly description: "API token for the map service";
|
|
193
|
+
};
|
|
194
|
+
readonly style: {
|
|
195
|
+
readonly type: "string";
|
|
196
|
+
readonly description: "Map style preset (light/dark/normal/darkblue/satellite) or custom URL";
|
|
197
|
+
};
|
|
198
|
+
readonly center: {
|
|
199
|
+
readonly type: "array";
|
|
200
|
+
readonly items: {
|
|
201
|
+
readonly type: "number";
|
|
202
|
+
};
|
|
203
|
+
readonly minItems: 2;
|
|
204
|
+
readonly maxItems: 2;
|
|
205
|
+
readonly description: "Map center [longitude, latitude], default [105, 35]";
|
|
206
|
+
};
|
|
207
|
+
readonly zoom: {
|
|
208
|
+
readonly type: "number";
|
|
209
|
+
readonly description: "Map zoom level, default 4";
|
|
210
|
+
};
|
|
211
|
+
readonly pitch: {
|
|
212
|
+
readonly type: "number";
|
|
213
|
+
readonly description: "Map pitch in degrees, default 0";
|
|
214
|
+
};
|
|
215
|
+
readonly rotation: {
|
|
216
|
+
readonly type: "number";
|
|
217
|
+
readonly description: "Map rotation in degrees, default 0";
|
|
218
|
+
};
|
|
219
|
+
readonly minZoom: {
|
|
220
|
+
readonly type: "number";
|
|
221
|
+
readonly description: "Minimum zoom level";
|
|
222
|
+
};
|
|
223
|
+
readonly maxZoom: {
|
|
224
|
+
readonly type: "number";
|
|
225
|
+
readonly description: "Maximum zoom level";
|
|
226
|
+
};
|
|
227
|
+
readonly bounds: {
|
|
228
|
+
readonly type: "array";
|
|
229
|
+
readonly items: {
|
|
230
|
+
readonly type: "array";
|
|
231
|
+
readonly items: {
|
|
232
|
+
readonly type: "number";
|
|
233
|
+
};
|
|
234
|
+
readonly minItems: 2;
|
|
235
|
+
readonly maxItems: 2;
|
|
236
|
+
};
|
|
237
|
+
readonly minItems: 2;
|
|
238
|
+
readonly maxItems: 2;
|
|
239
|
+
readonly description: "Initial bounds [[swLng, swLat], [neLng, neLat]]";
|
|
240
|
+
};
|
|
241
|
+
readonly gestureConfig: {
|
|
242
|
+
readonly type: "object";
|
|
243
|
+
readonly properties: {
|
|
244
|
+
readonly dragPan: {
|
|
245
|
+
readonly type: "boolean";
|
|
246
|
+
};
|
|
247
|
+
readonly pinchZoom: {
|
|
248
|
+
readonly type: "boolean";
|
|
249
|
+
};
|
|
250
|
+
readonly dragRotate: {
|
|
251
|
+
readonly type: "boolean";
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly layers: {
|
|
258
|
+
readonly type: "array";
|
|
259
|
+
readonly description: "Array of map layers";
|
|
260
|
+
readonly items: {
|
|
261
|
+
readonly type: "object";
|
|
262
|
+
readonly required: readonly ["type", "source"];
|
|
263
|
+
readonly properties: {
|
|
264
|
+
readonly id: {
|
|
265
|
+
readonly type: "string";
|
|
266
|
+
readonly description: "Unique layer ID (auto-generated if omitted)";
|
|
267
|
+
};
|
|
268
|
+
readonly type: {
|
|
269
|
+
readonly type: "string";
|
|
270
|
+
readonly enum: readonly ["point", "line", "polygon", "heatmap", "raster", "image"];
|
|
271
|
+
readonly description: "Layer visualization type";
|
|
272
|
+
};
|
|
273
|
+
readonly name: {
|
|
274
|
+
readonly type: "string";
|
|
275
|
+
readonly description: "Human-readable layer name";
|
|
276
|
+
};
|
|
277
|
+
readonly visible: {
|
|
278
|
+
readonly type: "boolean";
|
|
279
|
+
readonly default: true;
|
|
280
|
+
};
|
|
281
|
+
readonly zIndex: {
|
|
282
|
+
readonly type: "number";
|
|
283
|
+
readonly default: 0;
|
|
284
|
+
};
|
|
285
|
+
readonly minZoom: {
|
|
286
|
+
readonly type: "number";
|
|
287
|
+
};
|
|
288
|
+
readonly maxZoom: {
|
|
289
|
+
readonly type: "number";
|
|
290
|
+
};
|
|
291
|
+
readonly autoFit: {
|
|
292
|
+
readonly type: "boolean";
|
|
293
|
+
readonly default: false;
|
|
294
|
+
};
|
|
295
|
+
readonly source: {
|
|
296
|
+
readonly description: "GeoJSON, JSON array, or URL string";
|
|
297
|
+
};
|
|
298
|
+
readonly sourceType: {
|
|
299
|
+
readonly type: "string";
|
|
300
|
+
readonly enum: readonly ["geojson", "json", "csv"];
|
|
301
|
+
};
|
|
302
|
+
readonly sourceConfig: {
|
|
303
|
+
readonly type: "object";
|
|
304
|
+
readonly properties: {
|
|
305
|
+
readonly x: {
|
|
306
|
+
readonly type: "string";
|
|
307
|
+
readonly description: "Longitude field name";
|
|
308
|
+
};
|
|
309
|
+
readonly y: {
|
|
310
|
+
readonly type: "string";
|
|
311
|
+
readonly description: "Latitude field name";
|
|
312
|
+
};
|
|
313
|
+
readonly x1: {
|
|
314
|
+
readonly type: "string";
|
|
315
|
+
readonly description: "End longitude field (for arc lines)";
|
|
316
|
+
};
|
|
317
|
+
readonly y1: {
|
|
318
|
+
readonly type: "string";
|
|
319
|
+
readonly description: "End latitude field (for arc lines)";
|
|
320
|
+
};
|
|
321
|
+
readonly coordinates: {
|
|
322
|
+
readonly type: "string";
|
|
323
|
+
readonly description: "Coordinates field";
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
readonly color: {
|
|
328
|
+
readonly type: "string";
|
|
329
|
+
readonly description: "Fixed color";
|
|
330
|
+
};
|
|
331
|
+
readonly colorField: {
|
|
332
|
+
readonly type: "string";
|
|
333
|
+
readonly description: "Field to map color to";
|
|
334
|
+
};
|
|
335
|
+
readonly colorValues: {
|
|
336
|
+
readonly oneOf: readonly [{
|
|
337
|
+
readonly type: "string";
|
|
338
|
+
readonly description: "Color palette name";
|
|
339
|
+
}, {
|
|
340
|
+
readonly type: "array";
|
|
341
|
+
readonly items: {
|
|
342
|
+
readonly type: "string";
|
|
343
|
+
};
|
|
344
|
+
readonly description: "Array of color values";
|
|
345
|
+
}];
|
|
346
|
+
};
|
|
347
|
+
readonly size: {
|
|
348
|
+
readonly type: "number";
|
|
349
|
+
readonly description: "Fixed size";
|
|
350
|
+
};
|
|
351
|
+
readonly sizeField: {
|
|
352
|
+
readonly type: "string";
|
|
353
|
+
readonly description: "Field to map size to";
|
|
354
|
+
};
|
|
355
|
+
readonly sizeValues: {
|
|
356
|
+
readonly type: "array";
|
|
357
|
+
readonly items: {
|
|
358
|
+
readonly type: "number";
|
|
359
|
+
};
|
|
360
|
+
readonly description: "Size range [min, max]";
|
|
361
|
+
};
|
|
362
|
+
readonly shape: {
|
|
363
|
+
readonly type: "string";
|
|
364
|
+
readonly description: "Fixed shape";
|
|
365
|
+
};
|
|
366
|
+
readonly shapeField: {
|
|
367
|
+
readonly type: "string";
|
|
368
|
+
readonly description: "Field to map shape to";
|
|
369
|
+
};
|
|
370
|
+
readonly shapeValues: {
|
|
371
|
+
readonly type: "array";
|
|
372
|
+
readonly items: {
|
|
373
|
+
readonly type: "string";
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
readonly style: {
|
|
377
|
+
readonly type: "object";
|
|
378
|
+
readonly description: "Additional style properties";
|
|
379
|
+
};
|
|
380
|
+
readonly filterField: {
|
|
381
|
+
readonly type: "string";
|
|
382
|
+
};
|
|
383
|
+
readonly filterValues: {
|
|
384
|
+
readonly type: "array";
|
|
385
|
+
};
|
|
386
|
+
readonly animate: {
|
|
387
|
+
readonly type: "object";
|
|
388
|
+
readonly properties: {
|
|
389
|
+
readonly enable: {
|
|
390
|
+
readonly type: "boolean";
|
|
391
|
+
};
|
|
392
|
+
readonly speed: {
|
|
393
|
+
readonly type: "number";
|
|
394
|
+
};
|
|
395
|
+
readonly duration: {
|
|
396
|
+
readonly type: "number";
|
|
397
|
+
};
|
|
398
|
+
readonly trailLength: {
|
|
399
|
+
readonly type: "number";
|
|
400
|
+
};
|
|
401
|
+
readonly repeat: {
|
|
402
|
+
readonly type: "number";
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
readonly active: {
|
|
407
|
+
readonly oneOf: readonly [{
|
|
408
|
+
readonly type: "boolean";
|
|
409
|
+
}, {
|
|
410
|
+
readonly type: "object";
|
|
411
|
+
readonly properties: {
|
|
412
|
+
readonly color: {
|
|
413
|
+
readonly type: "string";
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
}];
|
|
417
|
+
};
|
|
418
|
+
readonly select: {
|
|
419
|
+
readonly oneOf: readonly [{
|
|
420
|
+
readonly type: "boolean";
|
|
421
|
+
}, {
|
|
422
|
+
readonly type: "object";
|
|
423
|
+
readonly properties: {
|
|
424
|
+
readonly color: {
|
|
425
|
+
readonly type: "string";
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
}];
|
|
429
|
+
};
|
|
430
|
+
readonly events: {
|
|
431
|
+
readonly type: "object";
|
|
432
|
+
readonly description: "Layer event configuration";
|
|
433
|
+
readonly properties: {
|
|
434
|
+
readonly click: {
|
|
435
|
+
readonly type: "string";
|
|
436
|
+
readonly description: "Event identifier emitted on click (via EventBus)";
|
|
437
|
+
};
|
|
438
|
+
readonly mousemove: {
|
|
439
|
+
readonly type: "string";
|
|
440
|
+
readonly description: "Event identifier emitted on mousemove";
|
|
441
|
+
};
|
|
442
|
+
readonly mouseenter: {
|
|
443
|
+
readonly type: "string";
|
|
444
|
+
readonly description: "Event identifier emitted on mouseenter";
|
|
445
|
+
};
|
|
446
|
+
readonly mouseleave: {
|
|
447
|
+
readonly type: "string";
|
|
448
|
+
readonly description: "Event identifier emitted on mouseleave";
|
|
449
|
+
};
|
|
450
|
+
readonly enablePopup: {
|
|
451
|
+
readonly type: "boolean";
|
|
452
|
+
readonly description: "Auto-show popup on click";
|
|
453
|
+
};
|
|
454
|
+
readonly popupFields: {
|
|
455
|
+
readonly type: "array";
|
|
456
|
+
readonly items: {
|
|
457
|
+
readonly type: "string";
|
|
458
|
+
};
|
|
459
|
+
readonly description: "Fields to show in popup";
|
|
460
|
+
};
|
|
461
|
+
readonly popupTemplate: {
|
|
462
|
+
readonly type: "string";
|
|
463
|
+
readonly description: "HTML template with {{field}} interpolation";
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
readonly controls: {
|
|
471
|
+
readonly type: "array";
|
|
472
|
+
readonly description: "Map control widgets";
|
|
473
|
+
readonly items: {
|
|
474
|
+
readonly type: "object";
|
|
475
|
+
readonly required: readonly ["type"];
|
|
476
|
+
readonly properties: {
|
|
477
|
+
readonly type: {
|
|
478
|
+
readonly type: "string";
|
|
479
|
+
readonly enum: readonly ["zoom", "scale", "fullscreen", "geoLocate", "mapTheme", "mouseLocation", "exportImage", "layerSwitch"];
|
|
480
|
+
};
|
|
481
|
+
readonly position: {
|
|
482
|
+
readonly type: "string";
|
|
483
|
+
readonly enum: readonly ["topleft", "topright", "bottomleft", "bottomright", "topcenter", "bottomcenter"];
|
|
484
|
+
};
|
|
485
|
+
readonly options: {
|
|
486
|
+
readonly type: "object";
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
readonly interactions: {
|
|
492
|
+
readonly type: "array";
|
|
493
|
+
readonly description: "Interactive elements (markers, popups, tooltips)";
|
|
494
|
+
readonly items: {
|
|
495
|
+
readonly oneOf: readonly [{
|
|
496
|
+
readonly type: "object";
|
|
497
|
+
readonly required: readonly ["type", "longitude", "latitude"];
|
|
498
|
+
readonly properties: {
|
|
499
|
+
readonly type: {
|
|
500
|
+
readonly type: "string";
|
|
501
|
+
readonly const: "marker";
|
|
502
|
+
};
|
|
503
|
+
readonly longitude: {
|
|
504
|
+
readonly type: "number";
|
|
505
|
+
};
|
|
506
|
+
readonly latitude: {
|
|
507
|
+
readonly type: "number";
|
|
508
|
+
};
|
|
509
|
+
readonly content: {
|
|
510
|
+
readonly type: "string";
|
|
511
|
+
};
|
|
512
|
+
readonly draggable: {
|
|
513
|
+
readonly type: "boolean";
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
}, {
|
|
517
|
+
readonly type: "object";
|
|
518
|
+
readonly required: readonly ["type", "longitude", "latitude", "content"];
|
|
519
|
+
readonly properties: {
|
|
520
|
+
readonly type: {
|
|
521
|
+
readonly type: "string";
|
|
522
|
+
readonly const: "popup";
|
|
523
|
+
};
|
|
524
|
+
readonly longitude: {
|
|
525
|
+
readonly type: "number";
|
|
526
|
+
};
|
|
527
|
+
readonly latitude: {
|
|
528
|
+
readonly type: "number";
|
|
529
|
+
};
|
|
530
|
+
readonly content: {
|
|
531
|
+
readonly type: "string";
|
|
532
|
+
};
|
|
533
|
+
readonly closeButton: {
|
|
534
|
+
readonly type: "boolean";
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
}, {
|
|
538
|
+
readonly type: "object";
|
|
539
|
+
readonly required: readonly ["type", "content"];
|
|
540
|
+
readonly properties: {
|
|
541
|
+
readonly type: {
|
|
542
|
+
readonly type: "string";
|
|
543
|
+
readonly const: "tooltip";
|
|
544
|
+
};
|
|
545
|
+
readonly content: {
|
|
546
|
+
readonly type: "string";
|
|
547
|
+
};
|
|
548
|
+
readonly trigger: {
|
|
549
|
+
readonly type: "string";
|
|
550
|
+
readonly enum: readonly ["hover", "click"];
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
}];
|
|
554
|
+
};
|
|
555
|
+
};
|
|
556
|
+
readonly legends: {
|
|
557
|
+
readonly type: "array";
|
|
558
|
+
readonly description: "Legend configurations";
|
|
559
|
+
readonly items: {
|
|
560
|
+
readonly oneOf: readonly [{
|
|
561
|
+
readonly type: "object";
|
|
562
|
+
readonly required: readonly ["type", "labels", "colors"];
|
|
563
|
+
readonly properties: {
|
|
564
|
+
readonly type: {
|
|
565
|
+
readonly type: "string";
|
|
566
|
+
readonly const: "categories";
|
|
567
|
+
};
|
|
568
|
+
readonly title: {
|
|
569
|
+
readonly type: "string";
|
|
570
|
+
};
|
|
571
|
+
readonly labels: {
|
|
572
|
+
readonly type: "array";
|
|
573
|
+
readonly items: {
|
|
574
|
+
readonly type: "string";
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
readonly colors: {
|
|
578
|
+
readonly type: "array";
|
|
579
|
+
readonly items: {
|
|
580
|
+
readonly type: "string";
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
}, {
|
|
585
|
+
readonly type: "object";
|
|
586
|
+
readonly required: readonly ["type", "labels", "colors"];
|
|
587
|
+
readonly properties: {
|
|
588
|
+
readonly type: {
|
|
589
|
+
readonly type: "string";
|
|
590
|
+
readonly const: "ramp";
|
|
591
|
+
};
|
|
592
|
+
readonly title: {
|
|
593
|
+
readonly type: "string";
|
|
594
|
+
};
|
|
595
|
+
readonly labels: {
|
|
596
|
+
readonly type: "array";
|
|
597
|
+
readonly items: {
|
|
598
|
+
readonly type: "string";
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
readonly colors: {
|
|
602
|
+
readonly type: "array";
|
|
603
|
+
readonly items: {
|
|
604
|
+
readonly type: "string";
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
readonly isContinuous: {
|
|
608
|
+
readonly type: "boolean";
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
}, {
|
|
612
|
+
readonly type: "object";
|
|
613
|
+
readonly required: readonly ["type", "labels"];
|
|
614
|
+
readonly properties: {
|
|
615
|
+
readonly type: {
|
|
616
|
+
readonly type: "string";
|
|
617
|
+
readonly const: "proportion";
|
|
618
|
+
};
|
|
619
|
+
readonly title: {
|
|
620
|
+
readonly type: "string";
|
|
621
|
+
};
|
|
622
|
+
readonly labels: {
|
|
623
|
+
readonly type: "array";
|
|
624
|
+
readonly items: {
|
|
625
|
+
readonly type: "array";
|
|
626
|
+
readonly items: {
|
|
627
|
+
readonly type: "number";
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
readonly fillColor: {
|
|
632
|
+
readonly type: "string";
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
}, {
|
|
636
|
+
readonly type: "object";
|
|
637
|
+
readonly required: readonly ["type", "items"];
|
|
638
|
+
readonly properties: {
|
|
639
|
+
readonly type: {
|
|
640
|
+
readonly type: "string";
|
|
641
|
+
readonly const: "icon";
|
|
642
|
+
};
|
|
643
|
+
readonly title: {
|
|
644
|
+
readonly type: "string";
|
|
645
|
+
};
|
|
646
|
+
readonly items: {
|
|
647
|
+
readonly type: "array";
|
|
648
|
+
readonly items: {
|
|
649
|
+
readonly type: "object";
|
|
650
|
+
readonly properties: {
|
|
651
|
+
readonly icon: {
|
|
652
|
+
readonly type: "string";
|
|
653
|
+
};
|
|
654
|
+
readonly label: {
|
|
655
|
+
readonly type: "string";
|
|
656
|
+
};
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
}];
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
readonly responsive: {
|
|
665
|
+
readonly type: "object";
|
|
666
|
+
readonly properties: {
|
|
667
|
+
readonly breakpoint: {
|
|
668
|
+
readonly type: "number";
|
|
669
|
+
readonly default: 768;
|
|
670
|
+
};
|
|
671
|
+
readonly mobile: {
|
|
672
|
+
readonly type: "object";
|
|
673
|
+
readonly properties: {
|
|
674
|
+
readonly controls: {
|
|
675
|
+
readonly type: "object";
|
|
676
|
+
readonly properties: {
|
|
677
|
+
readonly position: {
|
|
678
|
+
readonly type: "string";
|
|
679
|
+
};
|
|
680
|
+
readonly scale: {
|
|
681
|
+
readonly type: "number";
|
|
682
|
+
};
|
|
683
|
+
readonly hide: {
|
|
684
|
+
readonly type: "array";
|
|
685
|
+
readonly items: {
|
|
686
|
+
readonly type: "string";
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
readonly legends: {
|
|
692
|
+
readonly type: "object";
|
|
693
|
+
readonly properties: {
|
|
694
|
+
readonly compact: {
|
|
695
|
+
readonly type: "boolean";
|
|
696
|
+
};
|
|
697
|
+
readonly position: {
|
|
698
|
+
readonly type: "string";
|
|
699
|
+
};
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
readonly toolbar: {
|
|
703
|
+
readonly type: "object";
|
|
704
|
+
readonly required: readonly ["items", "position"];
|
|
705
|
+
readonly properties: {
|
|
706
|
+
readonly items: {
|
|
707
|
+
readonly type: "array";
|
|
708
|
+
readonly items: {
|
|
709
|
+
readonly type: "string";
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
readonly position: {
|
|
713
|
+
readonly type: "string";
|
|
714
|
+
readonly enum: readonly ["bottom", "top"];
|
|
715
|
+
};
|
|
716
|
+
};
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
readonly events: {
|
|
723
|
+
readonly type: "object";
|
|
724
|
+
readonly description: "Global event identifier mappings for map and interactions";
|
|
725
|
+
readonly properties: {
|
|
726
|
+
readonly mapMove: {
|
|
727
|
+
readonly type: "string";
|
|
728
|
+
readonly description: "Event identifier for map move";
|
|
729
|
+
};
|
|
730
|
+
readonly mapZoom: {
|
|
731
|
+
readonly type: "string";
|
|
732
|
+
readonly description: "Event identifier for map zoom";
|
|
733
|
+
};
|
|
734
|
+
readonly markerDragEnd: {
|
|
735
|
+
readonly type: "string";
|
|
736
|
+
readonly description: "Event identifier for marker drag end";
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
export declare interface AiMapProps {
|
|
744
|
+
/**
|
|
745
|
+
* 组件化模式:只传地图配置,图层/控件/交互通过子组件添加
|
|
746
|
+
*
|
|
747
|
+
* ```tsx
|
|
748
|
+
* <AiMap map={{ basemap: 'gaode', center: [116, 39], zoom: 10 }}>
|
|
749
|
+
* <PointLayer source={data} color="#5B8FF9" size={12} />
|
|
750
|
+
* <ZoomControl />
|
|
751
|
+
* </AiMap>
|
|
752
|
+
* ```
|
|
753
|
+
*/
|
|
754
|
+
map?: MapSchema;
|
|
755
|
+
/**
|
|
756
|
+
* Schema 模式:通过完整 JSON Schema 一次性配置(AI 生成场景)
|
|
757
|
+
*
|
|
758
|
+
* ```tsx
|
|
759
|
+
* <AiMap schema={fullSchema} />
|
|
760
|
+
* ```
|
|
761
|
+
*/
|
|
762
|
+
schema?: AiMapSchema;
|
|
763
|
+
/**
|
|
764
|
+
* 主题模式
|
|
765
|
+
* - `'light'`: 亮色主题(默认)
|
|
766
|
+
* - `'dark'`: 暗色主题
|
|
767
|
+
* - `'system'`: 跟随系统 prefers-color-scheme
|
|
768
|
+
*/
|
|
769
|
+
theme?: MapTheme;
|
|
770
|
+
/** 场景就绪回调 */
|
|
771
|
+
onSceneReady?: (scene: Scene) => void;
|
|
772
|
+
/**
|
|
773
|
+
* 是否自动缩放至所有图层数据范围(覆盖 map.center / map.zoom)
|
|
774
|
+
*
|
|
775
|
+
* 开启后会在地图与所有图层就绪后自动调用 `scene.fitBounds`,将视野适配到全部
|
|
776
|
+
* 图层数据的外接矩形。适合数据范围未知或需要"打开页面即看到全部数据"的场景。
|
|
777
|
+
*
|
|
778
|
+
* 注意:底图必须支持 `fitBounds`(高德 / Maplibre / Mapbox / 天地图均支持)。
|
|
779
|
+
*/
|
|
780
|
+
autoFit?: boolean;
|
|
781
|
+
/** 图层点击事件 */
|
|
782
|
+
onLayerClick?: (payload: LayerEventPayload) => void;
|
|
783
|
+
/** 图层鼠标移动事件 */
|
|
784
|
+
onLayerMouseMove?: (payload: LayerEventPayload) => void;
|
|
785
|
+
/** 图层鼠标进入事件 */
|
|
786
|
+
onLayerMouseEnter?: (payload: LayerEventPayload) => void;
|
|
787
|
+
/** 图层鼠标离开事件 */
|
|
788
|
+
onLayerMouseLeave?: (payload: LayerEventPayload) => void;
|
|
789
|
+
/** 地图移动事件 */
|
|
790
|
+
onMapMove?: (payload: MapEventPayload) => void;
|
|
791
|
+
/** 地图缩放事件 */
|
|
792
|
+
onMapZoom?: (payload: MapEventPayload) => void;
|
|
793
|
+
/** EventBus 事件监听 */
|
|
794
|
+
events?: Record<string, (...args: unknown[]) => void>;
|
|
795
|
+
/** 子组件(组件化模式下使用) */
|
|
796
|
+
children?: default_2.ReactNode;
|
|
797
|
+
/** 容器 className */
|
|
798
|
+
className?: string;
|
|
799
|
+
/** 容器 style */
|
|
800
|
+
style?: default_2.CSSProperties;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export declare interface AiMapSchema {
|
|
804
|
+
map: MapSchema;
|
|
805
|
+
layers: LayerSchema[];
|
|
806
|
+
controls?: ControlSchema[];
|
|
807
|
+
interactions?: InteractionSchema[];
|
|
808
|
+
legends?: LegendSchema[];
|
|
809
|
+
responsive?: ResponsiveSchema;
|
|
810
|
+
events?: EventSchema;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export declare interface AnimateConfig {
|
|
814
|
+
enable: boolean;
|
|
815
|
+
speed?: number;
|
|
816
|
+
duration?: number;
|
|
817
|
+
trailLength?: number;
|
|
818
|
+
repeat?: number;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
export declare function applyControlDefaults(control: ControlSchema): ControlSchema;
|
|
822
|
+
|
|
823
|
+
export declare function applyLayerDefaults(layer: LayerSchema): LayerSchema;
|
|
824
|
+
|
|
825
|
+
export declare function applyMapDefaults(map: MapSchema): ResolvedMapSchema;
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* 根据响应式配置合并 Schema
|
|
829
|
+
*/
|
|
830
|
+
export declare function applyResponsiveOverrides<T extends DeepMergeable>(base: T, overrides: Partial<T> | undefined): T;
|
|
831
|
+
|
|
832
|
+
export declare function applySchemaDefaults(schema: AiMapSchema): AiMapSchema;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* 弧线流向色彩模式
|
|
836
|
+
* - single: 单色模式(默认 primary)
|
|
837
|
+
* - gradient: 起点色 → 终点色渐变
|
|
838
|
+
* - field: 按字段映射色板
|
|
839
|
+
*/
|
|
840
|
+
export declare type ArcColorMode = 'single' | 'gradient' | 'field';
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* OD 数据项
|
|
844
|
+
*/
|
|
845
|
+
export declare interface ArcFlowDataItem {
|
|
846
|
+
/** 起点经度 */
|
|
847
|
+
fromLng: number;
|
|
848
|
+
/** 起点纬度 */
|
|
849
|
+
fromLat: number;
|
|
850
|
+
/** 终点经度 */
|
|
851
|
+
toLng: number;
|
|
852
|
+
/** 终点纬度 */
|
|
853
|
+
toLat: number;
|
|
854
|
+
/** 权重/流量值 */
|
|
855
|
+
weight?: number;
|
|
856
|
+
/** 起点名称 */
|
|
857
|
+
fromName?: string;
|
|
858
|
+
/** 终点名称 */
|
|
859
|
+
toName?: string;
|
|
860
|
+
[key: string]: unknown;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* 弧线流向复合图层 (Arc & OD Flow Map)
|
|
865
|
+
*
|
|
866
|
+
* 遵循设计规范:
|
|
867
|
+
* - 弧线形态:贝塞尔 / 3D / 大圆航线
|
|
868
|
+
* - 线宽按权重映射(1~5px)
|
|
869
|
+
* - 渐变色强化流向感
|
|
870
|
+
* - 粒子/轨迹流动动画
|
|
871
|
+
* - 节点锚点 + 脉冲波纹
|
|
872
|
+
* - Hover 高亮路径 + 其余置灰
|
|
873
|
+
*
|
|
874
|
+
* @example
|
|
875
|
+
* ```tsx
|
|
876
|
+
* <ArcFlowLayer
|
|
877
|
+
* source={odData}
|
|
878
|
+
* shape="arc3d"
|
|
879
|
+
* colorMode="gradient"
|
|
880
|
+
* gradientColors={['#93c5fd', '#2563eb']}
|
|
881
|
+
* lineWidthRange={[1, 4]}
|
|
882
|
+
* animate
|
|
883
|
+
* showNodes
|
|
884
|
+
* nodePulse
|
|
885
|
+
* />
|
|
886
|
+
* ```
|
|
887
|
+
*/
|
|
888
|
+
export declare function ArcFlowLayer({ source, sourceType, sourceConfig, shape, color, gradientColors, colorMode, colorField, colorValues, lineWidth, lineWidthRange, weightField, opacity, blur, animate, animateSpeed, animateTrailLength, animateDuration, showNodes, nodeColor, nodeSize, nodeSizeRange, nodePulse, activeColor, onArcHover, onArcClick, onNodeClick, style: extraStyle, }: ArcFlowLayerProps): JSX_2.Element;
|
|
889
|
+
|
|
890
|
+
export declare interface ArcFlowLayerProps {
|
|
891
|
+
/** OD 数据源 — JSON 数组 */
|
|
892
|
+
source: ArcFlowDataItem[] | string;
|
|
893
|
+
/** 数据源类型 */
|
|
894
|
+
sourceType?: 'json' | 'csv';
|
|
895
|
+
/** 字段映射配置(覆盖默认 fromLng/fromLat/toLng/toLat) */
|
|
896
|
+
sourceConfig?: {
|
|
897
|
+
x?: string;
|
|
898
|
+
y?: string;
|
|
899
|
+
x1?: string;
|
|
900
|
+
y1?: string;
|
|
901
|
+
};
|
|
902
|
+
/** 弧线形态,默认 'arc' */
|
|
903
|
+
shape?: ArcShape;
|
|
904
|
+
/** 弧线颜色(单色模式),默认 '#2563EB' */
|
|
905
|
+
color?: string;
|
|
906
|
+
/** 渐变色(gradient 模式):[起点色, 终点色] */
|
|
907
|
+
gradientColors?: [string, string];
|
|
908
|
+
/** 颜色模式,默认 'single' */
|
|
909
|
+
colorMode?: ArcColorMode;
|
|
910
|
+
/** 字段映射色板时的字段名 */
|
|
911
|
+
colorField?: string;
|
|
912
|
+
/** 字段映射色板值 */
|
|
913
|
+
colorValues?: string[];
|
|
914
|
+
/** 弧线宽度,默认 1.5 */
|
|
915
|
+
lineWidth?: number;
|
|
916
|
+
/** 按权重映射宽度范围 [min, max],例如 [1, 5] */
|
|
917
|
+
lineWidthRange?: [number, number];
|
|
918
|
+
/** 权重字段名,默认 'weight' */
|
|
919
|
+
weightField?: string;
|
|
920
|
+
/** 弧线透明度,默认 0.8 */
|
|
921
|
+
opacity?: number;
|
|
922
|
+
/** 弧线模糊度,默认 0.6(增加柔和感) */
|
|
923
|
+
blur?: number;
|
|
924
|
+
/** 是否启用流动动画,默认 false */
|
|
925
|
+
animate?: boolean;
|
|
926
|
+
/** 动画速度(数值越大越快),默认 1 */
|
|
927
|
+
animateSpeed?: number;
|
|
928
|
+
/** 动画尾迹长度 0~1,默认 0.3 */
|
|
929
|
+
animateTrailLength?: number;
|
|
930
|
+
/** 动画持续时间(ms),默认 2000 */
|
|
931
|
+
animateDuration?: number;
|
|
932
|
+
/** 是否显示起终点节点,默认 true */
|
|
933
|
+
showNodes?: boolean;
|
|
934
|
+
/** 节点颜色,默认跟随弧线色 */
|
|
935
|
+
nodeColor?: string;
|
|
936
|
+
/** 节点大小,默认 4 */
|
|
937
|
+
nodeSize?: number;
|
|
938
|
+
/** 节点大小按权重映射范围,例如 [3, 12] */
|
|
939
|
+
nodeSizeRange?: [number, number];
|
|
940
|
+
/** 是否显示节点呼吸脉冲动画,默认 false */
|
|
941
|
+
nodePulse?: boolean;
|
|
942
|
+
/** hover 高亮色 */
|
|
943
|
+
activeColor?: string;
|
|
944
|
+
/** 弧线 hover 事件 */
|
|
945
|
+
onArcHover?: (payload: LayerEventPayload) => void;
|
|
946
|
+
/** 弧线点击事件 */
|
|
947
|
+
onArcClick?: (payload: LayerEventPayload) => void;
|
|
948
|
+
/** 节点点击事件 */
|
|
949
|
+
onNodeClick?: (payload: LayerEventPayload) => void;
|
|
950
|
+
/** 额外 style */
|
|
951
|
+
style?: Record<string, unknown>;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* 弧线形态
|
|
956
|
+
* - arc: 2D 贝塞尔弧线(默认)
|
|
957
|
+
* - arc3d: 3D 弧线(适合倾斜视角)
|
|
958
|
+
* - greatcircle: 大圆航线(跨洲长距离)
|
|
959
|
+
*/
|
|
960
|
+
export declare type ArcShape = 'arc' | 'arc3d' | 'greatcircle';
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* @antv/aimapui Schema 类型定义
|
|
964
|
+
* 纯可序列化 Schema,面向 AI 生成优化
|
|
965
|
+
*/
|
|
966
|
+
export declare type BasemapType = 'gaode' | 'mapbox' | 'maplibre' | 'tianditu' | 'tencent' | 'baidu' | 'google' | 'map';
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* 移动端底部抽屉组件
|
|
970
|
+
*
|
|
971
|
+
* 支持三档吸附:收起(collapsed)、半展开(half)、完全展开(expanded)
|
|
972
|
+
* 手势拖拽切换,Material Design 3 风格
|
|
973
|
+
*
|
|
974
|
+
* ```tsx
|
|
975
|
+
* <BottomSheet defaultSnap="half">
|
|
976
|
+
* <div>抽屉内容</div>
|
|
977
|
+
* </BottomSheet>
|
|
978
|
+
* ```
|
|
979
|
+
*/
|
|
980
|
+
export declare function BottomSheet({ children, defaultSnap, collapsedHeight, halfRatio, expandedRatio, onSnapChange, className, showHandle, borderRadius, }: BottomSheetProps): JSX_2.Element;
|
|
981
|
+
|
|
982
|
+
export declare interface BottomSheetProps {
|
|
983
|
+
/** 子内容 */
|
|
984
|
+
children?: default_2.ReactNode;
|
|
985
|
+
/** 初始吸附状态 */
|
|
986
|
+
defaultSnap?: BottomSheetSnap;
|
|
987
|
+
/** 收起时的高度(px) */
|
|
988
|
+
collapsedHeight?: number;
|
|
989
|
+
/** 半展开时的高度比例(0-1),相对于容器高度 */
|
|
990
|
+
halfRatio?: number;
|
|
991
|
+
/** 完全展开时的高度比例(0-1),相对于容器高度 */
|
|
992
|
+
expandedRatio?: number;
|
|
993
|
+
/** 吸附状态变化回调 */
|
|
994
|
+
onSnapChange?: (snap: BottomSheetSnap) => void;
|
|
995
|
+
/** 自定义样式类名 */
|
|
996
|
+
className?: string;
|
|
997
|
+
/** 是否显示拖拽手柄 */
|
|
998
|
+
showHandle?: boolean;
|
|
999
|
+
/** 圆角大小 */
|
|
1000
|
+
borderRadius?: number;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
export declare type BottomSheetSnap = 'collapsed' | 'half' | 'expanded';
|
|
1004
|
+
|
|
1005
|
+
declare type BubbleAnchor = 'center' | 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* 气泡图组件(Bubble Map)
|
|
1009
|
+
* 默认遵循设计规范:
|
|
1010
|
+
* - 圆形 + 半透明填充 + 实色描边
|
|
1011
|
+
* - 五级尺寸映射(8/16/32/48/64)
|
|
1012
|
+
* - 默认启用 hover/click 交互反馈
|
|
1013
|
+
* - 利用 L7 2.28+ anchor 参数自动布局标签,避免与气泡重叠
|
|
1014
|
+
*
|
|
1015
|
+
* 推荐锚点组合:
|
|
1016
|
+
* - bubbleAnchor='center', labelAnchor='center' — 标签居中覆盖气泡(适合短文本)
|
|
1017
|
+
* - bubbleAnchor='bottom', labelAnchor='top' — 标签在气泡上方(经典布局)
|
|
1018
|
+
*/
|
|
1019
|
+
export declare function BubbleLayer({ source, sourceType, sourceConfig, labelField, labelColor, labelSize, showLabel, labelTrigger, labelOffset, sizeDomain, bubbleAnchor, labelAnchor, hoverEffect, clickEffect, tooltipEffect, tooltipFields, tooltipTemplate, semanticColorField, color, size, sizeField, sizeValues, style, active, select, onClick, onMouseMove, onMouseEnter, onMouseLeave, ...rest }: BubbleLayerProps): JSX_2.Element;
|
|
1020
|
+
|
|
1021
|
+
export declare interface BubbleLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1022
|
+
source: LayerSchema['source'];
|
|
1023
|
+
sourceType?: LayerSchema['sourceType'];
|
|
1024
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
1025
|
+
/** 文本标签字段,默认 name */
|
|
1026
|
+
labelField?: string;
|
|
1027
|
+
labelColor?: string;
|
|
1028
|
+
labelSize?: number;
|
|
1029
|
+
showLabel?: boolean;
|
|
1030
|
+
/** 文本标签触发方式:'always' 始终显示 | 'hover' 鼠标划过时显示,默认 'always' */
|
|
1031
|
+
labelTrigger?: 'always' | 'hover';
|
|
1032
|
+
/** 文本偏移量,默认根据气泡最大半径自动计算 */
|
|
1033
|
+
labelOffset?: [number, number];
|
|
1034
|
+
/** sizeField 为离散值时,对应每个 sizeValues 的域值顺序(默认 1..N) */
|
|
1035
|
+
sizeDomain?: Array<string | number>;
|
|
1036
|
+
/** 气泡锚点,决定标签相对气泡的连接参考点 */
|
|
1037
|
+
bubbleAnchor?: BubbleAnchor;
|
|
1038
|
+
/** 文本锚点,映射到 textAnchor */
|
|
1039
|
+
labelAnchor?: BubbleAnchor;
|
|
1040
|
+
/** 是否启用默认 hover 强化(opacity + 边框强调) */
|
|
1041
|
+
hoverEffect?: boolean;
|
|
1042
|
+
/** 是否启用默认 click 选中反馈 */
|
|
1043
|
+
clickEffect?: boolean;
|
|
1044
|
+
/** 是否启用默认 tooltip/popup(点击气泡弹出) */
|
|
1045
|
+
tooltipEffect?: boolean;
|
|
1046
|
+
/** tooltip 展示字段,不传则自动展示常见字段 */
|
|
1047
|
+
tooltipFields?: string[];
|
|
1048
|
+
/** tooltip 模板,支持 {{field}} 占位符 */
|
|
1049
|
+
tooltipTemplate?: string;
|
|
1050
|
+
/** 语义色板映射字段,例如 status: primary|warning|error|success */
|
|
1051
|
+
semanticColorField?: string;
|
|
1052
|
+
/** 点击事件 */
|
|
1053
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1054
|
+
/** 鼠标移动事件 */
|
|
1055
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
1056
|
+
/** 鼠标进入事件 */
|
|
1057
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
1058
|
+
/** 鼠标离开事件 */
|
|
1059
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* 内置天气 iconfont 图标映射(at.alicdn.com 字体)
|
|
1064
|
+
* key 为语义化名称,value 为 HTML 实体格式的 iconfont unicode(&#xHEX;)
|
|
1065
|
+
*/
|
|
1066
|
+
export declare const BUILTIN_ICON_FONTS: Array<[string, string]>;
|
|
1067
|
+
|
|
1068
|
+
/** 业务数据匹配项 */
|
|
1069
|
+
export declare interface BusinessDataItem {
|
|
1070
|
+
name?: string;
|
|
1071
|
+
adcode?: string | number;
|
|
1072
|
+
value?: number;
|
|
1073
|
+
[key: string]: unknown;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* 中国行政区划图层(ChinaDistrict)
|
|
1078
|
+
*
|
|
1079
|
+
* 内置全国省/市/县三级 GeoJSON 数据,支持下钻模式与业务数据关联色阶映射。
|
|
1080
|
+
*/
|
|
1081
|
+
export declare function ChinaDistrict({ provinceSource, citySource, districtSource, level, drillEnabled, drillPath: controlledDrillPath, onDrill, data, joinField, dataJoinField, valueField, colors, fillOpacity, strokeColor, strokeWidth, dimOpacity, showLabel, labelField, labelSize, hoverHighlight, clickSelect, showTooltip, tooltipFields, onRegionClick, zIndex, }: ChinaDistrictProps): JSX_2.Element | null;
|
|
1082
|
+
|
|
1083
|
+
export declare interface ChinaDistrictProps {
|
|
1084
|
+
/** 省级 GeoJSON 数据 URL 或对象,默认内置全国省级数据 */
|
|
1085
|
+
provinceSource?: string | Record<string, unknown>;
|
|
1086
|
+
/** 市级 GeoJSON 数据 URL 或对象,默认内置全国市级数据 */
|
|
1087
|
+
citySource?: string | Record<string, unknown>;
|
|
1088
|
+
/** 县级 GeoJSON 数据 URL 或对象,默认内置全国县级数据 */
|
|
1089
|
+
districtSource?: string | Record<string, unknown>;
|
|
1090
|
+
/** 当前显示层级(非下钻模式时使用) */
|
|
1091
|
+
level?: AdministrativeLevel;
|
|
1092
|
+
/** 是否启用下钻模式 */
|
|
1093
|
+
drillEnabled?: boolean;
|
|
1094
|
+
/** 下钻路径(受控模式) */
|
|
1095
|
+
drillPath?: DrillPathNode[];
|
|
1096
|
+
/** 下钻回调 */
|
|
1097
|
+
onDrill?: (path: DrillPathNode[]) => void;
|
|
1098
|
+
/** 业务数据,通过 name 或 adcode 与地理数据关联 */
|
|
1099
|
+
data?: BusinessDataItem[];
|
|
1100
|
+
/** 关联字段(地理数据属性名) */
|
|
1101
|
+
joinField?: string;
|
|
1102
|
+
/** 业务数据匹配字段 */
|
|
1103
|
+
dataJoinField?: string;
|
|
1104
|
+
/** 数值字段名(用于色阶映射) */
|
|
1105
|
+
valueField?: string;
|
|
1106
|
+
/** 色阶颜色数组 */
|
|
1107
|
+
colors?: string[];
|
|
1108
|
+
/** 填充透明度 */
|
|
1109
|
+
fillOpacity?: number;
|
|
1110
|
+
/** 描边颜色 */
|
|
1111
|
+
strokeColor?: string;
|
|
1112
|
+
/** 描边宽度 */
|
|
1113
|
+
strokeWidth?: number;
|
|
1114
|
+
/** 非焦点区域透明度(下钻时) */
|
|
1115
|
+
dimOpacity?: number;
|
|
1116
|
+
/** 是否显示标签 */
|
|
1117
|
+
showLabel?: boolean;
|
|
1118
|
+
/** 标签字段名 */
|
|
1119
|
+
labelField?: string;
|
|
1120
|
+
/** 标签字号 */
|
|
1121
|
+
labelSize?: number;
|
|
1122
|
+
/** hover 高亮 */
|
|
1123
|
+
hoverHighlight?: boolean;
|
|
1124
|
+
/** 点击选中 */
|
|
1125
|
+
clickSelect?: boolean;
|
|
1126
|
+
/** Tooltip 显示 */
|
|
1127
|
+
showTooltip?: boolean;
|
|
1128
|
+
/** Tooltip 自定义字段 */
|
|
1129
|
+
tooltipFields?: string[];
|
|
1130
|
+
/** 区域点击事件 */
|
|
1131
|
+
onRegionClick?: (feature: Record<string, unknown>, level: AdministrativeLevel) => void;
|
|
1132
|
+
/** 图层 zIndex */
|
|
1133
|
+
zIndex?: number;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
declare interface ClusterItem {
|
|
1137
|
+
id: string;
|
|
1138
|
+
/** supercluster 分配的 cluster ID(仅聚合点有,单点为 -1) */
|
|
1139
|
+
clusterId: number;
|
|
1140
|
+
lng: number;
|
|
1141
|
+
lat: number;
|
|
1142
|
+
/** 聚合包含的点数,单点为 1 */
|
|
1143
|
+
pointCount: number;
|
|
1144
|
+
isCluster: boolean;
|
|
1145
|
+
properties: Record<string, unknown>;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
declare interface ClusterPoint {
|
|
1149
|
+
id: string;
|
|
1150
|
+
lng: number;
|
|
1151
|
+
lat: number;
|
|
1152
|
+
properties: Record<string, unknown>;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* 公共 Adapter 工具函数
|
|
1157
|
+
* 抽取各 Layer Adapter 中重复的视觉映射和数据源构建逻辑
|
|
1158
|
+
*/
|
|
1159
|
+
declare interface ColorConfig {
|
|
1160
|
+
field?: string;
|
|
1161
|
+
values?: string[] | string;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* L7 规范的控件容器,将子控件按 position 分组到四角自动排列
|
|
1166
|
+
*
|
|
1167
|
+
* 核心机制:
|
|
1168
|
+
* 1. 遍历 children,识别控件组件(有 position prop 或已注册的控件类型)
|
|
1169
|
+
* 2. 按 position 分组,每组放在一个 flex 容器中(.l7-control-anchor)
|
|
1170
|
+
* 3. 非控件 children(如 Marker、Layer)原样渲染
|
|
1171
|
+
* 4. 设置 ControlContainerContext,让子控件知道自己处于容器中,
|
|
1172
|
+
* 从而跳过自身的 .l7-control-anchor 包裹
|
|
1173
|
+
*
|
|
1174
|
+
* 用法:
|
|
1175
|
+
* ```tsx
|
|
1176
|
+
* <ControlContainer>
|
|
1177
|
+
* <ZoomControl position="bottomright" />
|
|
1178
|
+
* <GeoLocateControl position="bottomright" />
|
|
1179
|
+
* <ScaleControl position="bottomleft" />
|
|
1180
|
+
* <MapThemeControl position="topright" />
|
|
1181
|
+
* </ControlContainer>
|
|
1182
|
+
* ```
|
|
1183
|
+
*/
|
|
1184
|
+
export declare function ControlContainer({ children, className, style }: ControlContainerProps): JSX_2.Element;
|
|
1185
|
+
|
|
1186
|
+
declare interface ControlContainerProps {
|
|
1187
|
+
children?: ReactNode;
|
|
1188
|
+
className?: string;
|
|
1189
|
+
style?: default_2.CSSProperties;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
export declare type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright' | 'topcenter' | 'bottomcenter' | 'lefttop' | 'leftbottom' | 'righttop' | 'rightbottom';
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* 控件公共属性
|
|
1196
|
+
*/
|
|
1197
|
+
export declare interface ControlProps {
|
|
1198
|
+
/** 控件位置,默认各控件有各自的默认值 */
|
|
1199
|
+
position?: L7ControlPosition;
|
|
1200
|
+
/** 额外 className */
|
|
1201
|
+
className?: string;
|
|
1202
|
+
/** 额外 style */
|
|
1203
|
+
style?: React.CSSProperties;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* 控件注册器 — 每个控件组件调用 mark() 标记自身
|
|
1208
|
+
*/
|
|
1209
|
+
export declare const ControlRegistry: {
|
|
1210
|
+
/** 注册控件组件 */
|
|
1211
|
+
mark(Comp: any): void;
|
|
1212
|
+
/** 检测 child 是否为注册过的控件组件 */
|
|
1213
|
+
check(child: default_2.ReactElement): boolean;
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Schema 模式控件渲染器
|
|
1218
|
+
*
|
|
1219
|
+
* 使用 ControlContainer 包裹,按 position 自动分组排列,
|
|
1220
|
+
* 同一角度的多个控件自动堆叠而不会重叠
|
|
1221
|
+
*/
|
|
1222
|
+
export declare function ControlRenderer({ controls, layers, onLayerToggle, containerRef }: ControlRendererProps): JSX_2.Element;
|
|
1223
|
+
|
|
1224
|
+
declare interface ControlRendererProps {
|
|
1225
|
+
controls: ControlSchema[];
|
|
1226
|
+
layers: LayerSchema[];
|
|
1227
|
+
onLayerToggle?: (layerId: string, visible: boolean) => void;
|
|
1228
|
+
containerRef?: default_2.RefObject<HTMLElement | null>;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
export declare interface ControlSchema {
|
|
1232
|
+
type: ControlType;
|
|
1233
|
+
position?: ControlPosition;
|
|
1234
|
+
options?: Record<string, unknown>;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
export declare type ControlType = 'zoom' | 'scale' | 'fullscreen' | 'geoLocate' | 'mapTheme' | 'mouseLocation' | 'exportImage' | 'layerSwitch';
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* 底图工厂 — 根据配置创建 L7 Map 实例
|
|
1241
|
+
* 动态导入各底图模块,避免未使用时打包
|
|
1242
|
+
*/
|
|
1243
|
+
export declare function createBasemap(schema: MapSchema): Promise<default_3 | Mapbox | TMap | TencentMap | BaiduMap | MapLibre | GoogleMap | Map_2>;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* 创建 EventBus 实例
|
|
1247
|
+
*/
|
|
1248
|
+
export declare function createEventBus(): EventBus;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* 合并 className(基于 clsx)
|
|
1252
|
+
*/
|
|
1253
|
+
export declare function cx(...inputs: (string | undefined | null | false)[]): string;
|
|
1254
|
+
|
|
1255
|
+
export declare function deepMerge<T extends DeepMergeable>(target: T, source: Partial<T>): T;
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* 深度合并工具函数
|
|
1259
|
+
* 适用于合并 Schema 配置,如响应式覆盖
|
|
1260
|
+
*/
|
|
1261
|
+
declare type DeepMergeable = Record<string, any>;
|
|
1262
|
+
|
|
1263
|
+
export declare const DEFAULT_CITY_SOURCE = "https://mdn.alipayobjects.com/antforest/afts/file/A*Xd8TQoduwj8AAAAAgEAAAAgAerd2AQ/original_\u4E2D\u56FD_\u5E02.json";
|
|
1264
|
+
|
|
1265
|
+
export declare const DEFAULT_DISTRICT_SOURCE = "https://mdn.alipayobjects.com/portal_moelhz/afts/file/A*Rb96Tac1p8EAAAAAgKAAAAgAegAAAQ";
|
|
1266
|
+
|
|
1267
|
+
/** 内置行政区划数据源 */
|
|
1268
|
+
export declare const DEFAULT_PROVINCE_SOURCE = "https://mdn.alipayobjects.com/antforest/afts/file/A*T2OJQ7XZzeEAAAAAgCAAAAgAerd2AQ/original_\u4E2D\u56FD_\u7701.json";
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* 对比两个 Schema 的差异,返回需要更新的部分
|
|
1272
|
+
*/
|
|
1273
|
+
export declare function diffSchema(prev: AiMapSchema, next: AiMapSchema): SchemaDiffResult;
|
|
1274
|
+
|
|
1275
|
+
/** 下钻路径节点 */
|
|
1276
|
+
export declare interface DrillPathNode {
|
|
1277
|
+
level: AdministrativeLevel;
|
|
1278
|
+
name: string;
|
|
1279
|
+
adcode?: string | number;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* 错误边界组件
|
|
1284
|
+
*
|
|
1285
|
+
* 捕获子组件树中的 JS 错误,防止整个应用崩溃。
|
|
1286
|
+
* 适用于第三方地图 SDK 可能抛出异常的场景(如 key 失效、网络阻断等)。
|
|
1287
|
+
*/
|
|
1288
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
1289
|
+
state: ErrorBoundaryState;
|
|
1290
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
1291
|
+
componentDidCatch(error: Error, errorInfo: default_2.ErrorInfo): void;
|
|
1292
|
+
render(): string | number | boolean | Iterable<default_2.ReactNode> | JSX_2.Element | null | undefined;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
declare interface ErrorBoundaryProps {
|
|
1296
|
+
/** 出错时的降级 UI,默认显示错误信息 */
|
|
1297
|
+
fallback?: default_2.ReactNode | ((error: Error) => default_2.ReactNode);
|
|
1298
|
+
/** 错误回调 */
|
|
1299
|
+
onError?: (error: Error, errorInfo: default_2.ErrorInfo) => void;
|
|
1300
|
+
children: default_2.ReactNode;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
declare interface ErrorBoundaryState {
|
|
1304
|
+
hasError: boolean;
|
|
1305
|
+
error: Error | null;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* 简单事件总线,用于组件间通信
|
|
1310
|
+
*/
|
|
1311
|
+
export declare class EventBus {
|
|
1312
|
+
private listeners;
|
|
1313
|
+
/**
|
|
1314
|
+
* 注册事件监听
|
|
1315
|
+
*/
|
|
1316
|
+
on(event: string, callback: EventCallback): () => void;
|
|
1317
|
+
/**
|
|
1318
|
+
* 注册一次性事件监听
|
|
1319
|
+
*/
|
|
1320
|
+
once(event: string, callback: EventCallback): () => void;
|
|
1321
|
+
/**
|
|
1322
|
+
* 触发事件
|
|
1323
|
+
*/
|
|
1324
|
+
emit(event: string, ...args: unknown[]): void;
|
|
1325
|
+
/**
|
|
1326
|
+
* 移除指定事件的所有监听
|
|
1327
|
+
*/
|
|
1328
|
+
off(event: string): void;
|
|
1329
|
+
/**
|
|
1330
|
+
* 清除所有监听
|
|
1331
|
+
*/
|
|
1332
|
+
clear(): void;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
export declare function EventBusProvider({ events, children }: EventBusProviderProps): JSX_2.Element;
|
|
1336
|
+
|
|
1337
|
+
declare interface EventBusProviderProps {
|
|
1338
|
+
/** 初始事件监听(从 AiMap events prop 传入) */
|
|
1339
|
+
events?: Record<string, (...args: unknown[]) => void>;
|
|
1340
|
+
children: default_2.ReactNode;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
declare type EventCallback = (...args: unknown[]) => void;
|
|
1344
|
+
|
|
1345
|
+
declare type EventIdentifier = string;
|
|
1346
|
+
|
|
1347
|
+
export declare interface EventSchema {
|
|
1348
|
+
/** 地图移动事件标识符 */
|
|
1349
|
+
mapMove?: EventIdentifier;
|
|
1350
|
+
/** 地图缩放事件标识符 */
|
|
1351
|
+
mapZoom?: EventIdentifier;
|
|
1352
|
+
/** Marker 拖拽结束事件标识符 */
|
|
1353
|
+
markerDragEnd?: EventIdentifier;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
export declare function ExportImageControl({ position, format, onExport, className, style, }: ExportImageControlProps): JSX_2.Element;
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* ExportImage 导出图片控件
|
|
1360
|
+
*
|
|
1361
|
+
* 遵循 L7 的 ButtonControl 规范 + Material Design 3 玻璃态风格:
|
|
1362
|
+
* - CSS 类名: .l7-control .l7-button-control
|
|
1363
|
+
* - 玻璃态: glass-effect + surface/90 背景
|
|
1364
|
+
* - 位置默认: topright
|
|
1365
|
+
* - API: mapsService.exportMap() + scene.exportPng(),然后合并图片
|
|
1366
|
+
*/
|
|
1367
|
+
export declare interface ExportImageControlProps {
|
|
1368
|
+
/** 控件位置,默认 topright */
|
|
1369
|
+
position?: L7ControlPosition;
|
|
1370
|
+
/** 图片格式,默认 png */
|
|
1371
|
+
format?: 'png' | 'jpg';
|
|
1372
|
+
className?: string;
|
|
1373
|
+
style?: default_2.CSSProperties;
|
|
1374
|
+
/** 导出回调 */
|
|
1375
|
+
onExport?: (base64: string) => void;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
declare type FillColorMapping = 'sequential' | 'diverging' | 'categorical';
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* 填充图组件(填充 + 描边 + 文字)
|
|
1382
|
+
*/
|
|
1383
|
+
export declare function FillLayer({ source, sourceType, colorMapping, showStroke, strokeColor, strokeWidth, hoverEffect, clickEffect, stickySelection, tooltipEffect, tooltipFields, tooltipTemplate, regionIdField, highlightStrokeColor, highlightStrokeWidth, zoomToRegionOnClick, clickZoomPadding, clickZoomDelta, onRegionClick, onDrilldown, showLabel, labelField, labelColor, labelSize, labelAreaThreshold, labelHaloWidth, minLabelZoom, valueField, percentageField, nameField, color, colorField, colorValues, active, select, events, style, ...rest }: FillLayerProps): JSX_2.Element;
|
|
1384
|
+
|
|
1385
|
+
export declare interface FillLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1386
|
+
source: LayerSchema['source'];
|
|
1387
|
+
sourceType?: LayerSchema['sourceType'];
|
|
1388
|
+
colorMapping?: FillColorMapping;
|
|
1389
|
+
showStroke?: boolean;
|
|
1390
|
+
strokeColor?: string;
|
|
1391
|
+
strokeWidth?: number;
|
|
1392
|
+
hoverEffect?: boolean;
|
|
1393
|
+
clickEffect?: boolean;
|
|
1394
|
+
stickySelection?: boolean;
|
|
1395
|
+
tooltipEffect?: boolean;
|
|
1396
|
+
tooltipFields?: string[];
|
|
1397
|
+
tooltipTemplate?: string;
|
|
1398
|
+
regionIdField?: string;
|
|
1399
|
+
highlightStrokeColor?: string;
|
|
1400
|
+
highlightStrokeWidth?: number;
|
|
1401
|
+
zoomToRegionOnClick?: boolean;
|
|
1402
|
+
clickZoomPadding?: number;
|
|
1403
|
+
clickZoomDelta?: number;
|
|
1404
|
+
onRegionClick?: (payload: LayerEventPayload) => void;
|
|
1405
|
+
onDrilldown?: (feature: Record<string, unknown>) => void;
|
|
1406
|
+
showLabel?: boolean;
|
|
1407
|
+
labelField?: string;
|
|
1408
|
+
labelColor?: string;
|
|
1409
|
+
labelSize?: number;
|
|
1410
|
+
labelAreaThreshold?: number;
|
|
1411
|
+
labelHaloWidth?: number;
|
|
1412
|
+
minLabelZoom?: number;
|
|
1413
|
+
valueField?: string;
|
|
1414
|
+
percentageField?: string;
|
|
1415
|
+
nameField?: string;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
export declare function FullscreenControl({ position, container, className, style, }: FullscreenControlProps): JSX_2.Element;
|
|
1419
|
+
|
|
1420
|
+
/**
|
|
1421
|
+
* Fullscreen 全屏控件
|
|
1422
|
+
*
|
|
1423
|
+
* 遵循 L7 的 ButtonControl 规范 + Material Design 3 玻璃态风格:
|
|
1424
|
+
* - CSS 类名: .l7-control .l7-button-control
|
|
1425
|
+
* - 玻璃态: glass-effect + surface/90 背景
|
|
1426
|
+
* - 位置默认: topright
|
|
1427
|
+
* - API: ScreenFull.toggle(container)
|
|
1428
|
+
* - 事件: document.fullscreenchange
|
|
1429
|
+
*/
|
|
1430
|
+
export declare interface FullscreenControlProps {
|
|
1431
|
+
/** 控件位置,默认 topright */
|
|
1432
|
+
position?: L7ControlPosition;
|
|
1433
|
+
/** 全屏目标容器,默认使用地图容器 */
|
|
1434
|
+
container?: HTMLElement | null;
|
|
1435
|
+
className?: string;
|
|
1436
|
+
style?: default_2.CSSProperties;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* 内置高德地图主题预设
|
|
1441
|
+
*/
|
|
1442
|
+
export declare const GAODE_THEME_PRESETS: ThemeOption[];
|
|
1443
|
+
|
|
1444
|
+
export declare function GeoLocateControl({ position, transform, className, style, }: GeoLocateControlProps): JSX_2.Element;
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* GeoLocate 定位控件
|
|
1448
|
+
*
|
|
1449
|
+
* 遵循 L7 的 ButtonControl 规范 + Material Design 3 玻璃态风格:
|
|
1450
|
+
* - CSS 类名: .l7-control .l7-button-control
|
|
1451
|
+
* - 玻璃态: glass-effect + surface/90 背景
|
|
1452
|
+
* - 位置默认: topright
|
|
1453
|
+
* - API: navigator.geolocation + mapsService.setZoomAndCenter()
|
|
1454
|
+
* - transform 回调支持坐标转换
|
|
1455
|
+
*/
|
|
1456
|
+
export declare interface GeoLocateControlProps {
|
|
1457
|
+
/** 控件位置,默认 topright */
|
|
1458
|
+
position?: L7ControlPosition;
|
|
1459
|
+
/** 坐标转换函数 */
|
|
1460
|
+
transform?: (position: [number, number]) => [number, number] | Promise<[number, number]>;
|
|
1461
|
+
className?: string;
|
|
1462
|
+
style?: default_2.CSSProperties;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
export declare interface GestureConfig {
|
|
1466
|
+
dragPan?: boolean;
|
|
1467
|
+
pinchZoom?: boolean;
|
|
1468
|
+
dragRotate?: boolean;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* 字体图标标注图层(GlyphLayer)
|
|
1473
|
+
*
|
|
1474
|
+
* 支持 Material Symbols Outlined 及自定义 iconfont 字体:
|
|
1475
|
+
* - Material Symbols: 页面已加载 Google 字体,组件自动注册映射表,开箱即用
|
|
1476
|
+
* - 内置 iconfont: at.alicdn.com 天气字体,内置 5 个图标
|
|
1477
|
+
* - 自定义: 传入 iconFontFamily + iconFontPath + iconFontMap
|
|
1478
|
+
*
|
|
1479
|
+
* 特性:
|
|
1480
|
+
* - SDF 渲染确保任意缩放下边缘锐利
|
|
1481
|
+
* - 图标 1-2px 光晕增强复杂底图辨识度
|
|
1482
|
+
* - 文字 2px 光晕确保可读性
|
|
1483
|
+
* - 碰撞检测:图标始终可见,仅文本被避让
|
|
1484
|
+
* - 缩放适配:L1(14+) 全显示 → L2(10-13) 仅图标 → L3(<10) 降级圆点
|
|
1485
|
+
*/
|
|
1486
|
+
export declare function GlyphLayer({ source, sourceType, sourceConfig, iconField, iconFontFamily, iconFontPath, iconFontMap, iconColor, iconSize, iconHaloColor, iconHaloWidth, iconStyle, showLabel, labelField, labelColor, labelSize, labelAnchor, labelOffset, labelHaloColor, labelHaloWidth, labelStyle, textAllowOverlap, iconAllowOverlap, zoomAdaption, zoomShowLabel, zoomDegradeToPoint, onClick, onMouseEnter, onMouseLeave, ...rest }: GlyphLayerProps): JSX_2.Element | null;
|
|
1487
|
+
|
|
1488
|
+
export declare interface GlyphLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1489
|
+
source: LayerSchema['source'];
|
|
1490
|
+
sourceType?: LayerSchema['sourceType'];
|
|
1491
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
1492
|
+
/** 图标内容字段(数据中每个要素的该字段值将作为图标文本渲染) */
|
|
1493
|
+
iconField: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* 字体族模式
|
|
1496
|
+
* - 'material-symbols'(默认):使用 Material Symbols Outlined 字体,图标名需使用官方名称(如 sunny / flight / restaurant)
|
|
1497
|
+
* - 'iconfont':使用 at.alicdn.com 内置 iconfont 字体,图标名需使用 BUILTIN_ICON_FONTS 中的名称
|
|
1498
|
+
* - 自定义字符串:自行通过 scene.addFontFace / addIconFonts 注册的字体族名
|
|
1499
|
+
*/
|
|
1500
|
+
iconFontFamily?: string;
|
|
1501
|
+
/**
|
|
1502
|
+
* 自定义字体文件 URL,仅在 iconFontFamily 为自定义字符串时需要
|
|
1503
|
+
* Material Symbols 自动从页面已加载的字体中获取;iconfont 使用内置 URL
|
|
1504
|
+
*/
|
|
1505
|
+
iconFontPath?: string;
|
|
1506
|
+
/**
|
|
1507
|
+
* 自定义图标映射表,仅在 iconFontFamily 为自定义字符串时需要
|
|
1508
|
+
* 格式同 addIconFonts:[['iconName', '&#xHEX;'], ...]
|
|
1509
|
+
* 注意:Unicode 值必须使用 HTML 实体格式 &#xHEX; ,而非 JS \uXXXX 转义
|
|
1510
|
+
*/
|
|
1511
|
+
iconFontMap?: Array<[string, string]>;
|
|
1512
|
+
/** 图标颜色,支持单色或数据驱动映射 */
|
|
1513
|
+
iconColor?: LayerSchema['color'];
|
|
1514
|
+
/** 图标尺寸 (16-24px),默认 20 */
|
|
1515
|
+
iconSize?: number;
|
|
1516
|
+
/** 图标光晕颜色,默认白色 */
|
|
1517
|
+
iconHaloColor?: string;
|
|
1518
|
+
/** 图标光晕宽度 (1-2px),默认 1 */
|
|
1519
|
+
iconHaloWidth?: number;
|
|
1520
|
+
/** 图标样式扩展 */
|
|
1521
|
+
iconStyle?: Record<string, unknown>;
|
|
1522
|
+
/** 是否显示文字标签,默认 true */
|
|
1523
|
+
showLabel?: boolean;
|
|
1524
|
+
/** 文字标签字段,默认取 iconField */
|
|
1525
|
+
labelField?: string;
|
|
1526
|
+
/** 标签颜色 */
|
|
1527
|
+
labelColor?: string;
|
|
1528
|
+
/** 标签字号 (10-14px),默认 11 */
|
|
1529
|
+
labelSize?: number;
|
|
1530
|
+
/** 文字锚点位置(直接透传给 L7 textAnchor),默认 'top' */
|
|
1531
|
+
labelAnchor?: LabelAnchor;
|
|
1532
|
+
/** 标签偏移量 [x, y],默认 [0, 0] */
|
|
1533
|
+
labelOffset?: [number, number];
|
|
1534
|
+
/** 标签光晕颜色,默认白色 */
|
|
1535
|
+
labelHaloColor?: string;
|
|
1536
|
+
/** 标签光晕宽度,默认 2px */
|
|
1537
|
+
labelHaloWidth?: number;
|
|
1538
|
+
/** 标签样式扩展 */
|
|
1539
|
+
labelStyle?: Record<string, unknown>;
|
|
1540
|
+
/** 文本标签是否允许重叠,默认 false(开启碰撞检测,仅隐藏文本) */
|
|
1541
|
+
textAllowOverlap?: boolean;
|
|
1542
|
+
/** 图标是否允许重叠,默认 true(图标始终保持可见) */
|
|
1543
|
+
iconAllowOverlap?: boolean;
|
|
1544
|
+
/** 是否开启缩放适配,默认 true */
|
|
1545
|
+
zoomAdaption?: boolean;
|
|
1546
|
+
/** 高缩放级阈值(显示图标+文字),默认 14 */
|
|
1547
|
+
zoomShowLabel?: number;
|
|
1548
|
+
/** 低缩放级阈值(降级为圆点),默认 10 */
|
|
1549
|
+
zoomDegradeToPoint?: number;
|
|
1550
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1551
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
1552
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* 热力图图层组件
|
|
1557
|
+
*
|
|
1558
|
+
* 支持悬停高亮交互(对齐蜂窝热力图设计规范)
|
|
1559
|
+
*/
|
|
1560
|
+
export declare function HeatmapLayer({ source, sourceType, sourceConfig, onClick, onMouseMove, onMouseEnter, onMouseLeave, ...rest }: HeatmapLayerProps): JSX_2.Element | null;
|
|
1561
|
+
|
|
1562
|
+
export declare interface HeatmapLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1563
|
+
source: LayerSchema['source'];
|
|
1564
|
+
sourceType?: LayerSchema['sourceType'];
|
|
1565
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
1566
|
+
/** 点击事件 */
|
|
1567
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1568
|
+
/** 鼠标移动事件 */
|
|
1569
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
1570
|
+
/** 鼠标进入事件 */
|
|
1571
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
1572
|
+
/** 鼠标离开事件 */
|
|
1573
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
/**
|
|
1577
|
+
* 蜂窝热力图(六边形聚合)
|
|
1578
|
+
*/
|
|
1579
|
+
declare function HexagonLayer({ source, sourceType, sourceConfig, hexSize, weightField, weightMethod, onClick, onMouseMove, style, ...rest }: HexagonLayerProps): JSX_2.Element;
|
|
1580
|
+
export { HexagonLayer as HeatmapHexagonLayer }
|
|
1581
|
+
export { HexagonLayer }
|
|
1582
|
+
|
|
1583
|
+
declare interface HexagonLayerProps extends Omit<LayerSchema, 'type' | 'shape' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1584
|
+
source: LayerSchema['source'];
|
|
1585
|
+
sourceType?: LayerSchema['sourceType'];
|
|
1586
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
1587
|
+
hexSize?: number;
|
|
1588
|
+
weightField?: string;
|
|
1589
|
+
weightMethod?: 'sum' | 'mean' | 'min' | 'max' | 'count';
|
|
1590
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1591
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
1592
|
+
}
|
|
1593
|
+
export { HexagonLayerProps as HeatmapHexagonLayerProps }
|
|
1594
|
+
export { HexagonLayerProps }
|
|
1595
|
+
|
|
1596
|
+
/**
|
|
1597
|
+
* 将十六进制颜色转为 RGBA
|
|
1598
|
+
*/
|
|
1599
|
+
export declare function hexToRgba(hex: string, alpha?: number): string;
|
|
1600
|
+
|
|
1601
|
+
export declare type IconAnchor = 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* 图片标注图层(IconLayer)
|
|
1605
|
+
*
|
|
1606
|
+
* 按照设计规范实现的图片图标+文字标签组合图层:
|
|
1607
|
+
* - 内置图标与文字两个 PointLayer,统一管理渲染时序
|
|
1608
|
+
* - 图标 1px 白色描边 (Halo) 增强复杂底图辨识度
|
|
1609
|
+
* - 文字 2px 光晕确保深色底图可读性
|
|
1610
|
+
* - 缩放适配:Zoom15+ 全显示 → 10-14 仅图标 → <10 降级圆点
|
|
1611
|
+
* - 碰撞检测:重叠时隐藏低优先级文本
|
|
1612
|
+
*/
|
|
1613
|
+
export declare function IconLayer({ source, sourceType, sourceConfig, iconField, iconMap, iconSize, iconAnchor, size, showLabel, labelField, labelColor, labelSize, labelAnchor, labelOffset, labelHaloColor, labelHaloWidth, labelStyle, textAllowOverlap, iconAllowOverlap, zoomAdaption, zoomShowLabel, zoomDegradeToPoint, onClick, onMouseEnter, onMouseLeave, ...rest }: IconLayerProps): JSX_2.Element | null;
|
|
1614
|
+
|
|
1615
|
+
export declare interface IconLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1616
|
+
source: LayerSchema['source'];
|
|
1617
|
+
sourceType?: LayerSchema['sourceType'];
|
|
1618
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
1619
|
+
/** 图标映射字段 */
|
|
1620
|
+
iconField: string;
|
|
1621
|
+
/** 图标资源映射 { fieldValue: imageUrl } */
|
|
1622
|
+
iconMap: Record<string, string>;
|
|
1623
|
+
/** 图标尺寸,标准 24,紧凑 16 */
|
|
1624
|
+
iconSize?: number;
|
|
1625
|
+
/** 图标锚点位置,默认 'bottom' */
|
|
1626
|
+
iconAnchor?: IconAnchor;
|
|
1627
|
+
/** 是否显示文字标签,默认 true */
|
|
1628
|
+
showLabel?: boolean;
|
|
1629
|
+
/** 文字标签字段,默认取 iconField */
|
|
1630
|
+
labelField?: string;
|
|
1631
|
+
/** 标签颜色 */
|
|
1632
|
+
labelColor?: string;
|
|
1633
|
+
/** 标签字号 (12-14px) */
|
|
1634
|
+
labelSize?: number;
|
|
1635
|
+
/** 文字锚点位置(直接透传给 L7 textAnchor),默认 'top' */
|
|
1636
|
+
labelAnchor?: LabelAnchor_2;
|
|
1637
|
+
/** 标签光晕颜色,默认白色 */
|
|
1638
|
+
labelHaloColor?: string;
|
|
1639
|
+
/** 标签光晕宽度,默认 2px */
|
|
1640
|
+
labelHaloWidth?: number;
|
|
1641
|
+
/** 标签偏移量 [x, y],默认 [0, 0] */
|
|
1642
|
+
labelOffset?: [number, number];
|
|
1643
|
+
/** 标签样式扩展 */
|
|
1644
|
+
labelStyle?: Record<string, unknown>;
|
|
1645
|
+
/** 文本是否允许重叠,默认 false(开启碰撞检测) */
|
|
1646
|
+
textAllowOverlap?: boolean;
|
|
1647
|
+
/** 图标是否允许重叠,默认 true */
|
|
1648
|
+
iconAllowOverlap?: boolean;
|
|
1649
|
+
/** 是否开启缩放适配,默认 true */
|
|
1650
|
+
zoomAdaption?: boolean;
|
|
1651
|
+
/** 高缩放级阈值(显示图标+文字),默认 15 */
|
|
1652
|
+
zoomShowLabel?: number;
|
|
1653
|
+
/** 低缩放级阈值(降级为圆点),默认 10 */
|
|
1654
|
+
zoomDegradeToPoint?: number;
|
|
1655
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1656
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
1657
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* 图片图层组件
|
|
1662
|
+
*/
|
|
1663
|
+
export declare function ImageLayer({ source, sourceType, sourceConfig, onClick, ...rest }: ImageLayerProps): JSX_2.Element | null;
|
|
1664
|
+
|
|
1665
|
+
export declare interface ImageLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1666
|
+
source: LayerSchema['source'];
|
|
1667
|
+
sourceType?: LayerSchema['sourceType'];
|
|
1668
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
1669
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* 独立 Map (L7 内置) 主题预设
|
|
1674
|
+
*/
|
|
1675
|
+
export declare const INDEPENDENT_MAP_THEME_PRESETS: ThemeOption[];
|
|
1676
|
+
|
|
1677
|
+
/**
|
|
1678
|
+
* 批量渲染交互元素(Marker / Popup)
|
|
1679
|
+
* Tooltip 由图层 hover/click 事件驱动,在此不做渲染
|
|
1680
|
+
*
|
|
1681
|
+
* 参考 L7 实现:使用 mapsService.getMarkerContainer() 作为 Marker/Popup 的 DOM 容器
|
|
1682
|
+
*/
|
|
1683
|
+
export declare function InteractionRenderer({ interactions }: InteractionRendererProps): JSX_2.Element;
|
|
1684
|
+
|
|
1685
|
+
declare interface InteractionRendererProps {
|
|
1686
|
+
interactions: InteractionSchema[];
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
export declare type InteractionSchema = MarkerSchema | PopupSchema | TooltipSchema;
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* 控件位置类型,与 L7 PositionType 一致
|
|
1693
|
+
*/
|
|
1694
|
+
export declare type L7ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright' | 'topcenter' | 'bottomcenter' | 'lefttop' | 'leftbottom' | 'righttop' | 'rightbottom' | 'rightcenter' | 'leftcenter';
|
|
1695
|
+
|
|
1696
|
+
/** 标签锚点位置 */
|
|
1697
|
+
export declare type LabelAnchor = 'right' | 'bottom' | 'top' | 'left' | 'center';
|
|
1698
|
+
|
|
1699
|
+
/** 锚点位置 */
|
|
1700
|
+
declare type LabelAnchor_2 = 'right' | 'bottom' | 'top' | 'left';
|
|
1701
|
+
|
|
1702
|
+
/** 图层事件回调集合 */
|
|
1703
|
+
export declare interface LayerEventHandlers {
|
|
1704
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1705
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
1706
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
1707
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/** L7 图层事件回调参数 */
|
|
1711
|
+
export declare interface LayerEventPayload {
|
|
1712
|
+
/** 触发事件的图层 ID(schema.id 或自动生成) */
|
|
1713
|
+
layerId: string;
|
|
1714
|
+
/** 图层类型 */
|
|
1715
|
+
layerType: LayerType;
|
|
1716
|
+
/** L7 原始事件对象 */
|
|
1717
|
+
originalEvent: unknown;
|
|
1718
|
+
/** 经度 */
|
|
1719
|
+
lng: number;
|
|
1720
|
+
/** 纬度 */
|
|
1721
|
+
lat: number;
|
|
1722
|
+
/** 命中的数据属性 */
|
|
1723
|
+
feature?: Record<string, unknown>;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
/** 图层级别事件配置 */
|
|
1727
|
+
export declare interface LayerEventSchema {
|
|
1728
|
+
/** 点击事件标识符,触发时通过 EventBus 广播 */
|
|
1729
|
+
click?: EventIdentifier;
|
|
1730
|
+
/** 鼠标悬浮事件标识符 */
|
|
1731
|
+
mousemove?: EventIdentifier;
|
|
1732
|
+
/** 鼠标移入事件标识符 */
|
|
1733
|
+
mouseenter?: EventIdentifier;
|
|
1734
|
+
/** 鼠标移出事件标识符 */
|
|
1735
|
+
mouseleave?: EventIdentifier;
|
|
1736
|
+
/** 是否启用内置 Popup(点击显示数据) */
|
|
1737
|
+
enablePopup?: boolean;
|
|
1738
|
+
/** Popup 触发方式,默认 click */
|
|
1739
|
+
popupTrigger?: 'click' | 'hover';
|
|
1740
|
+
/** Popup 显示的字段,不设则显示所有字段 */
|
|
1741
|
+
popupFields?: string[];
|
|
1742
|
+
/** Popup 模板,支持 {{field}} 占位符 */
|
|
1743
|
+
popupTemplate?: string;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* 图层配置项 — 支持可见性切换 + 透明度
|
|
1748
|
+
*/
|
|
1749
|
+
export declare interface LayerItem {
|
|
1750
|
+
/** 图层 ID */
|
|
1751
|
+
id: string;
|
|
1752
|
+
/** 图层名称 */
|
|
1753
|
+
name?: string;
|
|
1754
|
+
/** 是否可见,默认 true */
|
|
1755
|
+
visible?: boolean;
|
|
1756
|
+
/** 透明度 0~1,默认 1 */
|
|
1757
|
+
opacity?: number;
|
|
1758
|
+
/** 图层图标 (Material Symbols Outlined 名称),默认 layers */
|
|
1759
|
+
icon?: string;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* 批量渲染图层
|
|
1764
|
+
*/
|
|
1765
|
+
export declare function LayerRenderer({ layers, eventHandlers }: LayerRendererProps): JSX_2.Element | null;
|
|
1766
|
+
|
|
1767
|
+
declare interface LayerRendererProps {
|
|
1768
|
+
layers: LayerSchema[];
|
|
1769
|
+
/** 图层事件回调集合 */
|
|
1770
|
+
eventHandlers?: LayerEventHandlers;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
export declare interface LayerSchema {
|
|
1774
|
+
id?: string;
|
|
1775
|
+
type: LayerType;
|
|
1776
|
+
name?: string;
|
|
1777
|
+
visible?: boolean;
|
|
1778
|
+
zIndex?: number;
|
|
1779
|
+
minZoom?: number;
|
|
1780
|
+
maxZoom?: number;
|
|
1781
|
+
autoFit?: boolean;
|
|
1782
|
+
source: unknown;
|
|
1783
|
+
sourceType?: SourceType;
|
|
1784
|
+
sourceConfig?: SourceConfig;
|
|
1785
|
+
color?: string;
|
|
1786
|
+
colorField?: string;
|
|
1787
|
+
colorValues?: string[] | string;
|
|
1788
|
+
size?: number;
|
|
1789
|
+
sizeField?: string;
|
|
1790
|
+
sizeValues?: number[];
|
|
1791
|
+
shape?: string;
|
|
1792
|
+
shapeField?: string;
|
|
1793
|
+
shapeValues?: string[] | string;
|
|
1794
|
+
style?: Record<string, unknown>;
|
|
1795
|
+
/** 图层整体不透明度,0~1,默认 1 */
|
|
1796
|
+
opacity?: number;
|
|
1797
|
+
/** 图层混合模式,对齐 CSS mix-blend-mode */
|
|
1798
|
+
blend?: 'normal' | 'additive' | 'subtractive' | 'max';
|
|
1799
|
+
filterField?: string;
|
|
1800
|
+
filterValues?: unknown[];
|
|
1801
|
+
animate?: AnimateConfig;
|
|
1802
|
+
active?: ActiveConfig;
|
|
1803
|
+
select?: SelectConfig;
|
|
1804
|
+
events?: LayerEventSchema;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
export declare function LayerSwitchControl({ position, layers, onToggle, onOpacityChange, className, style, }: LayerSwitchControlProps): JSX_2.Element | null;
|
|
1808
|
+
|
|
1809
|
+
export declare interface LayerSwitchControlProps {
|
|
1810
|
+
/** 控件位置,默认 topright */
|
|
1811
|
+
position?: L7ControlPosition;
|
|
1812
|
+
/** 图层列表 */
|
|
1813
|
+
layers: LayerItem[];
|
|
1814
|
+
/** 可见性切换回调 */
|
|
1815
|
+
onToggle: (layerId: string, visible: boolean) => void;
|
|
1816
|
+
/** 透明度变化回调 */
|
|
1817
|
+
onOpacityChange?: (layerId: string, opacity: number) => void;
|
|
1818
|
+
className?: string;
|
|
1819
|
+
style?: default_2.CSSProperties;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
export declare type LayerType = 'point' | 'line' | 'polygon' | 'heatmap' | 'raster' | 'image';
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* 分类图例 — 离散色块列表
|
|
1826
|
+
*
|
|
1827
|
+
* 视觉规范:
|
|
1828
|
+
* - 色块 12×12px,支持 square (rounded-sm) 和 circle 两种形状
|
|
1829
|
+
* - 垂直列表或两列网格布局(grid)
|
|
1830
|
+
* - 悬停高亮:其余项 dimmed (opacity 0.35)
|
|
1831
|
+
* - 点击切换:dimmed 态表示该项在地图上被隐藏
|
|
1832
|
+
*
|
|
1833
|
+
* @see legend.md §2 分类与枚举图例
|
|
1834
|
+
*/
|
|
1835
|
+
export declare function LegendCategories({ title, labels, colors, swatchShape, grid, className, interaction, }: LegendCategoriesProps): JSX_2.Element;
|
|
1836
|
+
|
|
1837
|
+
declare interface LegendCategoriesProps extends LegendCategoriesSchema {
|
|
1838
|
+
className?: string;
|
|
1839
|
+
/** 交互回调 */
|
|
1840
|
+
interaction?: LegendInteractionCallbacks;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
export declare interface LegendCategoriesSchema {
|
|
1844
|
+
type: 'categories';
|
|
1845
|
+
title?: string;
|
|
1846
|
+
labels: string[];
|
|
1847
|
+
colors: string[];
|
|
1848
|
+
/** 色块形状,默认 'square' */
|
|
1849
|
+
swatchShape?: LegendSwatchShape;
|
|
1850
|
+
/** 是否使用两列网格布局,默认 false */
|
|
1851
|
+
grid?: boolean;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* 发散图例 — 双极渐变色条
|
|
1856
|
+
*
|
|
1857
|
+
* 展示偏离中心点(如 0 或平均值)的对称变化。
|
|
1858
|
+
* 中间位置显示中性点标签,两端向不同色调延伸。
|
|
1859
|
+
*
|
|
1860
|
+
* 视觉规范:
|
|
1861
|
+
* - 色条高度 12px,圆角 4px
|
|
1862
|
+
* - 中间竖线标记中性点
|
|
1863
|
+
* - 三标签布局:左端标签、中间标签、右端标签
|
|
1864
|
+
*
|
|
1865
|
+
* @see legend.md §4 离散与发散图例
|
|
1866
|
+
*/
|
|
1867
|
+
export declare function LegendDiverging({ title, colors, labels, middleLabel, className, }: LegendDivergingProps): JSX_2.Element;
|
|
1868
|
+
|
|
1869
|
+
declare interface LegendDivergingProps extends LegendDivergingSchema {
|
|
1870
|
+
className?: string;
|
|
1871
|
+
interaction?: LegendInteractionCallbacks;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
/** 发散图例:双极渐变(如 红→灰→绿) */
|
|
1875
|
+
export declare interface LegendDivergingSchema {
|
|
1876
|
+
type: 'diverging';
|
|
1877
|
+
title?: string;
|
|
1878
|
+
/** 渐变色列表,从左到右(如 ['#ef4444','#ccc','#10b981']) */
|
|
1879
|
+
colors: string[];
|
|
1880
|
+
/** [左端标签, 右端标签] */
|
|
1881
|
+
labels: [string, string];
|
|
1882
|
+
/** 中间值标签(如 '0' 或 'Avg') */
|
|
1883
|
+
middleLabel?: string;
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* 图标图例 — 图标 + 标签列表
|
|
1888
|
+
*
|
|
1889
|
+
* 使用自定义图标(URL 图片)和标签文本。
|
|
1890
|
+
* 图片加载失败时显示 fallback 文字。
|
|
1891
|
+
*
|
|
1892
|
+
* 视觉规范:
|
|
1893
|
+
* - 图标 20×20px
|
|
1894
|
+
* - 列表项 hover 高亮,点击切换显隐
|
|
1895
|
+
*
|
|
1896
|
+
* @see legend.md §2 分类与枚举图例 (图标变体)
|
|
1897
|
+
*/
|
|
1898
|
+
export declare function LegendIcon({ title, items, className, interaction }: LegendIconProps): JSX_2.Element;
|
|
1899
|
+
|
|
1900
|
+
export declare interface LegendIconItem {
|
|
1901
|
+
icon: string;
|
|
1902
|
+
label: string;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
declare interface LegendIconProps extends LegendIconSchema {
|
|
1906
|
+
className?: string;
|
|
1907
|
+
interaction?: LegendInteractionCallbacks;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
export declare interface LegendIconSchema {
|
|
1911
|
+
type: 'icon';
|
|
1912
|
+
title?: string;
|
|
1913
|
+
items: LegendIconItem[];
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
/** 图例交互回调 */
|
|
1917
|
+
export declare interface LegendInteractionCallbacks {
|
|
1918
|
+
/** 悬停高亮:传入图例项索引,-1 表示取消 */
|
|
1919
|
+
onHover?: (index: number) => void;
|
|
1920
|
+
/** 点击切换显隐:传入图例项索引 */
|
|
1921
|
+
onToggle?: (index: number) => void;
|
|
1922
|
+
/** 范围刷选:连续型图例的数据范围 [min, max] */
|
|
1923
|
+
onBrush?: (range: [number, number]) => void;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* 线宽图例 — 路径粗细映射
|
|
1928
|
+
*
|
|
1929
|
+
* 展示不同宽度的线条与对应数值的映射关系。
|
|
1930
|
+
* 适用于路径、轨迹、流向等线要素的图例说明。
|
|
1931
|
+
*
|
|
1932
|
+
* 视觉规范:
|
|
1933
|
+
* - 线宽为实际像素值,长度 28px,圆角 pill 形
|
|
1934
|
+
* - 标签在右侧
|
|
1935
|
+
* - 支持悬停高亮和点击显隐切换
|
|
1936
|
+
*
|
|
1937
|
+
* @see legend.md — LineWidth 类型图例
|
|
1938
|
+
*/
|
|
1939
|
+
export declare function LegendLineWidth({ title, color, items, className, interaction, }: LegendLineWidthProps): JSX_2.Element;
|
|
1940
|
+
|
|
1941
|
+
declare interface LegendLineWidthProps extends LegendLineWidthSchema {
|
|
1942
|
+
className?: string;
|
|
1943
|
+
interaction?: LegendInteractionCallbacks;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/** 线宽图例 */
|
|
1947
|
+
export declare interface LegendLineWidthSchema {
|
|
1948
|
+
type: 'lineWidth';
|
|
1949
|
+
title?: string;
|
|
1950
|
+
/** 线条颜色 */
|
|
1951
|
+
color?: string;
|
|
1952
|
+
/** 线宽项 */
|
|
1953
|
+
items: Array<{
|
|
1954
|
+
width: number;
|
|
1955
|
+
label: string;
|
|
1956
|
+
}>;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* 比例图例 — 数值区间与等比圆
|
|
1961
|
+
*
|
|
1962
|
+
* 使用 [min, max] 区间标签和等比递增的圆形展示数据分布。
|
|
1963
|
+
* 底部对齐,大小从最小到最大递增。
|
|
1964
|
+
*
|
|
1965
|
+
* 视觉规范(向后兼容):
|
|
1966
|
+
* - 圆直径 6px ~ 24px
|
|
1967
|
+
* - 等宽字体标签
|
|
1968
|
+
*
|
|
1969
|
+
* @see LegendSize 为新版推荐的替代组件,提供更灵活的 items 配置
|
|
1970
|
+
*/
|
|
1971
|
+
export declare function LegendProportion({ title, labels, fillColor, className, }: LegendProportionProps): JSX_2.Element;
|
|
1972
|
+
|
|
1973
|
+
declare interface LegendProportionProps extends LegendProportionSchema {
|
|
1974
|
+
className?: string;
|
|
1975
|
+
interaction?: LegendInteractionCallbacks;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
export declare interface LegendProportionSchema {
|
|
1979
|
+
type: 'proportion';
|
|
1980
|
+
title?: string;
|
|
1981
|
+
labels: [number, number][];
|
|
1982
|
+
fillColor?: string;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
/**
|
|
1986
|
+
* 连续/分级色带图例
|
|
1987
|
+
*
|
|
1988
|
+
* 视觉规范:
|
|
1989
|
+
* - 色条高度 12px,圆角 4px
|
|
1990
|
+
* - isContinuous: 无级渐变 (linear-gradient),否则分段色块
|
|
1991
|
+
* - 标签: 两侧 min/max,多标签时显示中间值
|
|
1992
|
+
* - showTicks: 刻度线
|
|
1993
|
+
* - brushable: 范围刷选手柄,支持拖动筛选数据范围
|
|
1994
|
+
*
|
|
1995
|
+
* @see legend.md §3 连续与分级图例
|
|
1996
|
+
*/
|
|
1997
|
+
export declare function LegendRamp({ title, labels, colors, isContinuous, showTicks, brushable, className, interaction, }: LegendRampProps): JSX_2.Element;
|
|
1998
|
+
|
|
1999
|
+
declare interface LegendRampProps extends LegendRampSchema {
|
|
2000
|
+
className?: string;
|
|
2001
|
+
/** 交互回调 */
|
|
2002
|
+
interaction?: LegendInteractionCallbacks;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
export declare interface LegendRampSchema {
|
|
2006
|
+
type: 'ramp';
|
|
2007
|
+
title?: string;
|
|
2008
|
+
labels: string[];
|
|
2009
|
+
colors: string[];
|
|
2010
|
+
/** 连续渐变 vs 分段色块,默认 false(分段) */
|
|
2011
|
+
isContinuous?: boolean;
|
|
2012
|
+
/** 是否显示刻度线 */
|
|
2013
|
+
showTicks?: boolean;
|
|
2014
|
+
/** 是否启用范围刷选 */
|
|
2015
|
+
brushable?: boolean;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
/**
|
|
2019
|
+
* 图例面板渲染器 — 统一管理多个图例的容器
|
|
2020
|
+
*
|
|
2021
|
+
* 功能:
|
|
2022
|
+
* - 玻璃拟态面板 (bg-surface/80 backdrop-blur-md)
|
|
2023
|
+
* - 自动根据 schema.type 分派到对应子组件
|
|
2024
|
+
* - 多图例间自动分隔
|
|
2025
|
+
* - 支持交互回调 (hover 高亮 / toggle 显隐 / brush 范围)
|
|
2026
|
+
*
|
|
2027
|
+
* @see legend.md §1 基础视觉准则
|
|
2028
|
+
*/
|
|
2029
|
+
export declare function LegendRenderer({ legends, className, style, interaction, }: LegendRendererProps): JSX_2.Element | null;
|
|
2030
|
+
|
|
2031
|
+
declare interface LegendRendererProps {
|
|
2032
|
+
legends: LegendSchema[];
|
|
2033
|
+
/** 图例面板位置样式,默认左下角 */
|
|
2034
|
+
className?: string;
|
|
2035
|
+
style?: default_2.CSSProperties;
|
|
2036
|
+
/** 图例交互回调 */
|
|
2037
|
+
interaction?: LegendInteractionCallbacks;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
export declare type LegendSchema = LegendCategoriesSchema | LegendRampSchema | LegendDivergingSchema | LegendThresholdSchema | LegendSizeSchema | LegendLineWidthSchema | LegendProportionSchema | LegendIconSchema;
|
|
2041
|
+
|
|
2042
|
+
/**
|
|
2043
|
+
* 比例大小图例 — 圆形大小映射
|
|
2044
|
+
*
|
|
2045
|
+
* 使用一组递增大小的圆形来展示数值与视觉尺寸的映射关系。
|
|
2046
|
+
* 圆形底部对齐,圆直径与数据值成正比。
|
|
2047
|
+
*
|
|
2048
|
+
* 视觉规范:
|
|
2049
|
+
* - 最大圆直径 24px,最小 6px
|
|
2050
|
+
* - 圆形带 1px 内嵌阴影以区分重叠
|
|
2051
|
+
* - 标签在圆下方,等宽字体
|
|
2052
|
+
*
|
|
2053
|
+
* @see legend.md — Size / Proportion 类型图例
|
|
2054
|
+
*/
|
|
2055
|
+
export declare function LegendSize({ title, fillColor, items, className, }: LegendSizeProps): JSX_2.Element;
|
|
2056
|
+
|
|
2057
|
+
declare interface LegendSizeProps extends LegendSizeSchema {
|
|
2058
|
+
className?: string;
|
|
2059
|
+
interaction?: LegendInteractionCallbacks;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
/** 比例大小图例:圆形大小映射 */
|
|
2063
|
+
export declare interface LegendSizeSchema {
|
|
2064
|
+
type: 'size';
|
|
2065
|
+
title?: string;
|
|
2066
|
+
/** 填充色 */
|
|
2067
|
+
fillColor?: string;
|
|
2068
|
+
/** 大小项:圆直径 (px) + 标签 */
|
|
2069
|
+
items: Array<{
|
|
2070
|
+
size: number;
|
|
2071
|
+
label: string;
|
|
2072
|
+
}>;
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
/** 分类图例色块形状 */
|
|
2076
|
+
export declare type LegendSwatchShape = 'square' | 'circle';
|
|
2077
|
+
|
|
2078
|
+
/**
|
|
2079
|
+
* 阈值图例 — 自定义分段垂直列表
|
|
2080
|
+
*
|
|
2081
|
+
* 根据业务需求定义的非等间距区间,以垂直列表展示。
|
|
2082
|
+
* 每项显示色块 + [min, max) 区间文本,支持悬停高亮与点击显隐切换。
|
|
2083
|
+
*
|
|
2084
|
+
* 视觉规范:
|
|
2085
|
+
* - 色块 24×12px,圆角 2px
|
|
2086
|
+
* - 区间标签使用 JetBrains Mono 等宽字体
|
|
2087
|
+
* - 悬停其余项 dimmed,点击切换显隐
|
|
2088
|
+
*
|
|
2089
|
+
* @see legend.md §3.3 Threshold 自定义分段
|
|
2090
|
+
*/
|
|
2091
|
+
export declare function LegendThreshold({ title, ranges, colors, className, interaction, }: LegendThresholdProps): JSX_2.Element;
|
|
2092
|
+
|
|
2093
|
+
declare interface LegendThresholdProps extends LegendThresholdSchema {
|
|
2094
|
+
className?: string;
|
|
2095
|
+
interaction?: LegendInteractionCallbacks;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
/** 阈值图例:自定义分段垂直列表 */
|
|
2099
|
+
export declare interface LegendThresholdSchema {
|
|
2100
|
+
type: 'threshold';
|
|
2101
|
+
title?: string;
|
|
2102
|
+
/** 区间定义 [min, max),从上到下排列 */
|
|
2103
|
+
ranges: [number | string, number | string][];
|
|
2104
|
+
/** 每个区间对应的颜色 */
|
|
2105
|
+
colors: string[];
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
/**
|
|
2109
|
+
* 线图层组件
|
|
2110
|
+
*
|
|
2111
|
+
* ```tsx
|
|
2112
|
+
* <AiMap map={{ basemap: 'gaode' }}>
|
|
2113
|
+
* <LineLayer source={flowData} sourceConfig={{ x: 'lng', y: 'lat', x1: 'lng1', y1: 'lat1' }} color="#5B8FF9" />
|
|
2114
|
+
* </AiMap>
|
|
2115
|
+
* ```
|
|
2116
|
+
*/
|
|
2117
|
+
export declare function LineLayer({ source, sourceType, sourceConfig, onClick, onMouseMove, onMouseEnter, onMouseLeave, ...rest }: LineLayerProps): JSX_2.Element | null;
|
|
2118
|
+
|
|
2119
|
+
export declare interface LineLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
2120
|
+
source: LayerSchema['source'];
|
|
2121
|
+
sourceType?: LayerSchema['sourceType'];
|
|
2122
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
2123
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
2124
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
2125
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
2126
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
declare interface MapEventHandlers {
|
|
2130
|
+
onMove?: (payload: MapEventPayload) => void;
|
|
2131
|
+
onZoom?: (payload: MapEventPayload) => void;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
/** 地图事件回调参数 */
|
|
2135
|
+
export declare interface MapEventPayload {
|
|
2136
|
+
/** L7 原始事件对象 */
|
|
2137
|
+
originalEvent: unknown;
|
|
2138
|
+
/** 当前中心点 */
|
|
2139
|
+
center: [number, number];
|
|
2140
|
+
/** 当前缩放级别 */
|
|
2141
|
+
zoom: number;
|
|
2142
|
+
/** 当前俯仰角 */
|
|
2143
|
+
pitch: number;
|
|
2144
|
+
/** 当前旋转角 */
|
|
2145
|
+
rotation: number;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
export declare function MapSceneRenderer({ mapSchema, children, onSceneReady, mapEventHandlers, events, className, style, }: MapSceneRendererProps): JSX_2.Element;
|
|
2149
|
+
|
|
2150
|
+
declare interface MapSceneRendererProps {
|
|
2151
|
+
mapSchema: MapSchema;
|
|
2152
|
+
children?: default_2.ReactNode;
|
|
2153
|
+
onSceneReady?: (scene: Scene) => void;
|
|
2154
|
+
mapEventHandlers?: MapEventHandlers;
|
|
2155
|
+
events?: EventSchema;
|
|
2156
|
+
className?: string;
|
|
2157
|
+
style?: default_2.CSSProperties;
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
export declare interface MapSchema {
|
|
2161
|
+
basemap: BasemapType;
|
|
2162
|
+
token?: string;
|
|
2163
|
+
style?: MapStylePreset | string;
|
|
2164
|
+
center?: [number, number];
|
|
2165
|
+
zoom?: number;
|
|
2166
|
+
pitch?: number;
|
|
2167
|
+
rotation?: number;
|
|
2168
|
+
minZoom?: number;
|
|
2169
|
+
maxZoom?: number;
|
|
2170
|
+
bounds?: [[number, number], [number, number]];
|
|
2171
|
+
gestureConfig?: GestureConfig;
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
export declare type MapStylePreset = 'light' | 'dark' | 'normal' | 'darkblue' | 'satellite';
|
|
2175
|
+
|
|
2176
|
+
export declare type MapTheme = 'light' | 'dark' | 'system';
|
|
2177
|
+
|
|
2178
|
+
export declare function MapThemeControl({ position, options: propOptions, defaultValue, onThemeChange, className, style, }: MapThemeControlProps): JSX_2.Element;
|
|
2179
|
+
|
|
2180
|
+
export declare interface MapThemeControlProps {
|
|
2181
|
+
/** 控件位置,默认 topright */
|
|
2182
|
+
position?: L7ControlPosition;
|
|
2183
|
+
/** 自定义主题选项,默认自动获取 */
|
|
2184
|
+
options?: ThemeOption[];
|
|
2185
|
+
/** 默认选中的主题值 */
|
|
2186
|
+
defaultValue?: string;
|
|
2187
|
+
/** 主题切换回调 */
|
|
2188
|
+
onThemeChange?: (value: string) => void;
|
|
2189
|
+
className?: string;
|
|
2190
|
+
style?: default_2.CSSProperties;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
export declare function Marker({ longitude, latitude, variant, color, icon, label, content, children, draggable, className, overlayContainer, onClick, onMouseEnter, onMouseLeave, onDoubleClick, onDragEnd, onDragging, onDragStart, selected, inactive, anchor, offsets, overflowHide, }: MarkerProps): null;
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* Marker 聚合图层(基于 supercluster)
|
|
2197
|
+
*
|
|
2198
|
+
* 性能优化策略:
|
|
2199
|
+
* 1. 使用 supercluster R-tree 空间索引,O(log n) 查询
|
|
2200
|
+
* 2. 仅在 zoom 变化时重新聚合(平移时 Marker 组件通过 camerachange 自行更新 DOM 位置)
|
|
2201
|
+
* 3. 点击聚合使用 getClusterExpansionZoom 精确缩放
|
|
2202
|
+
* 4. SpiderLine 使用 ref + 直接 DOM 操作,避免 setState 重渲染
|
|
2203
|
+
*
|
|
2204
|
+
* 设计规范:Cartographic Precision System v1.2.0
|
|
2205
|
+
* - 视觉分级:小规模(2-99)、中规模(100-999)、大规模(1000+)
|
|
2206
|
+
* - 交互:悬停放大(scale-110)、点击缩放、最大级别蜘蛛布局展开
|
|
2207
|
+
*/
|
|
2208
|
+
export declare function MarkerClusterLayer({ source, sourceType, sourceConfig, gridSize, minClusterSize, animationDuration, easing, onPointClick, onClusterClick, }: MarkerClusterLayerProps): JSX_2.Element;
|
|
2209
|
+
|
|
2210
|
+
export declare interface MarkerClusterLayerProps {
|
|
2211
|
+
source: LayerSchema['source'];
|
|
2212
|
+
sourceType?: LayerSchema['sourceType'];
|
|
2213
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
2214
|
+
/** 聚合半径(像素),对应 supercluster 的 radius 参数 */
|
|
2215
|
+
gridSize?: number;
|
|
2216
|
+
/** 形成聚合的最小点数 */
|
|
2217
|
+
minClusterSize?: number;
|
|
2218
|
+
animationDuration?: number;
|
|
2219
|
+
easing?: string;
|
|
2220
|
+
onPointClick?: (point: ClusterPoint) => void;
|
|
2221
|
+
/**
|
|
2222
|
+
* 聚合点点击回调
|
|
2223
|
+
* @param cluster 聚合信息
|
|
2224
|
+
* @param leaves 聚合包含的所有原始要素(Supercluster 叶子节点)
|
|
2225
|
+
*/
|
|
2226
|
+
onClusterClick?: (cluster: ClusterItem, leaves?: any[]) => void;
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
/**
|
|
2230
|
+
* Marker 语义颜色
|
|
2231
|
+
* - primary: 信息/默认 (#2563EB)
|
|
2232
|
+
* - success: 完成/安全 (#00854D)
|
|
2233
|
+
* - warning: 预警/高负载 (#943700)
|
|
2234
|
+
* - error: 故障/危险 (#BA1A1A)
|
|
2235
|
+
*/
|
|
2236
|
+
export declare type MarkerColor = 'primary' | 'success' | 'warning' | 'error';
|
|
2237
|
+
|
|
2238
|
+
export declare interface MarkerProps extends Omit<MarkerSchema, 'type' | 'content'> {
|
|
2239
|
+
/** Marker 形态,默认 pin */
|
|
2240
|
+
variant?: MarkerVariant;
|
|
2241
|
+
/** 语义颜色,默认 primary */
|
|
2242
|
+
color?: MarkerColor;
|
|
2243
|
+
/** Material Symbols 图标名 (仅 variant='icon' 时生效) */
|
|
2244
|
+
icon?: string;
|
|
2245
|
+
/** 文本标注,显示在 Marker 下方 4px */
|
|
2246
|
+
label?: string;
|
|
2247
|
+
/** 自定义内容,优先级高于 variant/color/icon/label */
|
|
2248
|
+
content?: default_2.ReactNode | string;
|
|
2249
|
+
/** 子元素,作为自定义内容渲染 */
|
|
2250
|
+
children?: default_2.ReactNode;
|
|
2251
|
+
className?: string;
|
|
2252
|
+
overlayContainer?: HTMLElement | null;
|
|
2253
|
+
onClick?: (e: default_2.MouseEvent) => void;
|
|
2254
|
+
onMouseEnter?: (e: default_2.MouseEvent) => void;
|
|
2255
|
+
onMouseLeave?: (e: default_2.MouseEvent) => void;
|
|
2256
|
+
onDoubleClick?: (e: default_2.MouseEvent) => void;
|
|
2257
|
+
onDragEnd?: (lng: number, lat: number) => void;
|
|
2258
|
+
onDragging?: (lng: number, lat: number) => void;
|
|
2259
|
+
onDragStart?: (lng: number, lat: number) => void;
|
|
2260
|
+
/** 选中状态 */
|
|
2261
|
+
selected?: boolean;
|
|
2262
|
+
/** 禁用/离线状态 */
|
|
2263
|
+
inactive?: boolean;
|
|
2264
|
+
anchor?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
2265
|
+
offsets?: [number, number];
|
|
2266
|
+
overflowHide?: boolean;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
export declare interface MarkerSchema {
|
|
2270
|
+
type: 'marker';
|
|
2271
|
+
longitude: number;
|
|
2272
|
+
latitude: number;
|
|
2273
|
+
/** 标注内容,支持纯文本 / HTML 字符串 */
|
|
2274
|
+
content?: string;
|
|
2275
|
+
draggable?: boolean;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* Marker 基础形态
|
|
2280
|
+
* - pin: 水滴型 (32x40px),默认业务点,用于 POI、站点、静态设施
|
|
2281
|
+
* - circle: 圆型 (24x24px),移动/轻量点,用于实时车辆、传感器
|
|
2282
|
+
* - icon: 图标型,在 Pin 内嵌入 Material Symbols 图标
|
|
2283
|
+
* - dot: 简化点 (8px),低缩放级降级形态
|
|
2284
|
+
*/
|
|
2285
|
+
export declare type MarkerVariant = 'pin' | 'circle' | 'icon' | 'dot';
|
|
2286
|
+
|
|
2287
|
+
export declare interface MobileConfig {
|
|
2288
|
+
controls?: MobileControlConfig;
|
|
2289
|
+
layers?: MobileLayerOverrides | {
|
|
2290
|
+
'*': Partial<LayerSchema>;
|
|
2291
|
+
};
|
|
2292
|
+
legends?: MobileLegendConfig;
|
|
2293
|
+
toolbar?: MobileToolbarConfig;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
export declare interface MobileControlConfig {
|
|
2297
|
+
position?: string;
|
|
2298
|
+
scale?: number;
|
|
2299
|
+
hide?: string[];
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
export declare interface MobileLayerOverrides {
|
|
2303
|
+
[id: string]: Partial<LayerSchema>;
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
export declare interface MobileLegendConfig {
|
|
2307
|
+
compact?: boolean;
|
|
2308
|
+
position?: string;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
/**
|
|
2312
|
+
* 移动端底部弹出式图例
|
|
2313
|
+
*
|
|
2314
|
+
* 功能:
|
|
2315
|
+
* - 玻璃拟态面板
|
|
2316
|
+
* - 点击标题栏展开/收起
|
|
2317
|
+
* - 展开时 max-h-[65vh],收起时 max-h-14
|
|
2318
|
+
* - 支持所有图例类型
|
|
2319
|
+
*/
|
|
2320
|
+
export declare function MobileSheetLegend({ legends, className, interaction, }: MobileSheetLegendProps): JSX_2.Element | null;
|
|
2321
|
+
|
|
2322
|
+
declare interface MobileSheetLegendProps {
|
|
2323
|
+
legends: LegendSchema[];
|
|
2324
|
+
className?: string;
|
|
2325
|
+
interaction?: LegendInteractionCallbacks;
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
/**
|
|
2329
|
+
* 移动端底部工具栏
|
|
2330
|
+
*/
|
|
2331
|
+
export declare function MobileToolbar({ config, className }: MobileToolbarProps): JSX_2.Element;
|
|
2332
|
+
|
|
2333
|
+
export declare interface MobileToolbarConfig {
|
|
2334
|
+
items: string[];
|
|
2335
|
+
position: 'bottom' | 'top';
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
declare interface MobileToolbarProps {
|
|
2339
|
+
config: MobileToolbarConfig;
|
|
2340
|
+
className?: string;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
export declare function MouseLocationControl({ position, precision, transform, className, style, }: MouseLocationControlProps): JSX_2.Element;
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* MouseLocation 鼠标坐标控件
|
|
2347
|
+
*
|
|
2348
|
+
* 遵循 L7 的 Control 规范 + Material Design 3 玻璃态风格:
|
|
2349
|
+
* - CSS 类名: .l7-control .l7-control-mouse-location
|
|
2350
|
+
* - 玻璃态: glass-effect + inverse-surface 背景
|
|
2351
|
+
* - 位置默认: bottomleft
|
|
2352
|
+
* - API: mapsService.on('mousemove', handler), e.lngLat || e.lnglat
|
|
2353
|
+
* - transform 回调支持坐标转换
|
|
2354
|
+
* - 直接操作 DOM innerText,与 L7 一致
|
|
2355
|
+
*/
|
|
2356
|
+
export declare interface MouseLocationControlProps {
|
|
2357
|
+
/** 控件位置,默认 bottomleft */
|
|
2358
|
+
position?: L7ControlPosition;
|
|
2359
|
+
/** 精度(小数位数),默认 6 */
|
|
2360
|
+
precision?: number;
|
|
2361
|
+
/** 坐标转换函数,设置后 precision 无效 */
|
|
2362
|
+
transform?: (position: [number, number]) => [number, number];
|
|
2363
|
+
className?: string;
|
|
2364
|
+
style?: default_2.CSSProperties;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
/**
|
|
2368
|
+
* Mapbox / Maplibre 主题预设 — 基于 openfreemap 样式
|
|
2369
|
+
*/
|
|
2370
|
+
export declare const OPENFREEMAP_THEME_PRESETS: ThemeOption[];
|
|
2371
|
+
|
|
2372
|
+
/**
|
|
2373
|
+
* 解析并规范化 Schema,填充默认值
|
|
2374
|
+
*/
|
|
2375
|
+
export declare function parseSchema(schema: AiMapSchema): AiMapSchema;
|
|
2376
|
+
|
|
2377
|
+
/**
|
|
2378
|
+
* 点图层组件
|
|
2379
|
+
*
|
|
2380
|
+
* ```tsx
|
|
2381
|
+
* <AiMap map={{ basemap: 'gaode' }}>
|
|
2382
|
+
* <PointLayer source={data} color="#5B8FF9" size={12} />
|
|
2383
|
+
* </AiMap>
|
|
2384
|
+
* ```
|
|
2385
|
+
*/
|
|
2386
|
+
export declare function PointLayer({ source, sourceType, sourceConfig, onClick, onMouseMove, onMouseEnter, onMouseLeave, ...rest }: PointLayerProps): JSX_2.Element | null;
|
|
2387
|
+
|
|
2388
|
+
export declare interface PointLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
2389
|
+
/** 数据源 — JSON 数组、GeoJSON 或 URL */
|
|
2390
|
+
source: LayerSchema['source'];
|
|
2391
|
+
/** 数据源类型,默认 'json' */
|
|
2392
|
+
sourceType?: LayerSchema['sourceType'];
|
|
2393
|
+
/** 经纬度字段配置 */
|
|
2394
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
2395
|
+
/** 点击事件 */
|
|
2396
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
2397
|
+
/** 鼠标移动事件 */
|
|
2398
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
2399
|
+
/** 鼠标进入事件 */
|
|
2400
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
2401
|
+
/** 鼠标离开事件 */
|
|
2402
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
/**
|
|
2406
|
+
* 面图层组件
|
|
2407
|
+
*/
|
|
2408
|
+
export declare function PolygonLayer({ source, sourceType, sourceConfig, onClick, onMouseMove, onMouseEnter, onMouseLeave, ...rest }: PolygonLayerProps): JSX_2.Element | null;
|
|
2409
|
+
|
|
2410
|
+
export declare interface PolygonLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
2411
|
+
source: LayerSchema['source'];
|
|
2412
|
+
sourceType?: LayerSchema['sourceType'];
|
|
2413
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
2414
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
2415
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
2416
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
2417
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
export declare function Popup({ longitude, latitude, content, closeButton, size, placement: placementProp, offset, header, attributes, actions, visible: visibleProp, singleton, overlayContainer, onClose, className, }: PopupProps): default_2.ReactPortal | null;
|
|
2421
|
+
|
|
2422
|
+
/**
|
|
2423
|
+
* Popup 操作按钮
|
|
2424
|
+
*/
|
|
2425
|
+
export declare interface PopupAction {
|
|
2426
|
+
/** 按钮文字 */
|
|
2427
|
+
label: string;
|
|
2428
|
+
/** 按钮类型:primary 主按钮 / secondary 次要按钮 */
|
|
2429
|
+
variant?: 'primary' | 'secondary';
|
|
2430
|
+
/** 点击回调 */
|
|
2431
|
+
onClick?: () => void;
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
/**
|
|
2435
|
+
* Popup 属性项
|
|
2436
|
+
*/
|
|
2437
|
+
export declare interface PopupAttribute {
|
|
2438
|
+
/** 属性标签 */
|
|
2439
|
+
label: string;
|
|
2440
|
+
/** 属性值 */
|
|
2441
|
+
value: string | number;
|
|
2442
|
+
/** 值颜色(可选,默认使用 on-surface) */
|
|
2443
|
+
valueColor?: string;
|
|
2444
|
+
/** Material Symbols 图标名(仅 detailed 模式渲染图标容器) */
|
|
2445
|
+
icon?: string;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
/**
|
|
2449
|
+
* Popup 标题栏配置
|
|
2450
|
+
*/
|
|
2451
|
+
export declare interface PopupHeader {
|
|
2452
|
+
/** 标题文字 */
|
|
2453
|
+
title: string;
|
|
2454
|
+
/** 封面图 URL(可选,显示在顶部 aspect-video 比例) */
|
|
2455
|
+
coverUrl?: string;
|
|
2456
|
+
/** 状态标签(可选,显示在封面图左下角) */
|
|
2457
|
+
statusLabel?: string;
|
|
2458
|
+
/** 状态颜色(可选,默认 emerald-500) */
|
|
2459
|
+
statusColor?: string;
|
|
2460
|
+
/** 标题前的状态点颜色(可选,compact 模式标题前脉冲指示灯) */
|
|
2461
|
+
statusDot?: string;
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
/**
|
|
2465
|
+
* 弹出框相对于锚点的位置
|
|
2466
|
+
* - auto: 根据视口边界自动选择(默认)
|
|
2467
|
+
* - top: 始终在锚点上方
|
|
2468
|
+
* - bottom: 始终在锚点下方
|
|
2469
|
+
* - left: 始终在锚点左侧
|
|
2470
|
+
* - right: 始终在锚点右侧
|
|
2471
|
+
*/
|
|
2472
|
+
export declare type PopupPlacement = 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
2473
|
+
|
|
2474
|
+
export declare interface PopupProps extends Omit<PopupSchema, 'type' | 'content'> {
|
|
2475
|
+
/** 弹窗内容,支持纯文本 / HTML 字符串 / ReactNode。当使用 header/attributes/actions 结构化模式时可省略 */
|
|
2476
|
+
content?: string | default_2.ReactNode;
|
|
2477
|
+
/** 尺寸变体,默认 standard */
|
|
2478
|
+
size?: PopupSize;
|
|
2479
|
+
/** 弹出位置,默认 auto(自动根据视口边界选择) */
|
|
2480
|
+
placement?: PopupPlacement;
|
|
2481
|
+
/** 弹出框偏移量(像素),默认 8px,正数远离锚点 */
|
|
2482
|
+
offset?: number;
|
|
2483
|
+
/** 结构化标题栏(可选,传入后覆盖简单内容模式) */
|
|
2484
|
+
header?: PopupHeader;
|
|
2485
|
+
/** 属性列表(可选,"标签-值"对齐模式) */
|
|
2486
|
+
attributes?: PopupAttribute[];
|
|
2487
|
+
/** 底部操作按钮(可选) */
|
|
2488
|
+
actions?: PopupAction[];
|
|
2489
|
+
/** 受控可见性:传入时由外部控制显隐;不传或 undefined 时组件内部管理 */
|
|
2490
|
+
visible?: boolean;
|
|
2491
|
+
/** 是否启用互斥模式(默认 false)。启用后同一时间仅显示一个 Popup */
|
|
2492
|
+
singleton?: boolean;
|
|
2493
|
+
overlayContainer?: HTMLElement | null;
|
|
2494
|
+
onClose?: () => void;
|
|
2495
|
+
className?: string;
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
export declare interface PopupSchema {
|
|
2499
|
+
type: 'popup';
|
|
2500
|
+
longitude: number;
|
|
2501
|
+
latitude: number;
|
|
2502
|
+
/** 弹窗内容,支持纯文本 / HTML 字符串 */
|
|
2503
|
+
content: string;
|
|
2504
|
+
closeButton?: boolean;
|
|
2505
|
+
/** 尺寸变体 */
|
|
2506
|
+
size?: 'compact' | 'standard' | 'detailed';
|
|
2507
|
+
/** 弹出位置,默认 auto */
|
|
2508
|
+
placement?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
2509
|
+
/** 弹出框偏移量(像素),默认 8 */
|
|
2510
|
+
offset?: number;
|
|
2511
|
+
/** 是否启用互斥模式 */
|
|
2512
|
+
singleton?: boolean;
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
/**
|
|
2516
|
+
* Popup 尺寸变体
|
|
2517
|
+
* - compact: 宽度 240px,适用于简单文字标注
|
|
2518
|
+
* - standard: 宽度 320px,适用于 POI 简介等通用场景
|
|
2519
|
+
* - detailed: 宽度 480px,适用于统计图表或详细参数对比
|
|
2520
|
+
*/
|
|
2521
|
+
export declare type PopupSize = 'compact' | 'standard' | 'detailed';
|
|
2522
|
+
|
|
2523
|
+
declare type PositionCallback_2 = (x: number, y: number) => void;
|
|
2524
|
+
|
|
2525
|
+
/**
|
|
2526
|
+
* 色带配置
|
|
2527
|
+
*/
|
|
2528
|
+
export declare interface RampColors {
|
|
2529
|
+
/** 插值类型 */
|
|
2530
|
+
type?: 'linear' | 'quantize' | 'custom';
|
|
2531
|
+
/** 色值数组 */
|
|
2532
|
+
colors: string[];
|
|
2533
|
+
/** 对应位置(与 domain 对齐) */
|
|
2534
|
+
positions?: number[];
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
/**
|
|
2538
|
+
* 栅格图层组件
|
|
2539
|
+
*/
|
|
2540
|
+
export declare function RasterLayer({ source, sourceType, sourceConfig, onClick, ...rest }: RasterLayerProps): JSX_2.Element | null;
|
|
2541
|
+
|
|
2542
|
+
export declare interface RasterLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
2543
|
+
source: LayerSchema['source'];
|
|
2544
|
+
sourceType?: LayerSchema['sourceType'];
|
|
2545
|
+
sourceConfig?: LayerSchema['sourceConfig'];
|
|
2546
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
/**
|
|
2550
|
+
* 渲染模式
|
|
2551
|
+
* - raster: 单波段伪彩色(默认)
|
|
2552
|
+
* - rgb: 多波段真彩色/假彩色合成
|
|
2553
|
+
* - ndi: 归一化差异指数(如 NDVI、NDBI、NDWI)
|
|
2554
|
+
*/
|
|
2555
|
+
export declare type RasterRenderMode = 'raster' | 'rgb' | 'ndi';
|
|
2556
|
+
|
|
2557
|
+
declare type ResolvedMapSchema = MapSchema & {
|
|
2558
|
+
basemap: NonNullable<MapSchema['basemap']>;
|
|
2559
|
+
center: NonNullable<MapSchema['center']>;
|
|
2560
|
+
zoom: NonNullable<MapSchema['zoom']>;
|
|
2561
|
+
pitch: NonNullable<MapSchema['pitch']>;
|
|
2562
|
+
rotation: NonNullable<MapSchema['rotation']>;
|
|
2563
|
+
};
|
|
2564
|
+
|
|
2565
|
+
declare interface ResponsiveContextValue {
|
|
2566
|
+
isMobile: boolean;
|
|
2567
|
+
breakpoint: number;
|
|
2568
|
+
width: number;
|
|
2569
|
+
schema: ResponsiveSchema | undefined;
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
export declare function ResponsiveProvider({ responsive, children }: ResponsiveProviderProps): JSX_2.Element;
|
|
2573
|
+
|
|
2574
|
+
declare interface ResponsiveProviderProps {
|
|
2575
|
+
responsive?: ResponsiveSchema;
|
|
2576
|
+
children: default_2.ReactNode;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
export declare interface ResponsiveSchema {
|
|
2580
|
+
breakpoint?: number;
|
|
2581
|
+
mobile?: MobileConfig;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* 路径地图复合图层 (Route Map)
|
|
2586
|
+
*
|
|
2587
|
+
* 遵循设计规范:
|
|
2588
|
+
* - 序列化途经点 (Numbered Stops)
|
|
2589
|
+
* - 路径发光效果
|
|
2590
|
+
* - 分段着色(路况/属性)
|
|
2591
|
+
* - 流动动画
|
|
2592
|
+
*
|
|
2593
|
+
* @example
|
|
2594
|
+
* ```tsx
|
|
2595
|
+
* <RouteLayer
|
|
2596
|
+
* path={[[120.15, 30.28], [120.17, 30.25], ...]}
|
|
2597
|
+
* stops={[
|
|
2598
|
+
* { lng: 120.15, lat: 30.28, name: '西湖' },
|
|
2599
|
+
* { lng: 120.17, lat: 30.25, name: '灵隐寺' },
|
|
2600
|
+
* ]}
|
|
2601
|
+
* animate
|
|
2602
|
+
* glow
|
|
2603
|
+
* />
|
|
2604
|
+
* ```
|
|
2605
|
+
*/
|
|
2606
|
+
export declare function RouteLayer({ path, segments, stops, color, lineWidth, opacity, glow, animate, animateSpeed, stopSize, stopColor, endColor, showStopIndex, activeColor, onPathClick, onStopClick, }: RouteLayerProps): JSX_2.Element | null;
|
|
2607
|
+
|
|
2608
|
+
export declare interface RouteLayerProps {
|
|
2609
|
+
/** 路径坐标 — 完整线坐标或分段 */
|
|
2610
|
+
path?: [number, number][];
|
|
2611
|
+
/** 分段路径(优先级高于 path) */
|
|
2612
|
+
segments?: RouteSegment[];
|
|
2613
|
+
/** 途经点列表 */
|
|
2614
|
+
stops?: RouteStop[];
|
|
2615
|
+
/** 路径颜色,默认 '#2563eb' */
|
|
2616
|
+
color?: string;
|
|
2617
|
+
/** 路径宽度,默认 4 */
|
|
2618
|
+
lineWidth?: number;
|
|
2619
|
+
/** 路径透明度,默认 0.9 */
|
|
2620
|
+
opacity?: number;
|
|
2621
|
+
/** 是否显示发光效果,默认 true */
|
|
2622
|
+
glow?: boolean;
|
|
2623
|
+
/** 是否启用流动动画,默认 false */
|
|
2624
|
+
animate?: boolean;
|
|
2625
|
+
/** 动画速度,默认 1 */
|
|
2626
|
+
animateSpeed?: number;
|
|
2627
|
+
/** 途经点大小,默认 14 */
|
|
2628
|
+
stopSize?: number;
|
|
2629
|
+
/** 途经点颜色(默认跟随路径色) */
|
|
2630
|
+
stopColor?: string;
|
|
2631
|
+
/** 终点颜色,默认 '#10b981' */
|
|
2632
|
+
endColor?: string;
|
|
2633
|
+
/** 是否显示途经点序号,默认 true */
|
|
2634
|
+
showStopIndex?: boolean;
|
|
2635
|
+
/** hover 高亮色 */
|
|
2636
|
+
activeColor?: string;
|
|
2637
|
+
/** 路径点击 */
|
|
2638
|
+
onPathClick?: (payload: LayerEventPayload) => void;
|
|
2639
|
+
/** 途经点点击 */
|
|
2640
|
+
onStopClick?: (payload: LayerEventPayload) => void;
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
/**
|
|
2644
|
+
* 路径分段数据
|
|
2645
|
+
*/
|
|
2646
|
+
export declare interface RouteSegment {
|
|
2647
|
+
/** 坐标序列 [[lng, lat], [lng, lat], ...] */
|
|
2648
|
+
coordinates: [number, number][];
|
|
2649
|
+
/** 分段颜色(如路况着色) */
|
|
2650
|
+
color?: string;
|
|
2651
|
+
/** 分段宽度 */
|
|
2652
|
+
width?: number;
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
/**
|
|
2656
|
+
* 途经点数据
|
|
2657
|
+
*/
|
|
2658
|
+
export declare interface RouteStop {
|
|
2659
|
+
/** 经度 */
|
|
2660
|
+
lng: number;
|
|
2661
|
+
/** 纬度 */
|
|
2662
|
+
lat: number;
|
|
2663
|
+
/** 名称 */
|
|
2664
|
+
name: string;
|
|
2665
|
+
/** 序号(自动生成,也可手动指定) */
|
|
2666
|
+
index?: number;
|
|
2667
|
+
/** 类型:start / end / waypoint */
|
|
2668
|
+
type?: 'start' | 'end' | 'waypoint';
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
/** 提供商显示名称 */
|
|
2672
|
+
export declare const SATELLITE_PROVIDER_NAMES: Record<SatelliteProvider, string>;
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* 卫星影像图层 — 复合组件
|
|
2676
|
+
*
|
|
2677
|
+
* 支持高德、天地图、谷歌三种卫星影像切换,默认高德。
|
|
2678
|
+
*
|
|
2679
|
+
* ```tsx
|
|
2680
|
+
* <AiMap map={{ basemap: 'map', center: [116.39, 39.9], zoom: 10 }}>
|
|
2681
|
+
* <SatelliteLayer provider="gaode" />
|
|
2682
|
+
* </AiMap>
|
|
2683
|
+
* ```
|
|
2684
|
+
*/
|
|
2685
|
+
export declare function SatelliteLayer({ provider, zIndex, opacity, tiandituToken, visible, }: SatelliteLayerProps): JSX_2.Element | null;
|
|
2686
|
+
|
|
2687
|
+
/** 卫星影像图层配置 */
|
|
2688
|
+
export declare interface SatelliteLayerProps {
|
|
2689
|
+
/** 影像提供商,默认 'gaode' */
|
|
2690
|
+
provider?: SatelliteProvider;
|
|
2691
|
+
/** 图层层级,默认 0(底层) */
|
|
2692
|
+
zIndex?: number;
|
|
2693
|
+
/** 图层透明度 0~1,默认 1 */
|
|
2694
|
+
opacity?: number;
|
|
2695
|
+
/** 天地图 token(仅 tianditu 需要,有内置默认值) */
|
|
2696
|
+
tiandituToken?: string;
|
|
2697
|
+
/** 图层可见性,默认 true */
|
|
2698
|
+
visible?: boolean;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
/** 卫星影像数据源类型 */
|
|
2702
|
+
export declare type SatelliteProvider = 'gaode' | 'tianditu' | 'google';
|
|
2703
|
+
|
|
2704
|
+
export declare function ScaleControl({ position, maxWidth, metric, imperial, updateWhenIdle, className, style, }: ScaleControlProps): JSX_2.Element;
|
|
2705
|
+
|
|
2706
|
+
/**
|
|
2707
|
+
* Scale 比例尺控件
|
|
2708
|
+
*
|
|
2709
|
+
* 遵循 L7 的 Control 规范 + Material Design 3 玻璃态风格:
|
|
2710
|
+
* - CSS 类名: .l7-control .l7-control-scale
|
|
2711
|
+
* - 玻璃态: glass-effect + surface/90 背景
|
|
2712
|
+
* - 位置默认: bottomleft
|
|
2713
|
+
* - API: mapsService.containerToLngLat() + lnglatDistance() 算法
|
|
2714
|
+
* - 事件: mapsService.on('mapmove') / mapsService.on('zoomchange')
|
|
2715
|
+
*/
|
|
2716
|
+
export declare interface ScaleControlProps {
|
|
2717
|
+
/** 控件位置,默认 bottomleft */
|
|
2718
|
+
position?: L7ControlPosition;
|
|
2719
|
+
/** 比例尺最大像素宽度,默认 100 */
|
|
2720
|
+
maxWidth?: number;
|
|
2721
|
+
/** 是否显示公制单位,默认 true */
|
|
2722
|
+
metric?: boolean;
|
|
2723
|
+
/** 是否显示英制单位,默认 false */
|
|
2724
|
+
imperial?: boolean;
|
|
2725
|
+
/** 是否在地图移动结束后才更新,默认 false(实时更新) */
|
|
2726
|
+
updateWhenIdle?: boolean;
|
|
2727
|
+
className?: string;
|
|
2728
|
+
style?: default_2.CSSProperties;
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
export declare function SceneProvider({ scene, children }: SceneProviderProps): JSX_2.Element;
|
|
2732
|
+
|
|
2733
|
+
declare interface SceneProviderProps {
|
|
2734
|
+
scene: Scene | null;
|
|
2735
|
+
children: default_2.ReactNode;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
/**
|
|
2739
|
+
* Schema diff 结果
|
|
2740
|
+
*/
|
|
2741
|
+
export declare interface SchemaDiffResult {
|
|
2742
|
+
mapChanged: boolean;
|
|
2743
|
+
layersAdded: LayerSchema[];
|
|
2744
|
+
layersRemoved: string[];
|
|
2745
|
+
layersUpdated: {
|
|
2746
|
+
id: string;
|
|
2747
|
+
prev: LayerSchema;
|
|
2748
|
+
next: LayerSchema;
|
|
2749
|
+
}[];
|
|
2750
|
+
controlsAdded: ControlSchema[];
|
|
2751
|
+
controlsRemoved: ControlSchema[];
|
|
2752
|
+
controlsUpdated: {
|
|
2753
|
+
index: number;
|
|
2754
|
+
prev: ControlSchema;
|
|
2755
|
+
next: ControlSchema;
|
|
2756
|
+
}[];
|
|
2757
|
+
interactionsChanged: boolean;
|
|
2758
|
+
legendsChanged: boolean;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
export declare function SchemaProvider({ schema, children }: SchemaProviderProps): JSX_2.Element;
|
|
2762
|
+
|
|
2763
|
+
declare interface SchemaProviderProps {
|
|
2764
|
+
schema: AiMapSchema;
|
|
2765
|
+
children: default_2.ReactNode;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
export declare interface ScreenPosition {
|
|
2769
|
+
x: number;
|
|
2770
|
+
y: number;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
/**
|
|
2774
|
+
* 移动端浮动搜索框组件
|
|
2775
|
+
*
|
|
2776
|
+
* Material Design 3 毛玻璃风格,固定在顶部
|
|
2777
|
+
*
|
|
2778
|
+
* ```tsx
|
|
2779
|
+
* <SearchBar placeholder="搜索地点..." onSearch={(v) => console.log(v)} />
|
|
2780
|
+
* ```
|
|
2781
|
+
*/
|
|
2782
|
+
export declare function SearchBar({ placeholder, onSearch, onFilter, className, trailing, }: SearchBarProps): JSX_2.Element;
|
|
2783
|
+
|
|
2784
|
+
export declare interface SearchBarProps {
|
|
2785
|
+
/** 占位文本 */
|
|
2786
|
+
placeholder?: string;
|
|
2787
|
+
/** 搜索值变化回调 */
|
|
2788
|
+
onSearch?: (value: string) => void;
|
|
2789
|
+
/** 筛选按钮点击回调 */
|
|
2790
|
+
onFilter?: () => void;
|
|
2791
|
+
/** 自定义样式类名 */
|
|
2792
|
+
className?: string;
|
|
2793
|
+
/** 右侧自定义操作区域 */
|
|
2794
|
+
trailing?: default_2.ReactNode;
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
export declare type SelectConfig = boolean | {
|
|
2798
|
+
color: string;
|
|
2799
|
+
};
|
|
2800
|
+
|
|
2801
|
+
declare interface ShapeConfig {
|
|
2802
|
+
field?: string;
|
|
2803
|
+
values?: string[] | string;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
declare interface SizeConfig {
|
|
2807
|
+
field?: string;
|
|
2808
|
+
values?: number[] | number;
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
export declare interface SourceConfig {
|
|
2812
|
+
x?: string;
|
|
2813
|
+
y?: string;
|
|
2814
|
+
x1?: string;
|
|
2815
|
+
y1?: string;
|
|
2816
|
+
coordinates?: string;
|
|
2817
|
+
parser?: Record<string, unknown>;
|
|
2818
|
+
transforms?: Array<Record<string, unknown>>;
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
declare interface SourceOutput {
|
|
2822
|
+
data: unknown;
|
|
2823
|
+
options?: Record<string, unknown>;
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
export declare type SourceType = 'geojson' | 'json' | 'csv' | 'raster' | 'rasterTile' | 'image';
|
|
2827
|
+
|
|
2828
|
+
declare interface ThemeContextValue {
|
|
2829
|
+
/** 当前解析后的实际主题(light 或 dark) */
|
|
2830
|
+
resolvedTheme: 'light' | 'dark';
|
|
2831
|
+
/** 用户设置的主题偏好 */
|
|
2832
|
+
theme: MapTheme;
|
|
2833
|
+
/** 设置主题 */
|
|
2834
|
+
setTheme: (theme: MapTheme) => void;
|
|
2835
|
+
/** 切换亮/暗 */
|
|
2836
|
+
toggleTheme: () => void;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
/**
|
|
2840
|
+
* 地图主题选项 — 支持预览色块
|
|
2841
|
+
*/
|
|
2842
|
+
export declare interface ThemeOption {
|
|
2843
|
+
/** 主题显示名称 */
|
|
2844
|
+
text: string;
|
|
2845
|
+
/** 主题值(传给 mapsService.setMapStyle) */
|
|
2846
|
+
value: string;
|
|
2847
|
+
/** 主题预览色块,支持 CSS 渐变 */
|
|
2848
|
+
preview?: string;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
/**
|
|
2852
|
+
* 地图主题 Provider
|
|
2853
|
+
*
|
|
2854
|
+
* 通过 CSS 变量 + data-theme 属性实现亮/暗主题切换。
|
|
2855
|
+
* - `light`: 亮色主题(默认)
|
|
2856
|
+
* - `dark`: 暗色主题
|
|
2857
|
+
* - `system`: 跟随系统 prefers-color-scheme
|
|
2858
|
+
*/
|
|
2859
|
+
export declare function ThemeProvider({ defaultTheme, target, children, }: ThemeProviderProps): JSX_2.Element;
|
|
2860
|
+
|
|
2861
|
+
export declare interface ThemeProviderProps {
|
|
2862
|
+
/** 默认主题,默认 'light' */
|
|
2863
|
+
defaultTheme?: MapTheme;
|
|
2864
|
+
/** 挂载 data-theme 属性的目标元素选择器,默认挂载到最近的 .aimapui-container 或 :root */
|
|
2865
|
+
target?: 'root' | 'container';
|
|
2866
|
+
children: default_2.ReactNode;
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
/**
|
|
2870
|
+
* GeoTIFF 栅格复合图层
|
|
2871
|
+
*
|
|
2872
|
+
* 内置 GeoTIFF 解析能力,支持两种渲染模式:
|
|
2873
|
+
* - raster: 单波段伪彩色映射(NDVI、DEM、夜光等)
|
|
2874
|
+
* - rgb: 多波段真彩色/假彩色合成(卫星影像)
|
|
2875
|
+
*
|
|
2876
|
+
* 遵循设计规范:
|
|
2877
|
+
* - 伪彩色映射(自定义色带)
|
|
2878
|
+
* - 多波段 RGB 合成
|
|
2879
|
+
* - WebGL 加速渲染
|
|
2880
|
+
* - NoData 透明化
|
|
2881
|
+
* - 可选地理遮罩
|
|
2882
|
+
*
|
|
2883
|
+
* @example 单波段伪彩色
|
|
2884
|
+
* ```tsx
|
|
2885
|
+
* <TiffRasterLayer
|
|
2886
|
+
* url="https://example.com/ndvi.tif"
|
|
2887
|
+
* renderMode="raster"
|
|
2888
|
+
* domain={[0, 0.8]}
|
|
2889
|
+
* rampColors={{ colors: ['#78350f', '#059669'], positions: [0, 0.8] }}
|
|
2890
|
+
* />
|
|
2891
|
+
* ```
|
|
2892
|
+
*
|
|
2893
|
+
* @example 多波段 RGB 合成
|
|
2894
|
+
* ```tsx
|
|
2895
|
+
* <TiffRasterLayer
|
|
2896
|
+
* url="https://example.com/china.tif"
|
|
2897
|
+
* renderMode="rgb"
|
|
2898
|
+
* bands={[0, 1, 2]}
|
|
2899
|
+
* mask
|
|
2900
|
+
* maskData="https://example.com/china-boundary.json"
|
|
2901
|
+
* />
|
|
2902
|
+
* ```
|
|
2903
|
+
*/
|
|
2904
|
+
export declare function TiffRasterLayer({ url, extent, renderMode, bandIndex, domain, noDataValue, rampColors, clampLow, clampHigh, bands, countCut, rMinMax, gMinMax, bMinMax, opacity, mask, maskData, }: TiffRasterLayerProps): null;
|
|
2905
|
+
|
|
2906
|
+
export declare interface TiffRasterLayerProps {
|
|
2907
|
+
/** TIFF 文件 URL */
|
|
2908
|
+
url: string;
|
|
2909
|
+
/** 地理范围 [minLng, minLat, maxLng, maxLat] */
|
|
2910
|
+
extent?: [number, number, number, number];
|
|
2911
|
+
/** 渲染模式,默认 'raster'(单波段伪彩色) */
|
|
2912
|
+
renderMode?: RasterRenderMode;
|
|
2913
|
+
/** 波段索引,默认 0 */
|
|
2914
|
+
bandIndex?: number;
|
|
2915
|
+
/** 数据值域 [min, max],用于色带映射 */
|
|
2916
|
+
domain?: [number, number];
|
|
2917
|
+
/** 无数据值,默认 0 */
|
|
2918
|
+
noDataValue?: number;
|
|
2919
|
+
/** 色带配置 */
|
|
2920
|
+
rampColors?: RampColors;
|
|
2921
|
+
/** 低值截断,默认 false */
|
|
2922
|
+
clampLow?: boolean;
|
|
2923
|
+
/** 高值截断,默认 false */
|
|
2924
|
+
clampHigh?: boolean;
|
|
2925
|
+
/** RGB 波段索引 [R, G, B],默认 [0, 1, 2] */
|
|
2926
|
+
bands?: [number, number] | [number, number, number];
|
|
2927
|
+
/** RGB 模式:百分位裁剪 [low, high],默认 [2, 98]。设为 [0, 100] 可跳过裁剪 */
|
|
2928
|
+
countCut?: [number, number];
|
|
2929
|
+
/** RGB 模式:R 通道值域 [min, max],传入后跳过 percentile 计算(避免大数据栈溢出) */
|
|
2930
|
+
rMinMax?: [number, number];
|
|
2931
|
+
/** RGB 模式:G 通道值域 [min, max] */
|
|
2932
|
+
gMinMax?: [number, number];
|
|
2933
|
+
/** RGB 模式:B 通道值域 [min, max] */
|
|
2934
|
+
bMinMax?: [number, number];
|
|
2935
|
+
/** 不透明度,默认 0.8 */
|
|
2936
|
+
opacity?: number;
|
|
2937
|
+
/** 遮罩 GeoJSON URL 或对象 */
|
|
2938
|
+
maskData?: string | Record<string, unknown>;
|
|
2939
|
+
/** 是否启用遮罩,默认 false */
|
|
2940
|
+
mask?: boolean;
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
export declare function Tooltip({ content, variant, longitude, latitude, targetElement, placement, offset, trigger, visible: visibleProp, title, items, overlayContainer, className, }: TooltipProps): default_2.ReactPortal | null;
|
|
2944
|
+
|
|
2945
|
+
/**
|
|
2946
|
+
* Tooltip 键值对数据项
|
|
2947
|
+
*/
|
|
2948
|
+
export declare interface TooltipItem {
|
|
2949
|
+
/** 标签 */
|
|
2950
|
+
label: string;
|
|
2951
|
+
/** 值 */
|
|
2952
|
+
value: string | number;
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
/** Tooltip 方向 */
|
|
2956
|
+
export declare type TooltipPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
2957
|
+
|
|
2958
|
+
export declare interface TooltipProps {
|
|
2959
|
+
/** 内容:纯文本 / ReactNode。优先级高于 title/items */
|
|
2960
|
+
content?: string | default_2.ReactNode;
|
|
2961
|
+
/** 视觉变体,默认 dark */
|
|
2962
|
+
variant?: TooltipVariant;
|
|
2963
|
+
/** 经度(地图定位模式) */
|
|
2964
|
+
longitude?: number;
|
|
2965
|
+
/** 纬度(地图定位模式) */
|
|
2966
|
+
latitude?: number;
|
|
2967
|
+
/** 目标 DOM 元素 */
|
|
2968
|
+
targetElement?: HTMLElement | null;
|
|
2969
|
+
/** 方向,默认 top */
|
|
2970
|
+
placement?: TooltipPlacement;
|
|
2971
|
+
/** 偏移距离,默认 8px */
|
|
2972
|
+
offset?: number;
|
|
2973
|
+
/** 触发方式,默认 hover */
|
|
2974
|
+
trigger?: 'hover' | 'click';
|
|
2975
|
+
/** 受控可见性 */
|
|
2976
|
+
visible?: boolean;
|
|
2977
|
+
/** 结构化标题 */
|
|
2978
|
+
title?: string;
|
|
2979
|
+
/** 结构化键值对列表 */
|
|
2980
|
+
items?: TooltipItem[];
|
|
2981
|
+
/** Overlay 容器 */
|
|
2982
|
+
overlayContainer?: HTMLElement | null;
|
|
2983
|
+
/** 自定义类名 */
|
|
2984
|
+
className?: string;
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
export declare interface TooltipSchema {
|
|
2988
|
+
type: 'tooltip';
|
|
2989
|
+
content: string;
|
|
2990
|
+
trigger?: 'hover' | 'click';
|
|
2991
|
+
/** 视觉变体 */
|
|
2992
|
+
variant?: 'dark' | 'glass' | 'light';
|
|
2993
|
+
/** 经度(地图定位模式) */
|
|
2994
|
+
longitude?: number;
|
|
2995
|
+
/** 纬度(地图定位模式) */
|
|
2996
|
+
latitude?: number;
|
|
2997
|
+
/** 方向 */
|
|
2998
|
+
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
2999
|
+
/** 偏移距离 */
|
|
3000
|
+
offset?: number;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
/**
|
|
3004
|
+
* Tooltip 视觉变体
|
|
3005
|
+
* - dark: 深色高对比度(默认),适用于卫星图/亮色底图
|
|
3006
|
+
* - glass: 玻璃拟态毛玻璃,适用于简洁数据地图
|
|
3007
|
+
* - light: 浅色背景,适用于深色底图
|
|
3008
|
+
*/
|
|
3009
|
+
export declare type TooltipVariant = 'dark' | 'glass' | 'light';
|
|
3010
|
+
|
|
3011
|
+
export declare function useControlContainer(): boolean;
|
|
3012
|
+
|
|
3013
|
+
export declare function useEventBus(): EventBus;
|
|
3014
|
+
|
|
3015
|
+
/**
|
|
3016
|
+
* Hook: 提供 mapsService 访问 + 控件位置计算
|
|
3017
|
+
*
|
|
3018
|
+
* 遵循 L7 的 Control 规范:
|
|
3019
|
+
* - 通过 mapsService 获取地图服务实例
|
|
3020
|
+
* - 通过 scene 获取场景实例
|
|
3021
|
+
* - 提供 position → 定位 CSS 类名的映射
|
|
3022
|
+
*/
|
|
3023
|
+
export declare function useMapControl(position?: L7ControlPosition): {
|
|
3024
|
+
scene: Scene | null;
|
|
3025
|
+
mapsService: any;
|
|
3026
|
+
getMapContainer: () => any;
|
|
3027
|
+
positionClassName: string;
|
|
3028
|
+
};
|
|
3029
|
+
|
|
3030
|
+
/**
|
|
3031
|
+
* 高性能地图位置同步 Hook
|
|
3032
|
+
*
|
|
3033
|
+
* 参考 L7 Marker/Popup 的直接 DOM 操作方式:
|
|
3034
|
+
* - 不使用 setState 避免渲染延迟
|
|
3035
|
+
* - 通过回调函数直接更新 DOM style
|
|
3036
|
+
* - 使用 mapsService 事件监听地图变化
|
|
3037
|
+
* - RAF 节流合并高频更新
|
|
3038
|
+
*
|
|
3039
|
+
* 用法:
|
|
3040
|
+
* ```tsx
|
|
3041
|
+
* const ref = useRef<HTMLDivElement>(null);
|
|
3042
|
+
* useMapPosition(scene, lng, lat, (x, y) => {
|
|
3043
|
+
* if (ref.current) {
|
|
3044
|
+
* ref.current.style.left = x + 'px';
|
|
3045
|
+
* ref.current.style.top = y + 'px';
|
|
3046
|
+
* }
|
|
3047
|
+
* });
|
|
3048
|
+
* ```
|
|
3049
|
+
*/
|
|
3050
|
+
export declare function useMapPosition(scene: Scene | null, longitude: number, latitude: number, onPositionUpdate: PositionCallback_2): void;
|
|
3051
|
+
|
|
3052
|
+
export declare function useResponsive(): ResponsiveContextValue;
|
|
3053
|
+
|
|
3054
|
+
export declare function useScene(): Scene | null;
|
|
3055
|
+
|
|
3056
|
+
export declare function useSchema(): AiMapSchema | null;
|
|
3057
|
+
|
|
3058
|
+
/**
|
|
3059
|
+
* 获取当前主题信息
|
|
3060
|
+
*/
|
|
3061
|
+
export declare function useTheme(): ThemeContextValue;
|
|
3062
|
+
|
|
3063
|
+
export declare function validateAiMapSchema(schema: AiMapSchema): ValidationError[];
|
|
3064
|
+
|
|
3065
|
+
/**
|
|
3066
|
+
* 验证整个 Schema
|
|
3067
|
+
*/
|
|
3068
|
+
export declare function validateSchema(schema: AiMapSchema): {
|
|
3069
|
+
valid: boolean;
|
|
3070
|
+
errors: string[];
|
|
3071
|
+
};
|
|
3072
|
+
|
|
3073
|
+
/**
|
|
3074
|
+
* Schema 校验器
|
|
3075
|
+
* 提供友好的错误消息,帮助 AI 修正 Schema
|
|
3076
|
+
*/
|
|
3077
|
+
export declare interface ValidationError {
|
|
3078
|
+
path: string;
|
|
3079
|
+
message: string;
|
|
3080
|
+
severity: 'error' | 'warning';
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
declare interface VisualConfig {
|
|
3084
|
+
color?: ColorConfig;
|
|
3085
|
+
size?: SizeConfig;
|
|
3086
|
+
shape?: ShapeConfig;
|
|
3087
|
+
style?: Record<string, unknown>;
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
export declare function ZoomControl({ position, zoomInText, zoomInTitle, zoomOutText, zoomOutTitle, showZoom, className, style, }: ZoomControlProps): JSX_2.Element;
|
|
3091
|
+
|
|
3092
|
+
/**
|
|
3093
|
+
* Zoom 控件
|
|
3094
|
+
*
|
|
3095
|
+
* 遵循 L7 的 Control 规范 + Material Design 3 玻璃态风格:
|
|
3096
|
+
* - CSS 类名: .l7-control .l7-control-zoom
|
|
3097
|
+
* - 按钮: .l7-button-control
|
|
3098
|
+
* - 玻璃态: glass-effect + surface/90 背景
|
|
3099
|
+
* - 位置默认: bottomright
|
|
3100
|
+
* - API: mapsService.zoomIn() / zoomOut() / getZoom() / getMinZoom() / getMaxZoom()
|
|
3101
|
+
* - 事件: mapsService.on('zoomend', 'zoomchange')
|
|
3102
|
+
*/
|
|
3103
|
+
export declare interface ZoomControlProps {
|
|
3104
|
+
/** 控件位置,默认 bottomright */
|
|
3105
|
+
position?: L7ControlPosition;
|
|
3106
|
+
/** 缩放按钮图标/文本,默认使用 Material Symbols Outlined */
|
|
3107
|
+
zoomInText?: default_2.ReactNode;
|
|
3108
|
+
zoomInTitle?: string;
|
|
3109
|
+
zoomOutText?: default_2.ReactNode;
|
|
3110
|
+
zoomOutTitle?: string;
|
|
3111
|
+
/** 是否显示当前缩放级别数字 */
|
|
3112
|
+
showZoom?: boolean;
|
|
3113
|
+
className?: string;
|
|
3114
|
+
style?: default_2.CSSProperties;
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
export { }
|