expo-gaode-map-navigation 1.0.1-next.0 → 1.0.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +117 -28
  2. package/android/src/main/java/expo/modules/gaodemap/map/ExpoGaodeMapModule.kt +7 -0
  3. package/android/src/main/java/expo/modules/gaodemap/map/modules/SDKInitializer.kt +38 -3
  4. package/build/map/ExpoGaodeMapModule.js +5 -5
  5. package/ios/map/ExpoGaodeMapModule.swift +22 -6
  6. package/package.json +13 -6
  7. package/package.json.backup +0 -47
  8. package/plugin/README.md +0 -52
  9. package/plugin/build/withGaodeMap.d.ts +0 -22
  10. package/plugin/build/withGaodeMap.js +0 -169
  11. package/plugin/src/withGaodeMap.ts +0 -231
  12. package/plugin/tsconfig.tsbuildinfo +0 -1
  13. package/src/ExpoGaodeMapNaviView.tsx +0 -94
  14. package/src/ExpoGaodeMapNavigation.types.ts +0 -3
  15. package/src/ExpoGaodeMapNavigationModule.ts +0 -11
  16. package/src/index.ts +0 -262
  17. package/src/map/ExpoGaodeMap.types.ts +0 -46
  18. package/src/map/ExpoGaodeMapModule.ts +0 -315
  19. package/src/map/ExpoGaodeMapView.tsx +0 -120
  20. package/src/map/components/overlays/Circle.tsx +0 -20
  21. package/src/map/components/overlays/Cluster.tsx +0 -26
  22. package/src/map/components/overlays/HeatMap.tsx +0 -27
  23. package/src/map/components/overlays/Marker.tsx +0 -88
  24. package/src/map/components/overlays/MultiPoint.tsx +0 -27
  25. package/src/map/components/overlays/Polygon.tsx +0 -19
  26. package/src/map/components/overlays/Polyline.tsx +0 -19
  27. package/src/map/components/overlays/index.ts +0 -7
  28. package/src/map/index.ts +0 -37
  29. package/src/map/types/common.types.ts +0 -126
  30. package/src/map/types/index.ts +0 -55
  31. package/src/map/types/location.types.ts +0 -368
  32. package/src/map/types/map-view.types.ts +0 -281
  33. package/src/map/types/overlays.types.ts +0 -404
  34. package/src/map/utils/EventManager.ts +0 -23
  35. package/src/map/utils/ModuleLoader.ts +0 -115
  36. package/src/types/coordinates.types.ts +0 -25
  37. package/src/types/independent.types.ts +0 -288
  38. package/src/types/index.ts +0 -5
  39. package/src/types/naviview.types.ts +0 -330
  40. package/src/types/route.types.ts +0 -305
@@ -1,281 +0,0 @@
1
- /**
2
- * 高德地图视图相关类型定义
3
- * 基于 Expo Modules API
4
- */
5
-
6
- import type { StyleProp, ViewStyle, NativeSyntheticEvent } from 'react-native';
7
- import type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';
8
-
9
- /**
10
- * 定位事件数据
11
- */
12
- export interface LocationEvent {
13
- /**
14
- * 纬度
15
- */
16
- latitude: number;
17
-
18
- /**
19
- * 经度
20
- */
21
- longitude: number;
22
-
23
- /**
24
- * 定位精度(米)
25
- */
26
- accuracy: number;
27
- }
28
-
29
-
30
- /**
31
- * 地图相机事件
32
- */
33
- export interface CameraEvent {
34
- /**
35
- * 相机位置
36
- */
37
- cameraPosition: CameraPosition;
38
-
39
- /**
40
- * 可见区域边界
41
- */
42
- latLngBounds: LatLngBounds;
43
- }
44
-
45
- /**
46
- * 地图视图属性
47
- */
48
- export interface MapViewProps {
49
- /**
50
- * 地图类型
51
- */
52
- mapType?: MapType;
53
-
54
- /**
55
- * 初始相机位置
56
- */
57
- initialCameraPosition?: CameraPosition;
58
-
59
- /**
60
- * 是否显示当前定位
61
- */
62
- myLocationEnabled?: boolean;
63
-
64
- /**
65
- * 是否跟随用户位置
66
- * @default false
67
- */
68
- followUserLocation?: boolean;
69
-
70
- /**
71
- * 定位蓝点配置
72
- */
73
- userLocationRepresentation?: {
74
- /** 精度圈是否显示 @default true */
75
- showsAccuracyRing?: boolean;
76
- /** 是否显示方向指示 @default true @platform ios */
77
- showsHeadingIndicator?: boolean;
78
- /** 精度圈填充颜色 支持 '#RRGGBB'、'red' 或 ARGB 数字 */
79
- fillColor?: string | number;
80
- /** 精度圈边线颜色 */
81
- strokeColor?: string | number;
82
- /** 精度圈边线宽度 @default 0 */
83
- lineWidth?: number;
84
- /** 内部蓝色圆点是否使用律动效果 @default true @platform ios */
85
- enablePulseAnimation?: boolean;
86
- /** 定位点背景色 @default 'white' @platform ios */
87
- locationDotBgColor?: string | number;
88
- /** 定位点蓝色圆点颜色 @default 'blue' @platform ios */
89
- locationDotFillColor?: string | number;
90
- /** 定位图标 支持网络图片(http/https)、本地文件(file://)或资源名称 */
91
- image?: string;
92
- /** 定位图标宽度(像素) */
93
- imageWidth?: number;
94
- /** 定位图标高度(像素) */
95
- imageHeight?: number;
96
- };
97
-
98
- /**
99
- * 是否显示室内地图
100
- *
101
- */
102
- indoorViewEnabled?: boolean;
103
-
104
- /**
105
- * 是否显示3D建筑
106
- */
107
- buildingsEnabled?: boolean;
108
-
109
- /**
110
- * 是否显示标注
111
- */
112
- labelsEnabled?: boolean;
113
-
114
- /**
115
- * 是否显示指南针
116
- */
117
- compassEnabled?: boolean;
118
-
119
- /**
120
- * 是否显示缩放按钮
121
- * @platform android
122
- */
123
- zoomControlsEnabled?: boolean;
124
-
125
- /**
126
- * 是否显示比例尺
127
- */
128
- scaleControlsEnabled?: boolean;
129
-
130
- /**
131
- * 是否显示定位按钮
132
- * @platform android
133
- */
134
- myLocationButtonEnabled?: boolean;
135
-
136
- /**
137
- * 是否显示路况
138
- */
139
- trafficEnabled?: boolean;
140
-
141
- /**
142
- * 最大缩放级别
143
- */
144
- maxZoom?: number;
145
-
146
- /**
147
- * 最小缩放级别
148
- */
149
- minZoom?: number;
150
-
151
- /**
152
- * 是否启用缩放手势
153
- */
154
- zoomGesturesEnabled?: boolean;
155
-
156
- /**
157
- * 是否启用滑动手势
158
- */
159
- scrollGesturesEnabled?: boolean;
160
-
161
- /**
162
- * 是否启用旋转手势
163
- */
164
- rotateGesturesEnabled?: boolean;
165
-
166
- /**
167
- * 是否启用倾斜手势
168
- */
169
- tiltGesturesEnabled?: boolean;
170
-
171
- /**
172
- * 定位的最小更新距离(米)
173
- * @platform ios
174
- */
175
- distanceFilter?: number;
176
-
177
- /**
178
- * 最小更新角度(度)
179
- * @platform ios
180
- */
181
- headingFilter?: number;
182
-
183
- /**
184
- * 样式
185
- */
186
- style?: StyleProp<ViewStyle>;
187
-
188
- /**
189
- * 点击地图事件
190
- */
191
- onMapPress?: (event: NativeSyntheticEvent<LatLng>) => void;
192
-
193
- /**
194
- * 点击标注点事件
195
- */
196
- onPressPoi?: (event: NativeSyntheticEvent<MapPoi>) => void;
197
-
198
- /**
199
- * 长按地图事件
200
- */
201
- onMapLongPress?: (event: NativeSyntheticEvent<LatLng>) => void;
202
-
203
- /**
204
- * 地图状态改变事件(实时触发)
205
- */
206
- onCameraMove?: (event: NativeSyntheticEvent<CameraEvent>) => void;
207
-
208
- /**
209
- * 地图状态改变完成事件
210
- */
211
- onCameraIdle?: (event: NativeSyntheticEvent<CameraEvent>) => void;
212
-
213
- /**
214
- * 地图加载完成事件
215
- */
216
- onLoad?: (event: NativeSyntheticEvent<{}>) => void;
217
-
218
- /**
219
- * 地图定位更新事件
220
- */
221
- onLocation?: (event: NativeSyntheticEvent<LocationEvent>) => void;
222
-
223
- /**
224
- * 子组件
225
- */
226
- children?: React.ReactNode;
227
- }
228
-
229
- /**
230
- * 地图视图方法
231
- */
232
- export interface MapViewMethods {
233
- /**
234
- * 移动相机
235
- * @param cameraPosition 目标相机位置
236
- * @param duration 动画时长(毫秒)
237
- */
238
- moveCamera(cameraPosition: CameraPosition, duration?: number): void;
239
-
240
- /**
241
- * 将屏幕坐标转换为地理坐标
242
- * @param point 屏幕坐标
243
- * @returns 地理坐标
244
- */
245
- getLatLng(point: Point): Promise<LatLng>;
246
-
247
- /**
248
- * 设置地图中心点
249
- * @param center 中心点
250
- * @param animated 是否启用动画
251
- */
252
- setCenter(center: LatLng, animated?: boolean): void;
253
-
254
- /**
255
- * 设置地图缩放级别
256
- * @param zoom 缩放级别
257
- * @param animated 是否启用动画
258
- */
259
- setZoom(zoom: number, animated?: boolean): void;
260
-
261
- /**
262
- * 获取相机位置
263
- * @returns 相机位置
264
- */
265
- getCameraPosition(): Promise<CameraPosition>;
266
-
267
-
268
- }
269
-
270
- /**
271
- * MapView Ref 公开接口(用户使用)
272
- */
273
- export interface MapViewRef {
274
- moveCamera(position: CameraPosition, duration?: number): Promise<void>;
275
- getLatLng(point: Point): Promise<LatLng>;
276
- setCenter(center: LatLng, animated?: boolean): Promise<void>;
277
- setZoom(zoom: number, animated?: boolean): Promise<void>;
278
- getCameraPosition(): Promise<CameraPosition>;
279
-
280
- }
281
-
@@ -1,404 +0,0 @@
1
- /**
2
- * 高德地图覆盖物相关类型定义
3
- * 基于 Expo Modules API
4
- */
5
-
6
- import type { ImageSourcePropType, ViewStyle, NativeSyntheticEvent } from 'react-native';
7
- import type { ColorValue, LatLng, Point } from './common.types';
8
-
9
- /**
10
- * 标记点属性
11
- */
12
- export interface MarkerProps {
13
- /**
14
- * 坐标
15
- */
16
- position: LatLng;
17
-
18
- /**
19
- * 图标
20
- */
21
- icon?: string | ImageSourcePropType;
22
-
23
- /**
24
- * 图标宽度(像素)
25
- * 仅在使用 icon 属性时有效
26
- */
27
- iconWidth?: number;
28
-
29
- /**
30
- * 图标高度(像素)
31
- * 仅在使用 icon 属性时有效
32
- */
33
- iconHeight?: number;
34
-
35
- /**
36
- * 标题
37
- */
38
- title?: string;
39
-
40
- /**
41
- * 描述
42
- */
43
- snippet?: string;
44
-
45
- /**
46
- * 透明度 [0, 1]
47
- * @platform android
48
- * @note iOS 不支持
49
- */
50
- opacity?: number;
51
-
52
- /**
53
- * 是否可拖拽
54
- */
55
- draggable?: boolean;
56
-
57
- /**
58
- * 是否平贴地图
59
- * @platform android
60
- * @note iOS 不支持
61
- */
62
- flat?: boolean;
63
-
64
- /**
65
- * 层级
66
- * @platform android
67
- * @note iOS 不支持 (使用 displayPriority)
68
- */
69
- zIndex?: number;
70
-
71
- /**
72
- * 覆盖物锚点比例
73
- * @platform android
74
- * @note iOS 使用 centerOffset
75
- */
76
- anchor?: Point;
77
-
78
- /**
79
- * 覆盖物偏移位置
80
- * @platform ios
81
- */
82
- centerOffset?: Point;
83
-
84
- /**
85
- * 是否显示动画
86
- * @platform ios
87
- */
88
- animatesDrop?: boolean;
89
-
90
- /**
91
- * 大头针颜色
92
- * Android 支持更多颜色,iOS 只支持 red, green, purple
93
- */
94
- pinColor?: 'red' | 'orange' | 'yellow' | 'green' | 'cyan' | 'blue' | 'violet' | 'magenta' | 'rose' | 'purple';
95
-
96
- /**
97
- * 自定义视图
98
- * 当使用 children 时,会将 React Native 组件渲染为图片显示在地图上
99
- */
100
- children?: React.ReactNode;
101
-
102
- /**
103
- * 自定义视图宽度(像素)
104
- * 仅在使用 children 属性时有效
105
- * @default 80
106
- */
107
- customViewWidth?: number;
108
-
109
- /**
110
- * 自定义视图高度(像素)
111
- * 仅在使用 children 属性时有效
112
- * @default 30
113
- */
114
- customViewHeight?: number;
115
-
116
- /**
117
- * 点击事件
118
- */
119
- onMarkerPress?: (event: NativeSyntheticEvent<LatLng>) => void;
120
-
121
- /**
122
- * 拖拽开始事件
123
- */
124
- onMarkerDragStart?: (event: NativeSyntheticEvent<LatLng>) => void;
125
-
126
- /**
127
- * 拖拽中事件
128
- */
129
- onMarkerDrag?: (event: NativeSyntheticEvent<LatLng>) => void;
130
-
131
- /**
132
- * 拖拽结束事件
133
- */
134
- onMarkerDragEnd?: (event: NativeSyntheticEvent<LatLng>) => void;
135
- }
136
-
137
- /**
138
- * 折线属性
139
- */
140
- export interface PolylineProps {
141
- /**
142
- * 节点坐标数组
143
- */
144
- points: LatLng[];
145
-
146
- /**
147
- * 线宽
148
- */
149
- strokeWidth?: number;
150
-
151
- /**
152
- * 线条颜色
153
- */
154
- strokeColor?: ColorValue;
155
-
156
- /**
157
- * 层级
158
- */
159
- zIndex?: number;
160
-
161
- /**
162
- * 分段颜色
163
- */
164
- colors?: ColorValue[];
165
-
166
- /**
167
- * 是否使用渐变色
168
- * @platform android
169
- * @note iOS 不支持
170
- */
171
- gradient?: boolean;
172
-
173
- /**
174
- * 是否绘制大地线
175
- * @platform android
176
- * @note iOS 不支持
177
- */
178
- geodesic?: boolean;
179
-
180
- /**
181
- * 是否绘制虚线
182
- * @platform android
183
- * @note iOS 不支持
184
- */
185
- dotted?: boolean;
186
-
187
- /**
188
- * 纹理图片
189
- * 支持网络图片(http/https)、本地文件(file://)或资源名称
190
- */
191
- texture?: string;
192
-
193
- /**
194
- * 点击事件
195
- */
196
- onPolylinePress?: (event: NativeSyntheticEvent<{}>) => void;
197
- }
198
-
199
- /**
200
- * 多边形属性
201
- */
202
- export interface PolygonProps {
203
- /**
204
- * 节点坐标数组
205
- */
206
- points: LatLng[];
207
-
208
- /**
209
- * 边线宽度
210
- */
211
- strokeWidth?: number;
212
-
213
- /**
214
- * 边线颜色
215
- */
216
- strokeColor?: ColorValue;
217
-
218
- /**
219
- * 填充颜色
220
- */
221
- fillColor?: ColorValue;
222
-
223
- /**
224
- * 层级
225
- */
226
- zIndex?: number;
227
-
228
- /**
229
- * 点击事件
230
- */
231
- onPolygonPress?: (event: NativeSyntheticEvent<{}>) => void;
232
- }
233
-
234
- /**
235
- * 圆形属性
236
- */
237
- export interface CircleProps {
238
- /**
239
- * 圆心坐标
240
- */
241
- center: LatLng;
242
-
243
- /**
244
- * 半径(米)
245
- */
246
- radius: number;
247
-
248
- /**
249
- * 边线宽度
250
- */
251
- strokeWidth?: number;
252
-
253
- /**
254
- * 边线颜色
255
- */
256
- strokeColor?: ColorValue;
257
-
258
- /**
259
- * 填充颜色
260
- */
261
- fillColor?: ColorValue;
262
-
263
- /**
264
- * 层级
265
- */
266
- zIndex?: number;
267
-
268
- /**
269
- * 点击事件
270
- */
271
- onCirclePress?: (event: NativeSyntheticEvent<{}>) => void;
272
-
273
-
274
- }
275
-
276
- /**
277
- * 热力图属性
278
- */
279
- export interface HeatMapProps {
280
- /**
281
- * 热力点数据
282
- */
283
- data: LatLng[];
284
-
285
- /**
286
- * 热力半径(米)
287
- */
288
- radius?: number;
289
-
290
- /**
291
- * 透明度 [0, 1]
292
- */
293
- opacity?: number;
294
- }
295
-
296
- /**
297
- * 海量点标记项
298
- */
299
- export interface MultiPointItem extends LatLng {
300
- /**
301
- * 唯一标识
302
- */
303
- id?: string | number;
304
-
305
- /**
306
- * 自定义数据
307
- */
308
- data?: any;
309
- }
310
-
311
- /**
312
- * 海量点属性
313
- */
314
- export interface MultiPointProps {
315
- /**
316
- * 点集合
317
- */
318
- items: MultiPointItem[];
319
-
320
- /**
321
- * 图标
322
- */
323
- icon?: ImageSourcePropType;
324
-
325
- /**
326
- * 点击事件
327
- */
328
- onPress?: (event: NativeSyntheticEvent<{ index: number; item: MultiPointItem }>) => void;
329
- }
330
-
331
- /**
332
- * 聚合点参数
333
- */
334
- export interface ClusterParams {
335
- /**
336
- * 唯一标识
337
- */
338
- id: number;
339
-
340
- /**
341
- * 包含的标记点数量
342
- */
343
- count: number;
344
-
345
- /**
346
- * 聚合点坐标
347
- */
348
- position: LatLng;
349
- }
350
-
351
- /**
352
- * 聚合点项
353
- */
354
- export interface ClusterPoint {
355
- /**
356
- * 坐标
357
- */
358
- position: LatLng;
359
-
360
- /**
361
- * 自定义数据
362
- */
363
- properties?: any;
364
- }
365
-
366
- /**
367
- * 聚合图层属性
368
- */
369
- export interface ClusterProps {
370
- /**
371
- * 聚合半径
372
- */
373
- radius?: number;
374
-
375
- /**
376
- * 聚合点样式
377
- */
378
- clusterStyle?: ViewStyle;
379
-
380
- /**
381
- * 聚合点文本样式
382
- */
383
- clusterTextStyle?: ViewStyle;
384
-
385
- /**
386
- * 坐标点列表
387
- */
388
- points: ClusterPoint[];
389
-
390
- /**
391
- * 渲染标记点
392
- */
393
- renderMarker: (item: ClusterPoint) => React.ReactNode;
394
-
395
- /**
396
- * 渲染聚合点
397
- */
398
- renderCluster?: (params: ClusterParams) => React.ReactNode;
399
-
400
- /**
401
- * 聚合点点击事件
402
- */
403
- onPress?: (event: NativeSyntheticEvent<ClusterParams>) => void;
404
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * 通用事件管理器
3
- * 用于管理地图覆盖物的事件回调
4
- */
5
- export class EventManager<T extends Record<string, any>> {
6
- private callbacks = new Map<string, T>();
7
-
8
- register(id: string, callbacks: T) {
9
- this.callbacks.set(id, callbacks);
10
- }
11
-
12
- unregister(id: string) {
13
- this.callbacks.delete(id);
14
- }
15
-
16
- trigger<K extends keyof T>(id: string, eventType: K, data?: any) {
17
- const callbacks = this.callbacks.get(id);
18
- const callback = callbacks?.[eventType];
19
- if (typeof callback === 'function') {
20
- callback(data);
21
- }
22
- }
23
- }