expo-gaode-map-navigation 1.1.5 → 1.1.6
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/README.md +213 -73
- package/android/build.gradle +10 -0
- package/android/src/main/cpp/CMakeLists.txt +24 -0
- package/android/src/main/cpp/cluster_jni.cpp +848 -0
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapModule.kt +616 -92
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapOfflineModule.kt +493 -0
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapView.kt +230 -14
- package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapViewModule.kt +37 -27
- package/android/src/main/java/expo/modules/gaodemap/map/MapPreloadManager.kt +494 -0
- package/android/src/main/java/expo/modules/gaodemap/map/companion/BitmapDescriptorCache.kt +30 -0
- package/android/src/main/java/expo/modules/gaodemap/map/companion/IconBitmapCache.kt +37 -0
- package/android/src/main/java/expo/modules/gaodemap/map/managers/UIManager.kt +76 -0
- package/android/src/main/java/expo/modules/gaodemap/map/modules/LocationManager.kt +15 -3
- package/android/src/main/java/expo/modules/gaodemap/map/modules/SDKInitializer.kt +4 -59
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/CircleView.kt +9 -12
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/CircleViewModule.kt +5 -6
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/ClusterView.kt +539 -66
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/ClusterViewModule.kt +17 -1
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/HeatMapView.kt +165 -33
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/HeatMapViewModule.kt +15 -3
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MarkerView.kt +1249 -672
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MarkerViewModule.kt +40 -17
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MultiPointView.kt +177 -22
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/MultiPointViewModule.kt +11 -3
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolygonView.kt +57 -14
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolygonViewModule.kt +9 -5
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolylineView.kt +90 -63
- package/android/src/main/java/expo/modules/gaodemap/map/overlays/PolylineViewModule.kt +7 -3
- package/android/src/main/java/expo/modules/gaodemap/map/services/LocationForegroundService.kt +3 -2
- package/android/src/main/java/expo/modules/gaodemap/map/utils/BitmapDescriptorCache.kt +20 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/ClusterNative.kt +13 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/ColorParser.kt +20 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/GeometryUtils.kt +515 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/LatLngParser.kt +91 -0
- package/android/src/main/java/expo/modules/gaodemap/map/utils/PermissionHelper.kt +248 -0
- package/build/ExpoGaodeMapNaviView.d.ts +7 -7
- package/build/ExpoGaodeMapNaviView.js +10 -11
- package/build/ExpoGaodeMapNavigationModule.d.ts +2 -1
- package/build/index.d.ts +35 -33
- package/build/index.js +70 -106
- package/build/map/ExpoGaodeMapModule.d.ts +2 -201
- package/build/map/ExpoGaodeMapModule.js +586 -18
- package/build/map/ExpoGaodeMapOfflineModule.d.ts +139 -0
- package/build/map/ExpoGaodeMapOfflineModule.js +8 -0
- package/build/map/ExpoGaodeMapView.js +66 -58
- package/build/map/components/FoldableMapView.d.ts +38 -0
- package/build/map/components/FoldableMapView.js +209 -0
- package/build/map/components/MapContext.d.ts +12 -0
- package/build/map/components/MapContext.js +54 -0
- package/build/map/components/MapUI.d.ts +18 -0
- package/build/map/components/MapUI.js +29 -0
- package/build/map/components/overlays/Circle.js +34 -3
- package/build/map/components/overlays/Cluster.d.ts +3 -1
- package/build/map/components/overlays/Cluster.js +31 -2
- package/build/map/components/overlays/HeatMap.d.ts +3 -1
- package/build/map/components/overlays/HeatMap.js +33 -3
- package/build/map/components/overlays/Marker.d.ts +1 -1
- package/build/map/components/overlays/Marker.js +37 -32
- package/build/map/components/overlays/MultiPoint.js +1 -1
- package/build/map/components/overlays/Polygon.js +30 -3
- package/build/map/components/overlays/Polyline.js +36 -3
- package/build/map/index.d.ts +25 -5
- package/build/map/index.js +59 -18
- package/build/map/types/common.types.d.ts +40 -0
- package/build/map/types/common.types.js +0 -4
- package/build/map/types/index.d.ts +3 -2
- package/build/map/types/map-view.types.d.ts +108 -3
- package/build/map/types/native-module.types.d.ts +363 -0
- package/build/map/types/native-module.types.js +5 -0
- package/build/map/types/offline.types.d.ts +132 -0
- package/build/map/types/offline.types.js +5 -0
- package/build/map/types/overlays.types.d.ts +137 -24
- package/build/map/utils/ErrorHandler.d.ts +110 -0
- package/build/map/utils/ErrorHandler.js +421 -0
- package/build/map/utils/GeoUtils.d.ts +20 -0
- package/build/map/utils/GeoUtils.js +76 -0
- package/build/map/utils/OfflineMapManager.d.ts +148 -0
- package/build/map/utils/OfflineMapManager.js +217 -0
- package/build/map/utils/PermissionUtils.d.ts +91 -0
- package/build/map/utils/PermissionUtils.js +255 -0
- package/build/map/utils/PlatformDetector.d.ts +102 -0
- package/build/map/utils/PlatformDetector.js +186 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +1 -0
- package/build/types/native-module.types.d.ts +69 -0
- package/build/types/native-module.types.js +2 -0
- package/build/types/naviview.types.d.ts +1 -1
- package/expo-module.config.json +12 -10
- package/ios/ExpoGaodeMapNavigation.podspec +9 -0
- package/ios/map/ExpoGaodeMapModule.swift +485 -75
- package/ios/map/ExpoGaodeMapOfflineModule.swift +479 -0
- package/ios/map/ExpoGaodeMapView.swift +611 -62
- package/ios/map/ExpoGaodeMapViewModule.swift +48 -26
- package/ios/map/MapPreloadManager.swift +348 -0
- package/ios/map/cpp/ClusterEngine.cpp +110 -0
- package/ios/map/cpp/ClusterEngine.hpp +20 -0
- package/ios/map/cpp/ColorParser.cpp +135 -0
- package/ios/map/cpp/ColorParser.hpp +14 -0
- package/ios/map/cpp/GeometryEngine.cpp +574 -0
- package/ios/map/cpp/GeometryEngine.hpp +159 -0
- package/ios/map/cpp/QuadTree.cpp +92 -0
- package/ios/map/cpp/QuadTree.hpp +42 -0
- package/ios/map/cpp/README.md +55 -0
- package/ios/map/managers/UIManager.swift +72 -1
- package/ios/map/modules/LocationManager.swift +123 -166
- package/ios/map/overlays/CircleView.swift +16 -32
- package/ios/map/overlays/CircleViewModule.swift +12 -12
- package/ios/map/overlays/ClusterAnnotation.swift +32 -0
- package/ios/map/overlays/ClusterView.swift +331 -45
- package/ios/map/overlays/ClusterViewModule.swift +20 -6
- package/ios/map/overlays/HeatMapView.swift +135 -32
- package/ios/map/overlays/HeatMapViewModule.swift +20 -8
- package/ios/map/overlays/MarkerView.swift +613 -130
- package/ios/map/overlays/MarkerViewModule.swift +38 -18
- package/ios/map/overlays/MultiPointView.swift +168 -10
- package/ios/map/overlays/MultiPointViewModule.swift +27 -5
- package/ios/map/overlays/PolygonView.swift +62 -23
- package/ios/map/overlays/PolygonViewModule.swift +18 -12
- package/ios/map/overlays/PolylineView.swift +21 -13
- package/ios/map/overlays/PolylineViewModule.swift +18 -12
- package/ios/map/utils/ClusterNative.h +96 -0
- package/ios/map/utils/ClusterNative.mm +377 -0
- package/ios/map/utils/ColorParser.swift +12 -1
- package/ios/map/utils/CppBridging.mm +13 -0
- package/ios/map/utils/GeometryUtils.swift +34 -0
- package/ios/map/utils/LatLngParser.swift +87 -0
- package/ios/map/utils/PermissionManager.swift +135 -6
- package/package.json +3 -2
- package/shared/cpp/ClusterEngine.cpp +110 -0
- package/shared/cpp/ClusterEngine.hpp +20 -0
- package/shared/cpp/ColorParser.cpp +135 -0
- package/shared/cpp/ColorParser.hpp +14 -0
- package/shared/cpp/GeometryEngine.cpp +574 -0
- package/shared/cpp/GeometryEngine.hpp +159 -0
- package/shared/cpp/QuadTree.cpp +92 -0
- package/shared/cpp/QuadTree.hpp +42 -0
- package/shared/cpp/README.md +55 -0
- package/shared/cpp/tests/benchmark_js.js +41 -0
- package/shared/cpp/tests/run.sh +17 -0
- package/shared/cpp/tests/test_main.cpp +276 -0
- package/build/map/ExpoGaodeMap.types.d.ts +0 -41
- package/build/map/ExpoGaodeMap.types.js +0 -24
- package/build/map/utils/EventManager.d.ts +0 -10
- package/build/map/utils/EventManager.js +0 -26
- package/build/map/utils/ModuleLoader.d.ts +0 -73
- package/build/map/utils/ModuleLoader.js +0 -112
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
* 高德地图覆盖物相关类型定义
|
|
3
3
|
* 基于 Expo Modules API
|
|
4
4
|
*/
|
|
5
|
-
import type { ImageSourcePropType, ViewStyle, NativeSyntheticEvent } from 'react-native';
|
|
6
|
-
import type { ColorValue, LatLng, Point } from './common.types';
|
|
5
|
+
import type { ImageSourcePropType, ViewStyle, NativeSyntheticEvent, TextStyle } from 'react-native';
|
|
6
|
+
import type { ColorValue, LatLng, LatLngPoint, Point } from './common.types';
|
|
7
7
|
/**
|
|
8
8
|
* 标记点属性
|
|
9
9
|
*/
|
|
10
10
|
export interface MarkerProps {
|
|
11
11
|
/**
|
|
12
12
|
* 坐标
|
|
13
|
+
* 支持对象 {latitude, longitude} 或数组 [longitude, latitude]
|
|
13
14
|
*/
|
|
14
|
-
position:
|
|
15
|
+
position: LatLngPoint;
|
|
15
16
|
/**
|
|
16
17
|
* 图标
|
|
17
18
|
*/
|
|
@@ -42,6 +43,7 @@ export interface MarkerProps {
|
|
|
42
43
|
opacity?: number;
|
|
43
44
|
/**
|
|
44
45
|
* 是否可拖拽
|
|
46
|
+
* @default false
|
|
45
47
|
*/
|
|
46
48
|
draggable?: boolean;
|
|
47
49
|
/**
|
|
@@ -94,6 +96,15 @@ export interface MarkerProps {
|
|
|
94
96
|
* @default 30
|
|
95
97
|
*/
|
|
96
98
|
customViewHeight?: number;
|
|
99
|
+
/**
|
|
100
|
+
* 缓存 key 建议使用 提高性能
|
|
101
|
+
*/
|
|
102
|
+
cacheKey?: string;
|
|
103
|
+
/**
|
|
104
|
+
* 是否开启生长动画
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
growAnimation?: boolean;
|
|
97
108
|
/**
|
|
98
109
|
* 点击事件
|
|
99
110
|
*/
|
|
@@ -110,6 +121,16 @@ export interface MarkerProps {
|
|
|
110
121
|
* 拖拽结束事件
|
|
111
122
|
*/
|
|
112
123
|
onMarkerDragEnd?: (event: NativeSyntheticEvent<LatLng>) => void;
|
|
124
|
+
/**
|
|
125
|
+
* 平滑移动轨迹点数组
|
|
126
|
+
* 设置后,Marker 会沿着轨迹平滑移动
|
|
127
|
+
*/
|
|
128
|
+
smoothMovePath?: LatLng[];
|
|
129
|
+
/**
|
|
130
|
+
* 平滑移动总时长(秒)
|
|
131
|
+
* @default 10
|
|
132
|
+
*/
|
|
133
|
+
smoothMoveDuration?: number;
|
|
113
134
|
}
|
|
114
135
|
/**
|
|
115
136
|
* 折线属性
|
|
@@ -117,8 +138,9 @@ export interface MarkerProps {
|
|
|
117
138
|
export interface PolylineProps {
|
|
118
139
|
/**
|
|
119
140
|
* 节点坐标数组
|
|
141
|
+
* 支持对象 {latitude, longitude} 或数组 [longitude, latitude]
|
|
120
142
|
*/
|
|
121
|
-
points:
|
|
143
|
+
points: LatLngPoint[];
|
|
122
144
|
/**
|
|
123
145
|
* 线宽
|
|
124
146
|
*/
|
|
@@ -147,6 +169,12 @@ export interface PolylineProps {
|
|
|
147
169
|
* @note iOS 不支持
|
|
148
170
|
*/
|
|
149
171
|
geodesic?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* 轨迹抽稀容差(米)
|
|
174
|
+
* 设置大于 0 的值时启用 RDP 算法简化轨迹点
|
|
175
|
+
* 建议值为 1.0 - 5.0,值越大简化程度越高
|
|
176
|
+
*/
|
|
177
|
+
simplificationTolerance?: number;
|
|
150
178
|
/**
|
|
151
179
|
* 是否绘制虚线
|
|
152
180
|
* @platform android
|
|
@@ -169,8 +197,11 @@ export interface PolylineProps {
|
|
|
169
197
|
export interface PolygonProps {
|
|
170
198
|
/**
|
|
171
199
|
* 节点坐标数组
|
|
200
|
+
* 支持对象 {latitude, longitude} 或数组 [longitude, latitude]
|
|
201
|
+
* 同时也支持嵌套数组格式 [[p1, p2, ...], [p3, p4, ...]],用于定义带孔的多边形
|
|
202
|
+
* 其中第一个数组为外轮廓,后续数组为内孔
|
|
172
203
|
*/
|
|
173
|
-
points:
|
|
204
|
+
points: LatLngPoint[] | LatLngPoint[][];
|
|
174
205
|
/**
|
|
175
206
|
* 边线宽度
|
|
176
207
|
*/
|
|
@@ -191,6 +222,19 @@ export interface PolygonProps {
|
|
|
191
222
|
* 点击事件
|
|
192
223
|
*/
|
|
193
224
|
onPolygonPress?: (event: NativeSyntheticEvent<{}>) => void;
|
|
225
|
+
/**
|
|
226
|
+
* 轨迹抽稀容差(米)
|
|
227
|
+
* 设置大于 0 的值时启用 RDP 算法简化多边形边界
|
|
228
|
+
* 建议值为 1.0 - 5.0,值越大简化程度越高
|
|
229
|
+
*/
|
|
230
|
+
simplificationTolerance?: number;
|
|
231
|
+
/**
|
|
232
|
+
* 简化完成事件
|
|
233
|
+
*/
|
|
234
|
+
onPolygonSimplified?: (event: NativeSyntheticEvent<{
|
|
235
|
+
originalCount: number;
|
|
236
|
+
simplifiedCount: number;
|
|
237
|
+
}>) => void;
|
|
194
238
|
}
|
|
195
239
|
/**
|
|
196
240
|
* 圆形属性
|
|
@@ -198,8 +242,9 @@ export interface PolygonProps {
|
|
|
198
242
|
export interface CircleProps {
|
|
199
243
|
/**
|
|
200
244
|
* 圆心坐标
|
|
245
|
+
* 支持对象 {latitude, longitude} 或数组 [longitude, latitude]
|
|
201
246
|
*/
|
|
202
|
-
center:
|
|
247
|
+
center: LatLngPoint;
|
|
203
248
|
/**
|
|
204
249
|
* 半径(米)
|
|
205
250
|
*/
|
|
@@ -225,14 +270,34 @@ export interface CircleProps {
|
|
|
225
270
|
*/
|
|
226
271
|
onCirclePress?: (event: NativeSyntheticEvent<{}>) => void;
|
|
227
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* 热力图渐变配置
|
|
275
|
+
*/
|
|
276
|
+
export interface HeatMapGradient {
|
|
277
|
+
/**
|
|
278
|
+
* 颜色数组
|
|
279
|
+
* 支持 '#RRGGBB', 'rgba()', 'red' 等
|
|
280
|
+
*/
|
|
281
|
+
colors: ColorValue[];
|
|
282
|
+
/**
|
|
283
|
+
* 颜色起始点数组 [0-1]
|
|
284
|
+
* 必须递增,例如 [0.2, 0.5, 0.9]
|
|
285
|
+
*/
|
|
286
|
+
startPoints: number[];
|
|
287
|
+
}
|
|
228
288
|
/**
|
|
229
289
|
* 热力图属性
|
|
230
290
|
*/
|
|
231
291
|
export interface HeatMapProps {
|
|
232
292
|
/**
|
|
233
293
|
* 热力点数据
|
|
294
|
+
* 支持对象 {latitude, longitude} 或数组 [longitude, latitude]
|
|
295
|
+
*/
|
|
296
|
+
data: LatLngPoint[];
|
|
297
|
+
/**
|
|
298
|
+
* 是否显示热力图(用于避免频繁卸载/重建导致卡顿)
|
|
234
299
|
*/
|
|
235
|
-
|
|
300
|
+
visible?: boolean;
|
|
236
301
|
/**
|
|
237
302
|
* 热力半径(米)
|
|
238
303
|
*/
|
|
@@ -241,6 +306,15 @@ export interface HeatMapProps {
|
|
|
241
306
|
* 透明度 [0, 1]
|
|
242
307
|
*/
|
|
243
308
|
opacity?: number;
|
|
309
|
+
/**
|
|
310
|
+
* 热力图渐变配置
|
|
311
|
+
*/
|
|
312
|
+
gradient?: HeatMapGradient;
|
|
313
|
+
/**
|
|
314
|
+
* 是否开启高清热力图(Retina适配)
|
|
315
|
+
* @platform ios
|
|
316
|
+
*/
|
|
317
|
+
allowRetinaAdapting?: boolean;
|
|
244
318
|
}
|
|
245
319
|
/**
|
|
246
320
|
* 海量点标记项
|
|
@@ -253,7 +327,7 @@ export interface MultiPointItem extends LatLng {
|
|
|
253
327
|
/**
|
|
254
328
|
* 自定义数据
|
|
255
329
|
*/
|
|
256
|
-
data?:
|
|
330
|
+
data?: unknown;
|
|
257
331
|
}
|
|
258
332
|
/**
|
|
259
333
|
* 海量点属性
|
|
@@ -262,15 +336,23 @@ export interface MultiPointProps {
|
|
|
262
336
|
/**
|
|
263
337
|
* 点集合
|
|
264
338
|
*/
|
|
265
|
-
|
|
339
|
+
points: MultiPointItem[];
|
|
266
340
|
/**
|
|
267
341
|
* 图标
|
|
268
342
|
*/
|
|
269
|
-
icon?: ImageSourcePropType;
|
|
343
|
+
icon?: string | ImageSourcePropType;
|
|
344
|
+
/**
|
|
345
|
+
* 图标宽度
|
|
346
|
+
*/
|
|
347
|
+
iconWidth?: number;
|
|
348
|
+
/**
|
|
349
|
+
* 图标高度
|
|
350
|
+
*/
|
|
351
|
+
iconHeight?: number;
|
|
270
352
|
/**
|
|
271
353
|
* 点击事件
|
|
272
354
|
*/
|
|
273
|
-
|
|
355
|
+
onMultiPointPress?: (event: NativeSyntheticEvent<{
|
|
274
356
|
index: number;
|
|
275
357
|
item: MultiPointItem;
|
|
276
358
|
}>) => void;
|
|
@@ -279,31 +361,51 @@ export interface MultiPointProps {
|
|
|
279
361
|
* 聚合点参数
|
|
280
362
|
*/
|
|
281
363
|
export interface ClusterParams {
|
|
282
|
-
/**
|
|
283
|
-
* 唯一标识
|
|
284
|
-
*/
|
|
285
|
-
id: number;
|
|
286
364
|
/**
|
|
287
365
|
* 包含的标记点数量
|
|
288
366
|
*/
|
|
289
367
|
count: number;
|
|
290
368
|
/**
|
|
291
|
-
*
|
|
369
|
+
* 纬度
|
|
370
|
+
*/
|
|
371
|
+
latitude: number;
|
|
372
|
+
/**
|
|
373
|
+
* 经度
|
|
374
|
+
*/
|
|
375
|
+
longitude: number;
|
|
376
|
+
/**
|
|
377
|
+
* 包含的点数据列表
|
|
378
|
+
*/
|
|
379
|
+
pois?: ClusterPoint[];
|
|
380
|
+
/**
|
|
381
|
+
* 唯一标识 (兼容性保留)
|
|
292
382
|
*/
|
|
293
|
-
|
|
383
|
+
id?: number;
|
|
384
|
+
/**
|
|
385
|
+
* 聚合点坐标 (兼容性保留)
|
|
386
|
+
*/
|
|
387
|
+
position?: LatLng;
|
|
294
388
|
}
|
|
295
389
|
/**
|
|
296
390
|
* 聚合点项
|
|
297
391
|
*/
|
|
298
392
|
export interface ClusterPoint {
|
|
299
393
|
/**
|
|
300
|
-
*
|
|
394
|
+
* 纬度(原生 Cluster 使用)
|
|
395
|
+
*/
|
|
396
|
+
latitude?: number;
|
|
397
|
+
/**
|
|
398
|
+
* 经度(原生 Cluster 使用)
|
|
399
|
+
*/
|
|
400
|
+
longitude?: number;
|
|
401
|
+
/**
|
|
402
|
+
* 坐标(JS ClusterLayer 使用)
|
|
301
403
|
*/
|
|
302
|
-
position
|
|
404
|
+
position?: LatLngPoint;
|
|
303
405
|
/**
|
|
304
406
|
* 自定义数据
|
|
305
407
|
*/
|
|
306
|
-
properties?:
|
|
408
|
+
properties?: Record<string, unknown>;
|
|
307
409
|
}
|
|
308
410
|
/**
|
|
309
411
|
* 聚合图层属性
|
|
@@ -313,24 +415,35 @@ export interface ClusterProps {
|
|
|
313
415
|
* 聚合半径
|
|
314
416
|
*/
|
|
315
417
|
radius?: number;
|
|
418
|
+
/**
|
|
419
|
+
* 最小聚合数量
|
|
420
|
+
*/
|
|
421
|
+
minClusterSize?: number;
|
|
316
422
|
/**
|
|
317
423
|
* 聚合点样式
|
|
318
424
|
*/
|
|
319
425
|
clusterStyle?: ViewStyle;
|
|
426
|
+
/**
|
|
427
|
+
* 分级聚合样式配置
|
|
428
|
+
* 根据聚合数量动态设置样式
|
|
429
|
+
*/
|
|
430
|
+
clusterBuckets?: ({
|
|
431
|
+
minPoints: number;
|
|
432
|
+
} & ViewStyle)[];
|
|
320
433
|
/**
|
|
321
434
|
* 聚合点文本样式
|
|
322
435
|
*/
|
|
323
|
-
clusterTextStyle?:
|
|
436
|
+
clusterTextStyle?: TextStyle;
|
|
324
437
|
/**
|
|
325
438
|
* 坐标点列表
|
|
326
439
|
*/
|
|
327
440
|
points: ClusterPoint[];
|
|
328
441
|
/**
|
|
329
|
-
*
|
|
442
|
+
* 暂未实现,请勿使用
|
|
330
443
|
*/
|
|
331
|
-
renderMarker
|
|
444
|
+
renderMarker?: (item: ClusterPoint) => React.ReactNode;
|
|
332
445
|
/**
|
|
333
|
-
*
|
|
446
|
+
* 暂未实现,请勿使用
|
|
334
447
|
*/
|
|
335
448
|
renderCluster?: (params: ClusterParams) => React.ReactNode;
|
|
336
449
|
/**
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图错误处理工具
|
|
3
|
+
* 提供友好的错误提示和解决方案指引
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 错误类型枚举
|
|
7
|
+
*/
|
|
8
|
+
export declare enum ErrorType {
|
|
9
|
+
/** SDK 未初始化 */
|
|
10
|
+
SDK_NOT_INITIALIZED = "SDK_NOT_INITIALIZED",
|
|
11
|
+
/** API Key 配置错误 */
|
|
12
|
+
INVALID_API_KEY = "INVALID_API_KEY",
|
|
13
|
+
/** 权限未授予 */
|
|
14
|
+
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
15
|
+
/** 定位失败 */
|
|
16
|
+
LOCATION_FAILED = "LOCATION_FAILED",
|
|
17
|
+
/** 原生模块不可用 */
|
|
18
|
+
NATIVE_MODULE_UNAVAILABLE = "NATIVE_MODULE_UNAVAILABLE",
|
|
19
|
+
/** 地图视图未初始化 */
|
|
20
|
+
MAP_VIEW_NOT_INITIALIZED = "MAP_VIEW_NOT_INITIALIZED",
|
|
21
|
+
/** 参数错误 */
|
|
22
|
+
INVALID_PARAMETER = "INVALID_PARAMETER",
|
|
23
|
+
/** 网络错误 */
|
|
24
|
+
NETWORK_ERROR = "NETWORK_ERROR"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 错误详情接口
|
|
28
|
+
*/
|
|
29
|
+
export interface ErrorDetails {
|
|
30
|
+
/** 错误类型 */
|
|
31
|
+
type: ErrorType;
|
|
32
|
+
/** 错误消息 */
|
|
33
|
+
message: string;
|
|
34
|
+
/** 解决方案 */
|
|
35
|
+
solution: string;
|
|
36
|
+
/** 文档链接 */
|
|
37
|
+
docUrl?: string;
|
|
38
|
+
/** 原始错误 */
|
|
39
|
+
originalError?: Error;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 自定义错误类
|
|
43
|
+
*/
|
|
44
|
+
export declare class GaodeMapError extends Error {
|
|
45
|
+
type: ErrorType;
|
|
46
|
+
solution: string;
|
|
47
|
+
docUrl?: string;
|
|
48
|
+
originalError?: Error;
|
|
49
|
+
constructor(details: ErrorDetails);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 错误处理器类
|
|
53
|
+
*/
|
|
54
|
+
export declare class ErrorHandler {
|
|
55
|
+
private static docBaseUrl;
|
|
56
|
+
/**
|
|
57
|
+
* SDK 未初始化错误
|
|
58
|
+
*/
|
|
59
|
+
static sdkNotInitialized(): GaodeMapError;
|
|
60
|
+
/**
|
|
61
|
+
* API Key 配置错误
|
|
62
|
+
*/
|
|
63
|
+
static invalidApiKey(platform: 'android' | 'ios' | 'both'): GaodeMapError;
|
|
64
|
+
/**
|
|
65
|
+
* 权限未授予错误
|
|
66
|
+
*/
|
|
67
|
+
static permissionDenied(permissionType: 'location'): GaodeMapError;
|
|
68
|
+
/**
|
|
69
|
+
* 定位失败错误
|
|
70
|
+
*/
|
|
71
|
+
static locationFailed(reason?: string): GaodeMapError;
|
|
72
|
+
/**
|
|
73
|
+
* 原生模块不可用错误
|
|
74
|
+
*/
|
|
75
|
+
static nativeModuleUnavailable(): GaodeMapError;
|
|
76
|
+
/**
|
|
77
|
+
* 地图视图未初始化错误
|
|
78
|
+
*/
|
|
79
|
+
static mapViewNotInitialized(methodName: string): GaodeMapError;
|
|
80
|
+
/**
|
|
81
|
+
* 参数错误
|
|
82
|
+
*/
|
|
83
|
+
static invalidParameter(paramName: string, expected: string, received: unknown): GaodeMapError;
|
|
84
|
+
/**
|
|
85
|
+
* 网络错误
|
|
86
|
+
*/
|
|
87
|
+
static networkError(originalError?: Error): GaodeMapError;
|
|
88
|
+
/**
|
|
89
|
+
* 包装原生错误,提供更友好的提示
|
|
90
|
+
*/
|
|
91
|
+
static wrapNativeError(error: unknown, context: string): GaodeMapError;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 错误日志工具
|
|
95
|
+
*/
|
|
96
|
+
export declare class ErrorLogger {
|
|
97
|
+
private static isEnabled;
|
|
98
|
+
/**
|
|
99
|
+
* 启用/禁用错误日志
|
|
100
|
+
*/
|
|
101
|
+
static setEnabled(enabled: boolean): void;
|
|
102
|
+
/**
|
|
103
|
+
* 记录错误
|
|
104
|
+
*/
|
|
105
|
+
static log(error: GaodeMapError): void;
|
|
106
|
+
/**
|
|
107
|
+
* 记录警告
|
|
108
|
+
*/
|
|
109
|
+
static warn(message: string, details?: unknown): void;
|
|
110
|
+
}
|