expo-gaode-map 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/.eslintrc.js +5 -0
- package/PUBLISHING.md +244 -0
- package/README.md +990 -0
- package/android/build.gradle +48 -0
- package/android/src/main/AndroidManifest.xml +40 -0
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapModule.kt +455 -0
- package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +337 -0
- package/android/src/main/java/expo/modules/gaodemap/managers/CameraManager.kt +128 -0
- package/android/src/main/java/expo/modules/gaodemap/managers/OverlayManager.kt +324 -0
- package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +122 -0
- package/android/src/main/java/expo/modules/gaodemap/modules/LocationManager.kt +247 -0
- package/android/src/main/java/expo/modules/gaodemap/modules/SDKInitializer.kt +45 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/CircleView.kt +151 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/ClusterView.kt +127 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/HeatMapView.kt +97 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerView.kt +204 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/MultiPointView.kt +103 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolygonView.kt +114 -0
- package/android/src/main/java/expo/modules/gaodemap/overlays/PolylineView.kt +138 -0
- package/build/ExpoGaodeMap.types.d.ts +24 -0
- package/build/ExpoGaodeMap.types.d.ts.map +1 -0
- package/build/ExpoGaodeMap.types.js +14 -0
- package/build/ExpoGaodeMap.types.js.map +1 -0
- package/build/ExpoGaodeMapModule.d.ts +7 -0
- package/build/ExpoGaodeMapModule.d.ts.map +1 -0
- package/build/ExpoGaodeMapModule.js +14 -0
- package/build/ExpoGaodeMapModule.js.map +1 -0
- package/build/ExpoGaodeMapView.d.ts +31 -0
- package/build/ExpoGaodeMapView.d.ts.map +1 -0
- package/build/ExpoGaodeMapView.js +141 -0
- package/build/ExpoGaodeMapView.js.map +1 -0
- package/build/components/overlays/Circle.d.ts +18 -0
- package/build/components/overlays/Circle.d.ts.map +1 -0
- package/build/components/overlays/Circle.js +63 -0
- package/build/components/overlays/Circle.js.map +1 -0
- package/build/components/overlays/Cluster.d.ts +22 -0
- package/build/components/overlays/Cluster.d.ts.map +1 -0
- package/build/components/overlays/Cluster.js +35 -0
- package/build/components/overlays/Cluster.js.map +1 -0
- package/build/components/overlays/HeatMap.d.ts +21 -0
- package/build/components/overlays/HeatMap.d.ts.map +1 -0
- package/build/components/overlays/HeatMap.js +34 -0
- package/build/components/overlays/HeatMap.js.map +1 -0
- package/build/components/overlays/Marker.d.ts +17 -0
- package/build/components/overlays/Marker.d.ts.map +1 -0
- package/build/components/overlays/Marker.js +57 -0
- package/build/components/overlays/Marker.js.map +1 -0
- package/build/components/overlays/MultiPoint.d.ts +21 -0
- package/build/components/overlays/MultiPoint.d.ts.map +1 -0
- package/build/components/overlays/MultiPoint.js +34 -0
- package/build/components/overlays/MultiPoint.js.map +1 -0
- package/build/components/overlays/Polygon.d.ts +22 -0
- package/build/components/overlays/Polygon.d.ts.map +1 -0
- package/build/components/overlays/Polygon.js +100 -0
- package/build/components/overlays/Polygon.js.map +1 -0
- package/build/components/overlays/Polyline.d.ts +20 -0
- package/build/components/overlays/Polyline.d.ts.map +1 -0
- package/build/components/overlays/Polyline.js +60 -0
- package/build/components/overlays/Polyline.js.map +1 -0
- package/build/components/overlays/index.d.ts +8 -0
- package/build/components/overlays/index.d.ts.map +1 -0
- package/build/components/overlays/index.js +18 -0
- package/build/components/overlays/index.js.map +1 -0
- package/build/index.d.ts +10 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +28 -0
- package/build/index.js.map +1 -0
- package/build/modules/AMapLocation.d.ts +58 -0
- package/build/modules/AMapLocation.d.ts.map +1 -0
- package/build/modules/AMapLocation.js +141 -0
- package/build/modules/AMapLocation.js.map +1 -0
- package/build/modules/AMapSDK.d.ts +27 -0
- package/build/modules/AMapSDK.d.ts.map +1 -0
- package/build/modules/AMapSDK.js +43 -0
- package/build/modules/AMapSDK.js.map +1 -0
- package/build/modules/AMapView.d.ts +39 -0
- package/build/modules/AMapView.d.ts.map +1 -0
- package/build/modules/AMapView.js +61 -0
- package/build/modules/AMapView.js.map +1 -0
- package/build/types/common.types.d.ts +133 -0
- package/build/types/common.types.d.ts.map +1 -0
- package/build/types/common.types.js +31 -0
- package/build/types/common.types.js.map +1 -0
- package/build/types/index.d.ts +12 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +17 -0
- package/build/types/index.js.map +1 -0
- package/build/types/location.types.d.ts +306 -0
- package/build/types/location.types.d.ts.map +1 -0
- package/build/types/location.types.js +93 -0
- package/build/types/location.types.js.map +1 -0
- package/build/types/map-view.types.d.ts +213 -0
- package/build/types/map-view.types.d.ts.map +1 -0
- package/build/types/map-view.types.js +6 -0
- package/build/types/map-view.types.js.map +1 -0
- package/build/types/overlays.types.d.ts +296 -0
- package/build/types/overlays.types.d.ts.map +1 -0
- package/build/types/overlays.types.js +6 -0
- package/build/types/overlays.types.js.map +1 -0
- package/build/types/sdk.types.d.ts +113 -0
- package/build/types/sdk.types.d.ts.map +1 -0
- package/build/types/sdk.types.js +6 -0
- package/build/types/sdk.types.js.map +1 -0
- package/docs/followUserLocation.md +186 -0
- package/expo-module.config.json +9 -0
- package/ios/ExpoGaodeMap.podspec +29 -0
- package/ios/ExpoGaodeMapModule.swift +48 -0
- package/ios/ExpoGaodeMapView.swift +38 -0
- package/package.json +45 -0
- package/src/ExpoGaodeMap.types.ts +68 -0
- package/src/ExpoGaodeMapModule.ts +21 -0
- package/src/ExpoGaodeMapView.tsx +151 -0
- package/src/components/overlays/Circle.tsx +73 -0
- package/src/components/overlays/Cluster.tsx +38 -0
- package/src/components/overlays/HeatMap.tsx +37 -0
- package/src/components/overlays/Marker.tsx +66 -0
- package/src/components/overlays/MultiPoint.tsx +37 -0
- package/src/components/overlays/Polygon.tsx +107 -0
- package/src/components/overlays/Polyline.tsx +69 -0
- package/src/components/overlays/index.ts +18 -0
- package/src/index.ts +55 -0
- package/src/modules/AMapLocation.ts +164 -0
- package/src/modules/AMapSDK.ts +48 -0
- package/src/modules/AMapView.ts +68 -0
- package/src/types/README.md +186 -0
- package/src/types/common.types.ts +155 -0
- package/src/types/index.ts +74 -0
- package/src/types/location.types.ts +364 -0
- package/src/types/map-view.types.ts +249 -0
- package/src/types/overlays.types.ts +346 -0
- package/src/types/sdk.types.ts +128 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图定位相关类型定义
|
|
3
|
+
* 基于 Expo Modules API
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { LatLng } from './common.types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 坐标信息(基础定位)
|
|
10
|
+
*/
|
|
11
|
+
export interface Coordinates extends LatLng {
|
|
12
|
+
/**
|
|
13
|
+
* 海拔高度(米)
|
|
14
|
+
*/
|
|
15
|
+
altitude: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 水平精度(米)
|
|
19
|
+
*/
|
|
20
|
+
accuracy: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 移动方向(度,需要 GPS)
|
|
24
|
+
*/
|
|
25
|
+
heading: number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 移动速度(米/秒,需要 GPS)
|
|
29
|
+
*/
|
|
30
|
+
speed: number;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 时间戳
|
|
34
|
+
*/
|
|
35
|
+
timestamp: number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 是否有可用坐标
|
|
39
|
+
* @platform ios
|
|
40
|
+
*/
|
|
41
|
+
isAvailableCoordinate?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 逆地理编码信息
|
|
46
|
+
*/
|
|
47
|
+
export interface ReGeocode extends Coordinates {
|
|
48
|
+
/**
|
|
49
|
+
* 格式化地址
|
|
50
|
+
*/
|
|
51
|
+
address: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 国家
|
|
55
|
+
*/
|
|
56
|
+
country: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 省/直辖市,如 `湖北省`
|
|
60
|
+
*/
|
|
61
|
+
province: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 市,如 `武汉市`
|
|
65
|
+
*/
|
|
66
|
+
city: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 区,如 `武昌区`
|
|
70
|
+
*/
|
|
71
|
+
district: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 城市编码
|
|
75
|
+
*/
|
|
76
|
+
cityCode: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 区域编码
|
|
80
|
+
*/
|
|
81
|
+
adCode: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 街道名称
|
|
85
|
+
*/
|
|
86
|
+
street: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 门牌号
|
|
90
|
+
*/
|
|
91
|
+
streetNumber: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 兴趣点名称
|
|
95
|
+
*/
|
|
96
|
+
poiName: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 所属兴趣点名称
|
|
100
|
+
*/
|
|
101
|
+
aoiName: string;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 定位信息描述
|
|
105
|
+
* @platform android
|
|
106
|
+
*/
|
|
107
|
+
description?: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 坐标系类型
|
|
111
|
+
* @platform android
|
|
112
|
+
*/
|
|
113
|
+
coordType?: 'GCJ02' | 'WGS84';
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 室内定位建筑物ID
|
|
117
|
+
* @platform android
|
|
118
|
+
*/
|
|
119
|
+
buildingId?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 定位精度级别
|
|
124
|
+
* @platform ios
|
|
125
|
+
*/
|
|
126
|
+
export enum LocationAccuracy {
|
|
127
|
+
/**
|
|
128
|
+
* 最适合导航
|
|
129
|
+
*/
|
|
130
|
+
BestForNavigation = 0,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 最高精度(约10米,耗时约10秒)
|
|
134
|
+
*/
|
|
135
|
+
Best = 1,
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 10米精度
|
|
139
|
+
*/
|
|
140
|
+
NearestTenMeters = 2,
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 100米精度(推荐)
|
|
144
|
+
*/
|
|
145
|
+
HundredMeters = 3,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 1公里精度
|
|
149
|
+
*/
|
|
150
|
+
Kilometer = 4,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* 3公里精度
|
|
154
|
+
*/
|
|
155
|
+
ThreeKilometers = 5,
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* 定位模式
|
|
160
|
+
* @platform android
|
|
161
|
+
*/
|
|
162
|
+
export enum LocationMode {
|
|
163
|
+
/**
|
|
164
|
+
* 高精度模式(网络+卫星)
|
|
165
|
+
*/
|
|
166
|
+
HighAccuracy = 1,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 低功耗模式(仅网络)
|
|
170
|
+
*/
|
|
171
|
+
BatterySaving = 2,
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 仅设备模式(仅卫星)
|
|
175
|
+
*/
|
|
176
|
+
DeviceSensors = 3,
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* 坐标系类型
|
|
181
|
+
*/
|
|
182
|
+
export enum CoordinateType {
|
|
183
|
+
/**
|
|
184
|
+
* 高德坐标系
|
|
185
|
+
*/
|
|
186
|
+
AMap = -1,
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 百度坐标系
|
|
190
|
+
*/
|
|
191
|
+
Baidu = 0,
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* MapBar坐标系
|
|
195
|
+
*/
|
|
196
|
+
MapBar = 1,
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* MapABC坐标系
|
|
200
|
+
*/
|
|
201
|
+
MapABC = 2,
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 搜搜地图坐标系
|
|
205
|
+
*/
|
|
206
|
+
SoSoMap = 3,
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* 阿里云坐标系
|
|
210
|
+
*/
|
|
211
|
+
AliYun = 4,
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 谷歌坐标系
|
|
215
|
+
*/
|
|
216
|
+
Google = 5,
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* GPS坐标系
|
|
220
|
+
*/
|
|
221
|
+
GPS = 6,
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* 地理语言
|
|
226
|
+
*/
|
|
227
|
+
export type GeoLanguage = 'DEFAULT' | 'EN' | 'ZH';
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* 网络协议
|
|
231
|
+
* @platform android
|
|
232
|
+
*/
|
|
233
|
+
export type LocationProtocol = 'HTTP' | 'HTTPS';
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* 定位配置选项
|
|
237
|
+
*/
|
|
238
|
+
export interface LocationOptions {
|
|
239
|
+
/**
|
|
240
|
+
* 是否返回逆地理信息
|
|
241
|
+
* @default true
|
|
242
|
+
*/
|
|
243
|
+
withReGeocode?: boolean;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* 定位精度
|
|
247
|
+
* @platform ios
|
|
248
|
+
*/
|
|
249
|
+
accuracy?: LocationAccuracy;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* 定位模式
|
|
253
|
+
* @platform android
|
|
254
|
+
*/
|
|
255
|
+
mode?: LocationMode;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* 是否单次定位
|
|
259
|
+
* @platform android
|
|
260
|
+
* @default false
|
|
261
|
+
*/
|
|
262
|
+
onceLocation?: boolean;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* 定位间隔(毫秒)
|
|
266
|
+
* @platform android
|
|
267
|
+
* @default 2000
|
|
268
|
+
*/
|
|
269
|
+
interval?: number;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* 定位超时时间(秒)
|
|
273
|
+
* @platform ios
|
|
274
|
+
* @default 10
|
|
275
|
+
*/
|
|
276
|
+
timeout?: number;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* 逆地理编码超时时间(秒)
|
|
280
|
+
* @platform ios
|
|
281
|
+
* @default 2
|
|
282
|
+
*/
|
|
283
|
+
reGeocodeTimeout?: number;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* 最小更新距离(米)
|
|
287
|
+
* @platform ios
|
|
288
|
+
*/
|
|
289
|
+
distanceFilter?: number;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* 是否启用设备传感器
|
|
293
|
+
* @platform android
|
|
294
|
+
* @default false
|
|
295
|
+
*/
|
|
296
|
+
sensorEnable?: boolean;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* 是否允许WIFI刷新
|
|
300
|
+
* @platform android
|
|
301
|
+
* @default true
|
|
302
|
+
*/
|
|
303
|
+
wifiScan?: boolean;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* 是否GPS优先
|
|
307
|
+
* @platform android
|
|
308
|
+
* @default false
|
|
309
|
+
*/
|
|
310
|
+
gpsFirst?: boolean;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* 是否等待WIFI列表刷新
|
|
314
|
+
* 定位精度会更高,但是定位速度会变慢1-3秒
|
|
315
|
+
* @platform android
|
|
316
|
+
* @default false
|
|
317
|
+
*/
|
|
318
|
+
onceLocationLatest?: boolean;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* 逆地理语言
|
|
322
|
+
*/
|
|
323
|
+
geoLanguage?: GeoLanguage;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* 是否允许后台定位
|
|
327
|
+
* @platform ios
|
|
328
|
+
* @default false
|
|
329
|
+
*/
|
|
330
|
+
allowsBackgroundLocationUpdates?: boolean;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* 是否自动暂停定位
|
|
334
|
+
* @platform ios
|
|
335
|
+
* @default false
|
|
336
|
+
*/
|
|
337
|
+
pausesLocationUpdatesAutomatically?: boolean;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* 是否使用缓存策略
|
|
341
|
+
* @platform android
|
|
342
|
+
* @default true
|
|
343
|
+
*/
|
|
344
|
+
locationCacheEnable?: boolean;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* 网络请求超时时间(毫秒)
|
|
348
|
+
* @platform android
|
|
349
|
+
* @default 30000
|
|
350
|
+
*/
|
|
351
|
+
httpTimeout?: number;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* 网络协议
|
|
355
|
+
* @platform android
|
|
356
|
+
* @default 'HTTP'
|
|
357
|
+
*/
|
|
358
|
+
protocol?: LocationProtocol;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* 定位事件监听器
|
|
363
|
+
*/
|
|
364
|
+
export type LocationListener = (location: Coordinates | ReGeocode) => void;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 高德地图视图相关类型定义
|
|
3
|
+
* 基于 Expo Modules API
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
7
|
+
import type { CameraPosition, LatLng, LatLngBounds, MapPoi, MapType, Point } from './common.types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 地图相机事件
|
|
11
|
+
*/
|
|
12
|
+
export interface CameraEvent {
|
|
13
|
+
/**
|
|
14
|
+
* 相机位置
|
|
15
|
+
*/
|
|
16
|
+
cameraPosition: CameraPosition;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 可见区域边界
|
|
20
|
+
*/
|
|
21
|
+
latLngBounds: LatLngBounds;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 地图视图属性
|
|
26
|
+
*/
|
|
27
|
+
export interface MapViewProps {
|
|
28
|
+
/**
|
|
29
|
+
* 地图类型
|
|
30
|
+
*/
|
|
31
|
+
mapType?: MapType;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 初始相机位置
|
|
35
|
+
*/
|
|
36
|
+
initialCameraPosition?: CameraPosition;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 是否显示当前定位
|
|
40
|
+
*/
|
|
41
|
+
myLocationEnabled?: boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 是否跟随用户位置
|
|
45
|
+
* 当为 true 时,地图会自动移动跟随用户位置(适合导航场景)
|
|
46
|
+
* 当为 false 时,只显示定位点,不会自动移动地图(默认值,适合浏览场景)
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
followUserLocation?: boolean;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 是否显示定位图标
|
|
53
|
+
*/
|
|
54
|
+
myLocationIcon?: boolean;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 是否显示室内地图
|
|
58
|
+
*/
|
|
59
|
+
indoorViewEnabled?: boolean;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 是否显示3D建筑
|
|
63
|
+
*/
|
|
64
|
+
buildingsEnabled?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 是否显示标注
|
|
68
|
+
*/
|
|
69
|
+
labelsEnabled?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 是否显示指南针
|
|
73
|
+
*/
|
|
74
|
+
compassEnabled?: boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 是否显示缩放按钮
|
|
78
|
+
* @platform android
|
|
79
|
+
*/
|
|
80
|
+
zoomControlsEnabled?: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 是否显示比例尺
|
|
84
|
+
*/
|
|
85
|
+
scaleControlsEnabled?: boolean;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 是否显示定位按钮
|
|
89
|
+
* @platform android
|
|
90
|
+
*/
|
|
91
|
+
myLocationButtonEnabled?: boolean;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 是否显示路况
|
|
95
|
+
*/
|
|
96
|
+
trafficEnabled?: boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 最大缩放级别
|
|
100
|
+
*/
|
|
101
|
+
maxZoom?: number;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 最小缩放级别
|
|
105
|
+
*/
|
|
106
|
+
minZoom?: number;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 是否启用缩放手势
|
|
110
|
+
*/
|
|
111
|
+
zoomGesturesEnabled?: boolean;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 是否启用滑动手势
|
|
115
|
+
*/
|
|
116
|
+
scrollGesturesEnabled?: boolean;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 是否启用旋转手势
|
|
120
|
+
*/
|
|
121
|
+
rotateGesturesEnabled?: boolean;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 是否启用倾斜手势
|
|
125
|
+
*/
|
|
126
|
+
tiltGesturesEnabled?: boolean;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 定位的最小更新距离(米)
|
|
130
|
+
* @platform ios
|
|
131
|
+
*/
|
|
132
|
+
distanceFilter?: number;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 最小更新角度(度)
|
|
136
|
+
* @platform ios
|
|
137
|
+
*/
|
|
138
|
+
headingFilter?: number;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 样式
|
|
142
|
+
*/
|
|
143
|
+
style?: StyleProp<ViewStyle>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 点击地图事件
|
|
147
|
+
*/
|
|
148
|
+
onPress?: (event: LatLng) => void;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 点击标注点事件
|
|
152
|
+
*/
|
|
153
|
+
onPressPoi?: (event: MapPoi) => void;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 长按地图事件
|
|
157
|
+
*/
|
|
158
|
+
onLongPress?: (event: LatLng) => void;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* 地图状态改变事件(实时触发)
|
|
162
|
+
*/
|
|
163
|
+
onCameraMove?: (event: CameraEvent) => void;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* 地图状态改变完成事件
|
|
167
|
+
*/
|
|
168
|
+
onCameraIdle?: (event: CameraEvent) => void;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* 地图加载完成事件
|
|
172
|
+
*/
|
|
173
|
+
onLoad?: (event: {}) => void;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* 地图定位更新事件
|
|
177
|
+
*/
|
|
178
|
+
onLocation?: (event: Location) => void;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* 子组件
|
|
182
|
+
*/
|
|
183
|
+
children?: React.ReactNode;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* 地图视图方法
|
|
188
|
+
*/
|
|
189
|
+
export interface MapViewMethods {
|
|
190
|
+
/**
|
|
191
|
+
* 移动相机
|
|
192
|
+
* @param cameraPosition 目标相机位置
|
|
193
|
+
* @param duration 动画时长(毫秒)
|
|
194
|
+
*/
|
|
195
|
+
moveCamera(cameraPosition: CameraPosition, duration?: number): void;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* 将屏幕坐标转换为地理坐标
|
|
199
|
+
* @param point 屏幕坐标
|
|
200
|
+
* @returns 地理坐标
|
|
201
|
+
*/
|
|
202
|
+
getLatLng(point: Point): Promise<LatLng>;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* MapView Ref 公开接口(用户使用)
|
|
207
|
+
*/
|
|
208
|
+
export interface MapViewRef {
|
|
209
|
+
moveCamera(position: CameraPosition, duration?: number): Promise<void>;
|
|
210
|
+
getLatLng(point: Point): Promise<LatLng>;
|
|
211
|
+
setCenter(center: LatLng, animated?: boolean): Promise<void>;
|
|
212
|
+
setZoom(zoom: number, animated?: boolean): Promise<void>;
|
|
213
|
+
getCameraPosition(): Promise<CameraPosition>;
|
|
214
|
+
addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;
|
|
215
|
+
removeCircle(id: string): Promise<void>;
|
|
216
|
+
updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;
|
|
217
|
+
addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;
|
|
218
|
+
removeMarker(id: string): Promise<void>;
|
|
219
|
+
updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;
|
|
220
|
+
addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;
|
|
221
|
+
removePolyline(id: string): Promise<void>;
|
|
222
|
+
updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;
|
|
223
|
+
addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;
|
|
224
|
+
removePolygon(id: string): Promise<void>;
|
|
225
|
+
updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* 原生 MapView Ref 接口(所有参数必需)
|
|
230
|
+
*/
|
|
231
|
+
export interface NativeMapViewRef {
|
|
232
|
+
moveCamera(position: CameraPosition, duration: number): Promise<void>;
|
|
233
|
+
getLatLng(point: Point): Promise<LatLng>;
|
|
234
|
+
setCenter(center: LatLng, animated: boolean): Promise<void>;
|
|
235
|
+
setZoom(zoom: number, animated: boolean): Promise<void>;
|
|
236
|
+
getCameraPosition(): Promise<CameraPosition>;
|
|
237
|
+
addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;
|
|
238
|
+
removeCircle(id: string): Promise<void>;
|
|
239
|
+
updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;
|
|
240
|
+
addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;
|
|
241
|
+
removeMarker(id: string): Promise<void>;
|
|
242
|
+
updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;
|
|
243
|
+
addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;
|
|
244
|
+
removePolyline(id: string): Promise<void>;
|
|
245
|
+
updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;
|
|
246
|
+
addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;
|
|
247
|
+
removePolygon(id: string): Promise<void>;
|
|
248
|
+
updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;
|
|
249
|
+
}
|