@dcloudio/uni-app-x 0.7.31 → 0.7.33

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 (32) hide show
  1. package/package.json +1 -1
  2. package/types/app.d.ts +45 -11
  3. package/types/native/CSSStyleDeclaration.d.ts +72 -0
  4. package/types/native/DOMRect.d.ts +180 -0
  5. package/types/native/DrawableContext.d.ts +471 -4
  6. package/types/native/IUniElement.d.ts +3 -3
  7. package/types/native/SnapshotOptions.d.ts +0 -1
  8. package/types/native/UniElement.d.ts +1 -0
  9. package/types/native/UniEvent.d.ts +23 -1
  10. package/types/page.d.ts +98 -83
  11. package/types/uni/uts-plugin-api/global.d.ts +2 -0
  12. package/types/uni/uts-plugin-api/index.d.ts +2 -0
  13. package/types/uni/uts-plugin-api/lib/uni-crash/utssdk/global.d.ts +20 -0
  14. package/types/uni/uts-plugin-api/lib/uni-crash/utssdk/index.d.ts +9 -0
  15. package/types/uni/uts-plugin-api/lib/uni-crash/utssdk/interface.d.ts +48 -0
  16. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +6 -6
  17. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +20 -20
  18. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent-uni1/utssdk/global.d.ts +22 -0
  19. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent-uni1/utssdk/index.d.ts +10 -0
  20. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent-uni1/utssdk/interface.d.ts +781 -0
  21. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +7 -5
  22. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +4 -4
  23. package/types/uni/uts-plugin-api/lib/uni-privacy/utssdk/interface.d.ts +33 -33
  24. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/global.d.ts +2 -2
  25. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/index.d.ts +1 -1
  26. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +3 -4
  27. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +224 -5
  28. package/types/uni/uts-plugin-biz/lib/uni-map-tencent/utssdk/global.d.ts +14 -8
  29. package/types/uni/uts-plugin-biz/lib/uni-map-tencent/utssdk/index.d.ts +7 -4
  30. package/types/uni/uts-plugin-biz/lib/uni-map-tencent/utssdk/interface.d.ts +1788 -183
  31. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +686 -661
  32. package/types/uni-cloud/interface.d.ts +1 -1
@@ -1,421 +1,1945 @@
1
- export type LatLng = {
1
+ export type LocationObject = {
2
2
  /**
3
3
  * 纬度,浮点数,范围为-90~90,负数表示南纬
4
- */
5
- latitude : number
4
+ * @uniPlatform {
5
+ * "app": {
6
+ * "android": {
7
+ * "osVer": "4.4",
8
+ * "uniVer": "x",
9
+ * "unixVer": "4.31"
10
+ * },
11
+ * "ios": {
12
+ * "osVer": "12.0",
13
+ * "uniVer": "x",
14
+ * "unixVer": "4.31"
15
+ * },
16
+ * },
17
+ * }
18
+ *
19
+ */
20
+ latitude : number;
6
21
  /**
7
22
  * 经度,范围为-180~180,负数表示西经
8
- */
9
- longitude : number
10
- }
11
-
23
+ * @uniPlatform {
24
+ * "app": {
25
+ * "android": {
26
+ * "osVer": "4.4",
27
+ * "uniVer": "x",
28
+ * "unixVer": "4.31"
29
+ * },
30
+ * "ios": {
31
+ * "osVer": "12.0",
32
+ * "uniVer": "x",
33
+ * "unixVer": "4.31"
34
+ * },
35
+ * },
36
+ * }
37
+ *
38
+ */
39
+ longitude : number;
40
+ };
12
41
 
13
42
  export type Marker = {
14
- id : number
15
- latitude : number
16
- longitude : number
17
- iconPath : string
18
-
19
- title ?: string | null
20
- rotate ?: number | null
21
- alpha ?: number | null
22
- width ?: number | null
23
- height ?: number | null
24
- ariaLabel ?: string | null
25
- anchor ?: Array<number> | null
26
-
27
- // clusterId : number | null = null
28
- // joinCluster = false
29
- // callout: MarkerCallout? = null
30
- // label: MarkerLabel? = null
31
- // customCallout: MarkerCustomCallout? = null
32
- }
43
+ /**
44
+ * 标记点id,marker点击事件回调会返回此id。建议为每个marker设置上Number类型id,保证更新marker时有更好的性能。最大限制9位数
45
+ * @uniPlatform {
46
+ * "app": {
47
+ * "android": {
48
+ * "osVer": "4.4",
49
+ * "uniVer": "x",
50
+ * "unixVer": "4.31"
51
+ * },
52
+ * "ios": {
53
+ * "osVer": "12.0",
54
+ * "uniVer": "x",
55
+ * "unixVer": "4.31"
56
+ * },
57
+ * },
58
+ * }
59
+ *
60
+ */
61
+ id : number;
62
+ /**
63
+ * 纬度,浮点数,范围 -90 ~ 90
64
+ * @uniPlatform {
65
+ * "app": {
66
+ * "android": {
67
+ * "osVer": "4.4",
68
+ * "uniVer": "x",
69
+ * "unixVer": "4.31"
70
+ * },
71
+ * "ios": {
72
+ * "osVer": "12.0",
73
+ * "uniVer": "x",
74
+ * "unixVer": "4.31"
75
+ * },
76
+ * },
77
+ * }
78
+ *
79
+ */
80
+ latitude : number;
81
+ /**
82
+ * 经度,浮点数,范围 -180 ~ 180
83
+ * @uniPlatform {
84
+ * "app": {
85
+ * "android": {
86
+ * "osVer": "4.4",
87
+ * "uniVer": "x",
88
+ * "unixVer": "4.31"
89
+ * },
90
+ * "ios": {
91
+ * "osVer": "12.0",
92
+ * "uniVer": "x",
93
+ * "unixVer": "4.31"
94
+ * },
95
+ * },
96
+ * }
97
+ *
98
+ */
99
+ longitude : number;
100
+ /**
101
+ * 显示的图标,项目目录下的图片路径,支持相对路径写法,以'/'开头则表示相对小程序根目录;也支持临时路径
102
+ * @uniPlatform {
103
+ * "app": {
104
+ * "android": {
105
+ * "osVer": "4.4",
106
+ * "uniVer": "x",
107
+ * "unixVer": "4.31"
108
+ * },
109
+ * "ios": {
110
+ * "osVer": "12.0",
111
+ * "uniVer": "x",
112
+ * "unixVer": "4.31"
113
+ * },
114
+ * },
115
+ * }
116
+ *
117
+ */
118
+ iconPath : string;
33
119
 
34
- export type Polyline = {
35
- points : Array<LatLng>
36
- color ?: string | null
37
- width ?: number | null
38
- dottedLine ?: boolean | null
39
- arrowLine ?: boolean | null
40
- arrowIconPath ?: string | null
41
- colorList ?: Array<string> | null
42
- }
120
+ /**
121
+ * 标注点名,点击时显示,callout存在时将被忽略
122
+ * @defaultValue null
123
+ * @uniPlatform {
124
+ * "app": {
125
+ * "android": {
126
+ * "osVer": "4.4",
127
+ * "uniVer": "x",
128
+ * "unixVer": "4.31"
129
+ * },
130
+ * "ios": {
131
+ * "osVer": "12.0",
132
+ * "uniVer": "x",
133
+ * "unixVer": "4.31"
134
+ * },
135
+ * },
136
+ * }
137
+ *
138
+ */
139
+ title ?: string | null;
140
+ /**
141
+ * 旋转角度,顺时针旋转的角度,范围 0 ~ 360
142
+ * @defaultValue 0
143
+ * @uniPlatform {
144
+ * "app": {
145
+ * "android": {
146
+ * "osVer": "4.4",
147
+ * "uniVer": "x",
148
+ * "unixVer": "4.31"
149
+ * },
150
+ * "ios": {
151
+ * "osVer": "12.0",
152
+ * "uniVer": "x",
153
+ * "unixVer": "4.31"
154
+ * },
155
+ * },
156
+ * }
157
+ *
158
+ */
159
+ rotate ?: number | null;
160
+ /**
161
+ * 标注的透明度,范围 0 ~ 1
162
+ * @defaultValue 1
163
+ * @uniPlatform {
164
+ * "app": {
165
+ * "android": {
166
+ * "osVer": "4.4",
167
+ * "uniVer": "x",
168
+ * "unixVer": "4.31"
169
+ * },
170
+ * "ios": {
171
+ * "osVer": "12.0",
172
+ * "uniVer": "x",
173
+ * "unixVer": "4.31"
174
+ * },
175
+ * },
176
+ * }
177
+ *
178
+ */
179
+ alpha ?: number | null;
180
+ /**
181
+ * 标注图标宽度
182
+ * @defaultValue 默认为图片实际宽度
183
+ * @uniPlatform {
184
+ * "app": {
185
+ * "android": {
186
+ * "osVer": "4.4",
187
+ * "uniVer": "x",
188
+ * "unixVer": "4.31"
189
+ * },
190
+ * "ios": {
191
+ * "osVer": "12.0",
192
+ * "uniVer": "x",
193
+ * "unixVer": "4.31"
194
+ * },
195
+ * },
196
+ * }
197
+ *
198
+ */
199
+ width ?: number | null;
200
+ /**
201
+ * 标注图标高度
202
+ * @defaultValue 默认为图片实际高度
203
+ * @uniPlatform {
204
+ * "app": {
205
+ * "android": {
206
+ * "osVer": "4.4",
207
+ * "uniVer": "x",
208
+ * "unixVer": "4.31"
209
+ * },
210
+ * "ios": {
211
+ * "osVer": "12.0",
212
+ * "uniVer": "x",
213
+ * "unixVer": "4.31"
214
+ * },
215
+ * },
216
+ * }
217
+ *
218
+ */
219
+ height ?: number | null;
220
+ /**
221
+ * 无障碍访问,(属性)元素的额外描述
222
+ * @defaultValue null
223
+ * @uniPlatform {
224
+ * "app": {
225
+ * "android": {
226
+ * "osVer": "4.4",
227
+ * "uniVer": "x",
228
+ * "unixVer": "4.31"
229
+ * },
230
+ * "ios": {
231
+ * "osVer": "12.0",
232
+ * "uniVer": "x",
233
+ * "unixVer": "4.31"
234
+ * },
235
+ * },
236
+ * }
237
+ *
238
+ */
239
+ ariaLabel ?: string | null;
240
+ /**
241
+ * 经纬度在标注图标的锚点,默认底边中点 {x, y},x表示横向(0-1),y表示竖向(0-1)。{x: .5, y: 1} 表示底边中点
242
+ * @defaultValue [0.5, 1]
243
+ * @uniPlatform {
244
+ * "app": {
245
+ * "android": {
246
+ * "osVer": "4.4",
247
+ * "uniVer": "x",
248
+ * "unixVer": "4.31"
249
+ * },
250
+ * "ios": {
251
+ * "osVer": "12.0",
252
+ * "uniVer": "x",
253
+ * "unixVer": "4.31"
254
+ * },
255
+ * },
256
+ * }
257
+ *
258
+ */
259
+ anchor ?: Anchor | null;
43
260
 
44
- export type Polygon = {
45
- points : Array<LatLng>
46
- strokeWidth ?: number | null
47
- strokeColor ?: string | null
48
- fillColor ?: string | null
49
- zIndex ?: number | null
50
- }
261
+ callout ?: MapMarkerCallout | null
262
+ label ?: MapMarkerLabel | null
263
+ clusterId ?: number | null;
264
+ customCallout ?: MapMarkerCallout | null
265
+ joinCluster ?: boolean | null;
266
+ };
51
267
 
52
268
 
53
- export type Circle = {
54
- latitude : number
55
- longitude : number
56
- radius : number
57
- color ?: string | null
58
- fillColor ?: string | null
59
- strokeWidth ?: number | null
269
+ export type MapMarkerCallout = {
270
+ content ?: string | null;
271
+ color ?: string | null;
272
+ fontSize ?: number | null;
273
+ borderRadius ?: number | null;
274
+ borderWidth ?: number | null;
275
+ borderColor ?: string | null;
276
+ bgColor ?: string | null;
277
+ padding ?: number | null;
278
+ display ?: "BYCLICK" | "ALWAYS" | null;
279
+ textAlign ?: "left" | "center" | "right" | null;
280
+ anchorX ?: number | null;
281
+ anchorY ?: number | null;
60
282
  }
61
283
 
62
- export type Position = {
63
- left ?: number | null
64
- top ?: number | null
65
- width ?: number | null
66
- height ?: number | null
284
+ export type MapMarkerLabel = {
285
+ content ?: string | null;
286
+ color ?: string | null;
287
+ fontSize ?: number | null;
288
+ x ?: number | null;
289
+ y ?: number | null;
290
+ anchorX ?: number | null;
291
+ anchorY ?: number | null;
292
+ borderWidth ?: number | null;
293
+ borderColor ?: string | null;
294
+ borderRadius ?: number | null;
295
+ bgColor ?: string | null;
296
+ padding ?: number | null;
297
+ textAlign ?: "left" | "center" | "right" | null;
298
+ ariaLabel ?: string | null;
67
299
  }
68
300
 
69
- export type Control = {
70
- position : Position
71
- iconPath : string
72
- id ?: number | null
73
- clickable ?: boolean | null
301
+ export type Anchor = {
302
+ x : number,
303
+ y : number
74
304
  }
75
305
 
76
-
77
- export type Bounds = {
78
- southwest : LatLng
79
- northeast : LatLng
80
- }
81
-
82
- export type GroundOverlay = {
83
- id : string
84
- src : string
85
- bounds : Bounds
86
- visible ?: boolean | null
87
- zIndex ?: number | null
88
- opacity ?: number | null
89
-
306
+ export type Polyline = {
90
307
  /**
91
- * 接口调用成功的回调函数
308
+ * 经纬度数组
309
+ * @uniPlatform {
310
+ * "app": {
311
+ * "android": {
312
+ * "osVer": "4.4",
313
+ * "uniVer": "x",
314
+ * "unixVer": "4.31"
315
+ * },
316
+ * "ios": {
317
+ * "osVer": "12.0",
318
+ * "uniVer": "x",
319
+ * "unixVer": "4.31"
320
+ * },
321
+ * },
322
+ * }
323
+ *
324
+ */
325
+ points : LocationObject[];
326
+ /**
327
+ * 线的颜色
92
328
  * @defaultValue null
93
- */
94
- success ?: ((result : any) => void) | null
329
+ * @uniPlatform {
330
+ * "app": {
331
+ * "android": {
332
+ * "osVer": "4.4",
333
+ * "uniVer": "x",
334
+ * "unixVer": "4.31"
335
+ * },
336
+ * "ios": {
337
+ * "osVer": "12.0",
338
+ * "uniVer": "x",
339
+ * "unixVer": "4.31"
340
+ * },
341
+ * },
342
+ * }
343
+ *
344
+ */
345
+ color ?: string | null;
346
+ /**
347
+ * 线的宽度
348
+ * @defaultValue 0
349
+ * @uniPlatform {
350
+ * "app": {
351
+ * "android": {
352
+ * "osVer": "4.4",
353
+ * "uniVer": "x",
354
+ * "unixVer": "4.31"
355
+ * },
356
+ * "ios": {
357
+ * "osVer": "12.0",
358
+ * "uniVer": "x",
359
+ * "unixVer": "4.31"
360
+ * },
361
+ * },
362
+ * }
363
+ *
364
+ */
365
+ width ?: number | null;
366
+ /**
367
+ * 是否虚线
368
+ * @defaultValue false
369
+ * @uniPlatform {
370
+ * "app": {
371
+ * "android": {
372
+ * "osVer": "4.4",
373
+ * "uniVer": "x",
374
+ * "unixVer": "4.31"
375
+ * },
376
+ * "ios": {
377
+ * "osVer": "12.0",
378
+ * "uniVer": "x",
379
+ * "unixVer": "4.31"
380
+ * },
381
+ * },
382
+ * }
383
+ *
384
+ */
385
+ dottedLine ?: boolean | null;
386
+ /**
387
+ * 带箭头的线
388
+ * @defaultValue false
389
+ * @uniPlatform {
390
+ * "app": {
391
+ * "android": {
392
+ * "osVer": "4.4",
393
+ * "uniVer": "x",
394
+ * "unixVer": "4.31"
395
+ * },
396
+ * "ios": {
397
+ * "osVer": "12.0",
398
+ * "uniVer": "x",
399
+ * "unixVer": "4.31"
400
+ * },
401
+ * },
402
+ * }
403
+ *
404
+ */
405
+ arrowLine ?: boolean | null;
406
+ /**
407
+ * 更换箭头图标
408
+ * @defaultValue null
409
+ * @uniPlatform {
410
+ * "app": {
411
+ * "android": {
412
+ * "osVer": "4.4",
413
+ * "uniVer": "x",
414
+ * "unixVer": "4.31"
415
+ * },
416
+ * "ios": {
417
+ * "osVer": "12.0",
418
+ * "uniVer": "x",
419
+ * "unixVer": "4.31"
420
+ * },
421
+ * },
422
+ * }
423
+ *
424
+ */
425
+ arrowIconPath ?: string | null;
426
+ /**
427
+ * 线的边框颜色
428
+ * @defaultValue null
429
+ * @uniPlatform {
430
+ * "app": {
431
+ * "android": {
432
+ * "osVer": "4.4",
433
+ * "uniVer": "x",
434
+ * "unixVer": "x"
435
+ * },
436
+ * "ios": {
437
+ * "osVer": "12.0",
438
+ * "uniVer": "x",
439
+ * "unixVer": "x"
440
+ * },
441
+ * },
442
+ * }
443
+ *
444
+ */
445
+ borderColor ?: string | null;
446
+ /**
447
+ * 线的厚度
448
+ * @defaultValue null
449
+ * @uniPlatform {
450
+ * "app": {
451
+ * "android": {
452
+ * "osVer": "4.4",
453
+ * "uniVer": "x",
454
+ * "unixVer": "x"
455
+ * },
456
+ * "ios": {
457
+ * "osVer": "12.0",
458
+ * "uniVer": "x",
459
+ * "unixVer": "x"
460
+ * },
461
+ * },
462
+ * }
463
+ *
464
+ */
465
+ borderWidth ?: number | null;
466
+ /**
467
+ * 彩虹线
468
+ * @defaultValue null
469
+ * @uniPlatform {
470
+ * "app": {
471
+ * "android": {
472
+ * "osVer": "4.4",
473
+ * "uniVer": "x",
474
+ * "unixVer": "4.31"
475
+ * },
476
+ * "ios": {
477
+ * "osVer": "12.0",
478
+ * "uniVer": "x",
479
+ * "unixVer": "4.31"
480
+ * },
481
+ * },
482
+ * }
483
+ *
484
+ */
485
+ colorList ?: string[] | null;
486
+ };
487
+
488
+ export type Polygon = {
95
489
  /**
96
- * 接口调用失败的回调函数
490
+ * 经纬度数组
491
+ * @uniPlatform {
492
+ * "app": {
493
+ * "android": {
494
+ * "osVer": "4.4",
495
+ * "uniVer": "x",
496
+ * "unixVer": "4.31"
497
+ * },
498
+ * "ios": {
499
+ * "osVer": "12.0",
500
+ * "uniVer": "x",
501
+ * "unixVer": "4.31"
502
+ * },
503
+ * },
504
+ * }
505
+ *
506
+ */
507
+ points : LocationObject[];
508
+ /**
509
+ * 描边的宽度
510
+ * @defaultValue 0
511
+ * @uniPlatform {
512
+ * "app": {
513
+ * "android": {
514
+ * "osVer": "4.4",
515
+ * "uniVer": "x",
516
+ * "unixVer": "4.31"
517
+ * },
518
+ * "ios": {
519
+ * "osVer": "12.0",
520
+ * "uniVer": "x",
521
+ * "unixVer": "4.31"
522
+ * },
523
+ * },
524
+ * }
525
+ *
526
+ */
527
+ strokeWidth ?: number | null;
528
+ /**
529
+ * 描边的颜色
97
530
  * @defaultValue null
98
- */
99
- fail ?: ((result : any) => void) | null
531
+ * @uniPlatform {
532
+ * "app": {
533
+ * "android": {
534
+ * "osVer": "4.4",
535
+ * "uniVer": "x",
536
+ * "unixVer": "4.31"
537
+ * },
538
+ * "ios": {
539
+ * "osVer": "12.0",
540
+ * "uniVer": "x",
541
+ * "unixVer": "4.31"
542
+ * },
543
+ * },
544
+ * }
545
+ *
546
+ */
547
+ strokeColor ?: string | null;
548
+ /**
549
+ * 填充颜色
550
+ * @defaultValue null
551
+ * @uniPlatform {
552
+ * "app": {
553
+ * "android": {
554
+ * "osVer": "4.4",
555
+ * "uniVer": "x",
556
+ * "unixVer": "4.31"
557
+ * },
558
+ * "ios": {
559
+ * "osVer": "12.0",
560
+ * "uniVer": "x",
561
+ * "unixVer": "4.31"
562
+ * },
563
+ * },
564
+ * }
565
+ *
566
+ */
567
+ fillColor ?: string | null;
568
+ /**
569
+ * 设置多边形 Z 轴数值
570
+ * @defaultValue 0
571
+ * @uniPlatform {
572
+ * "app": {
573
+ * "android": {
574
+ * "osVer": "4.4",
575
+ * "uniVer": "x",
576
+ * "unixVer": "4.31"
577
+ * },
578
+ * "ios": {
579
+ * "osVer": "12.0",
580
+ * "uniVer": "x",
581
+ * "unixVer": "4.31"
582
+ * },
583
+ * },
584
+ * }
585
+ *
586
+ */
587
+ zIndex ?: number | null;
588
+ };
589
+
590
+ export type Circle = {
100
591
  /**
101
- * 接口调用结束的回调函数(调用成功、失败都会执行)
592
+ * 纬度
593
+ * @uniPlatform {
594
+ * "app": {
595
+ * "android": {
596
+ * "osVer": "4.4",
597
+ * "uniVer": "x",
598
+ * "unixVer": "4.31"
599
+ * },
600
+ * "ios": {
601
+ * "osVer": "12.0",
602
+ * "uniVer": "x",
603
+ * "unixVer": "4.31"
604
+ * },
605
+ * },
606
+ * }
607
+ *
608
+ */
609
+ latitude : number;
610
+ /**
611
+ * 经度
612
+ * @uniPlatform {
613
+ * "app": {
614
+ * "android": {
615
+ * "osVer": "4.4",
616
+ * "uniVer": "x",
617
+ * "unixVer": "4.31"
618
+ * },
619
+ * "ios": {
620
+ * "osVer": "12.0",
621
+ * "uniVer": "x",
622
+ * "unixVer": "4.31"
623
+ * },
624
+ * },
625
+ * }
626
+ *
627
+ */
628
+ longitude : number;
629
+ /**
630
+ * 半径
631
+ * @uniPlatform {
632
+ * "app": {
633
+ * "android": {
634
+ * "osVer": "4.4",
635
+ * "uniVer": "x",
636
+ * "unixVer": "4.31"
637
+ * },
638
+ * "ios": {
639
+ * "osVer": "12.0",
640
+ * "uniVer": "x",
641
+ * "unixVer": "4.31"
642
+ * },
643
+ * },
644
+ * }
645
+ *
646
+ */
647
+ radius : number;
648
+ /**
649
+ * 描边的颜色
102
650
  * @defaultValue null
103
- */
104
- complete ?: ((result : any) => void) | null
105
- }
651
+ * @uniPlatform {
652
+ * "app": {
653
+ * "android": {
654
+ * "osVer": "4.4",
655
+ * "uniVer": "x",
656
+ * "unixVer": "4.31"
657
+ * },
658
+ * "ios": {
659
+ * "osVer": "12.0",
660
+ * "uniVer": "x",
661
+ * "unixVer": "4.31"
662
+ * },
663
+ * },
664
+ * }
665
+ *
666
+ */
667
+ color ?: string | null;
668
+ /**
669
+ * 填充颜色
670
+ * @defaultValue null
671
+ * @uniPlatform {
672
+ * "app": {
673
+ * "android": {
674
+ * "osVer": "4.4",
675
+ * "uniVer": "x",
676
+ * "unixVer": "4.31"
677
+ * },
678
+ * "ios": {
679
+ * "osVer": "12.0",
680
+ * "uniVer": "x",
681
+ * "unixVer": "4.31"
682
+ * },
683
+ * },
684
+ * }
685
+ *
686
+ */
687
+ fillColor ?: string | null;
688
+ /**
689
+ * 描边的宽度
690
+ * @defaultValue 0
691
+ * @uniPlatform {
692
+ * "app": {
693
+ * "android": {
694
+ * "osVer": "4.4",
695
+ * "uniVer": "x",
696
+ * "unixVer": "4.31"
697
+ * },
698
+ * "ios": {
699
+ * "osVer": "12.0",
700
+ * "uniVer": "x",
701
+ * "unixVer": "4.31"
702
+ * },
703
+ * },
704
+ * }
705
+ *
706
+ */
707
+ strokeWidth ?: number | null;
708
+ };
106
709
 
710
+ export type ControlPosition = {
711
+ /**
712
+ * 距离地图的左边界多远
713
+ * @defaultValue 0
714
+ * @uniPlatform {
715
+ * "app": {
716
+ * "android": {
717
+ * "osVer": "4.4",
718
+ * "uniVer": "x",
719
+ * "unixVer": "4.31"
720
+ * },
721
+ * "ios": {
722
+ * "osVer": "12.0",
723
+ * "uniVer": "x",
724
+ * "unixVer": "4.31"
725
+ * },
726
+ * },
727
+ * }
728
+ *
729
+ */
730
+ left ?: number | null;
731
+ /**
732
+ * 距离地图的上边界多远
733
+ * @defaultValue 0
734
+ * @uniPlatform {
735
+ * "app": {
736
+ * "android": {
737
+ * "osVer": "4.4",
738
+ * "uniVer": "x",
739
+ * "unixVer": "4.31"
740
+ * },
741
+ * "ios": {
742
+ * "osVer": "12.0",
743
+ * "uniVer": "x",
744
+ * "unixVer": "4.31"
745
+ * },
746
+ * },
747
+ * }
748
+ *
749
+ */
750
+ top ?: number | null;
751
+ /**
752
+ * 控件宽度
753
+ * @defaultValue 0
754
+ * @uniPlatform {
755
+ * "app": {
756
+ * "android": {
757
+ * "osVer": "4.4",
758
+ * "uniVer": "x",
759
+ * "unixVer": "4.31"
760
+ * },
761
+ * "ios": {
762
+ * "osVer": "12.0",
763
+ * "uniVer": "x",
764
+ * "unixVer": "4.31"
765
+ * },
766
+ * },
767
+ * }
768
+ *
769
+ */
770
+ width ?: number | null;
771
+ /**
772
+ * 控件高度
773
+ * @defaultValue 0
774
+ * @uniPlatform {
775
+ * "app": {
776
+ * "android": {
777
+ * "osVer": "4.4",
778
+ * "uniVer": "x",
779
+ * "unixVer": "4.31"
780
+ * },
781
+ * "ios": {
782
+ * "osVer": "12.0",
783
+ * "uniVer": "x",
784
+ * "unixVer": "4.31"
785
+ * },
786
+ * },
787
+ * }
788
+ *
789
+ */
790
+ height ?: number | null;
791
+ };
107
792
 
793
+ export type Control = {
794
+ /**
795
+ * 控件相对地图位置
796
+ * @uniPlatform {
797
+ * "app": {
798
+ * "android": {
799
+ * "osVer": "4.4",
800
+ * "uniVer": "x",
801
+ * "unixVer": "4.31"
802
+ * },
803
+ * "ios": {
804
+ * "osVer": "12.0",
805
+ * "uniVer": "x",
806
+ * "unixVer": "4.31"
807
+ * },
808
+ * },
809
+ * }
810
+ *
811
+ */
812
+ position : ControlPosition;
813
+ /**
814
+ * 项目目录下的图片路径,支持相对路径写法,以'/'开头则表示相对项目根目录;也支持临时路径
815
+ * @uniPlatform {
816
+ * "app": {
817
+ * "android": {
818
+ * "osVer": "4.4",
819
+ * "uniVer": "x",
820
+ * "unixVer": "4.31"
821
+ * },
822
+ * "ios": {
823
+ * "osVer": "12.0",
824
+ * "uniVer": "x",
825
+ * "unixVer": "4.31"
826
+ * },
827
+ * },
828
+ * }
829
+ *
830
+ */
831
+ iconPath : string;
832
+ /**
833
+ * 在控件点击事件回调会返回此id
834
+ * @defaultValue null
835
+ * @uniPlatform {
836
+ * "app": {
837
+ * "android": {
838
+ * "osVer": "4.4",
839
+ * "uniVer": "x",
840
+ * "unixVer": "4.31"
841
+ * },
842
+ * "ios": {
843
+ * "osVer": "12.0",
844
+ * "uniVer": "x",
845
+ * "unixVer": "4.31"
846
+ * },
847
+ * },
848
+ * }
849
+ *
850
+ */
851
+ id ?: number | null;
852
+ /**
853
+ * 默认不可点击
854
+ * @defaultValue false
855
+ * @uniPlatform {
856
+ * "app": {
857
+ * "android": {
858
+ * "osVer": "4.4",
859
+ * "uniVer": "x",
860
+ * "unixVer": "4.31"
861
+ * },
862
+ * "ios": {
863
+ * "osVer": "12.0",
864
+ * "uniVer": "x",
865
+ * "unixVer": "4.31"
866
+ * },
867
+ * },
868
+ * }
869
+ *
870
+ */
871
+ clickable ?: boolean | null;
872
+ };
108
873
 
109
- export type CreateMapContext = (mapId : string, component ?: ComponentPublicInstance | null) => MapContext | null;
874
+ export type Bounds = {
875
+ /**
876
+ * 西南角的经纬度
877
+ * @uniPlatform {
878
+ * "app": {
879
+ * "android": {
880
+ * "osVer": "4.4",
881
+ * "uniVer": "x",
882
+ * "unixVer": "4.31"
883
+ * },
884
+ * "ios": {
885
+ * "osVer": "12.0",
886
+ * "uniVer": "x",
887
+ * "unixVer": "4.31"
888
+ * },
889
+ * },
890
+ * }
891
+ *
892
+ */
893
+ southwest : LocationObject;
894
+ /**
895
+ * 东北角的经纬度
896
+ * @uniPlatform {
897
+ * "app": {
898
+ * "android": {
899
+ * "osVer": "4.4",
900
+ * "uniVer": "x",
901
+ * "unixVer": "4.31"
902
+ * },
903
+ * "ios": {
904
+ * "osVer": "12.0",
905
+ * "uniVer": "x",
906
+ * "unixVer": "4.31"
907
+ * },
908
+ * },
909
+ * }
910
+ *
911
+ */
912
+ northeast : LocationObject;
913
+ };
110
914
 
111
- export type LocationObject = LatLng
915
+ export type CreateMapContext = (
916
+ mapId : string,
917
+ component ?: ComponentPublicInstance | null
918
+ ) => MapContext | null;
112
919
 
113
920
  export type MapContextGetCenterLocationOptions = {
114
921
  /**
115
922
  * 接口调用成功的回调函数
116
- * @defaultValue null
117
923
  */
118
- success ?: ((result : LocationObject) => void) | null
924
+ success ?: ((result : LocationObject) => void) | null;
119
925
  /**
120
926
  * 接口调用失败的回调函数
121
927
  * @defaultValue null
122
928
  */
123
- fail ?: ((result : any) => void) | null
929
+ fail ?: ((result : MapContextFail) => void) | null;
124
930
  /**
125
931
  * 接口调用结束的回调函数(调用成功、失败都会执行)
126
932
  * @defaultValue null
127
933
  */
128
- complete ?: ((result : any) => void) | null
129
- }
934
+ complete ?: ((result : any) => void) | null;
935
+ };
130
936
 
131
937
  export type MapContextMoveToLocationOptions = {
132
-
133
938
  /**
134
939
  * 纬度,浮点数,范围为-90~90,负数表示南纬
135
- */
136
- latitude ?: number | null,
940
+ * @defaultValue null
941
+ * @uniPlatform {
942
+ * "app": {
943
+ * "android": {
944
+ * "osVer": "4.4",
945
+ * "uniVer": "x",
946
+ * "unixVer": "4.31"
947
+ * },
948
+ * "ios": {
949
+ * "osVer": "12.0",
950
+ * "uniVer": "x",
951
+ * "unixVer": "4.31"
952
+ * },
953
+ * },
954
+ * }
955
+ *
956
+ */
957
+ latitude ?: number | null;
137
958
  /**
138
959
  * 经度,范围为-180~180,负数表示西经
139
- */
140
- longitude ?: number | null,
960
+ * @defaultValue null
961
+ * @uniPlatform {
962
+ * "app": {
963
+ * "android": {
964
+ * "osVer": "4.4",
965
+ * "uniVer": "x",
966
+ * "unixVer": "4.31"
967
+ * },
968
+ * "ios": {
969
+ * "osVer": "12.0",
970
+ * "uniVer": "x",
971
+ * "unixVer": "4.31"
972
+ * },
973
+ * },
974
+ * }
975
+ *
976
+ */
977
+ longitude ?: number | null;
141
978
  /**
142
979
  * 接口调用成功的回调函数
143
980
  * @defaultValue null
144
981
  */
145
- success ?: ((result : any) => void) | null
982
+ success ?: ((result : any) => void) | null;
146
983
  /**
147
984
  * 接口调用失败的回调函数
148
985
  * @defaultValue null
149
986
  */
150
- fail ?: ((result : any) => void) | null
987
+ fail ?: ((result : MapContextFail) => void) | null;
151
988
  /**
152
989
  * 接口调用结束的回调函数(调用成功、失败都会执行)
153
990
  * @defaultValue null
154
991
  */
155
- complete ?: ((result : any) => void) | null
156
- }
992
+ complete ?: ((result : any) => void) | null;
993
+ };
157
994
 
158
995
  export type MapContextTranslateMarkerOptions = {
159
996
  /**
160
997
  * 指定marker
161
- */
162
- markerId : number,
998
+ * @uniPlatform {
999
+ * "app": {
1000
+ * "android": {
1001
+ * "osVer": "4.4",
1002
+ * "uniVer": "x",
1003
+ * "unixVer": "4.31"
1004
+ * },
1005
+ * "ios": {
1006
+ * "osVer": "12.0",
1007
+ * "uniVer": "x",
1008
+ * "unixVer": "4.31"
1009
+ * },
1010
+ * },
1011
+ * }
1012
+ *
1013
+ */
1014
+ markerId : number;
163
1015
  /**
164
1016
  * 指定marker移动到的目标点
165
- */
166
- destination : LocationObject,
1017
+ * @uniPlatform {
1018
+ * "app": {
1019
+ * "android": {
1020
+ * "osVer": "4.4",
1021
+ * "uniVer": "x",
1022
+ * "unixVer": "4.31"
1023
+ * },
1024
+ * "ios": {
1025
+ * "osVer": "12.0",
1026
+ * "uniVer": "x",
1027
+ * "unixVer": "4.31"
1028
+ * },
1029
+ * },
1030
+ * }
1031
+ *
1032
+ */
1033
+ destination : LocationObject;
1034
+ /**
1035
+ * 移动过程中是否自动旋转marker
1036
+ * @uniPlatform {
1037
+ * "app": {
1038
+ * "android": {
1039
+ * "osVer": "4.4",
1040
+ * "uniVer": "x",
1041
+ * "unixVer": "x"
1042
+ * },
1043
+ * "ios": {
1044
+ * "osVer": "12.0",
1045
+ * "uniVer": "x",
1046
+ * "unixVer": "x"
1047
+ * },
1048
+ * },
1049
+ * }
1050
+ *
1051
+ */
1052
+ autoRotate ?: boolean | null;
167
1053
  /**
168
1054
  * marker的旋转角度
169
- */
170
- rotate ?: number | null,
171
- /**
172
- * 平移和旋转同时进行,默认值false
173
- */
174
- moveWithRotate ?: boolean | null,
175
- /**
176
- * 动画持续时长,默认值1000ms,平移与旋转分别计算
177
- */
178
- duration ?: number | null,
1055
+ * @defaultValue 0
1056
+ * @uniPlatform {
1057
+ * "app": {
1058
+ * "android": {
1059
+ * "osVer": "4.4",
1060
+ * "uniVer": "x",
1061
+ * "unixVer": "4.31"
1062
+ * },
1063
+ * "ios": {
1064
+ * "osVer": "12.0",
1065
+ * "uniVer": "x",
1066
+ * "unixVer": "4.31"
1067
+ * },
1068
+ * },
1069
+ * }
1070
+ *
1071
+ */
1072
+ rotate ?: number | null;
1073
+ /**
1074
+ * 平移和旋转同时进行
1075
+ * @defaultValue false
1076
+ * @uniPlatform {
1077
+ * "app": {
1078
+ * "android": {
1079
+ * "osVer": "4.4",
1080
+ * "uniVer": "x",
1081
+ * "unixVer": "4.31"
1082
+ * },
1083
+ * "ios": {
1084
+ * "osVer": "12.0",
1085
+ * "uniVer": "x",
1086
+ * "unixVer": "4.31"
1087
+ * },
1088
+ * },
1089
+ * }
1090
+ *
1091
+ */
1092
+ moveWithRotate ?: boolean | null;
1093
+ /**
1094
+ * 动画持续时长,平移与旋转分别计算
1095
+ * @defaultValue 1000
1096
+ * @uniPlatform {
1097
+ * "app": {
1098
+ * "android": {
1099
+ * "osVer": "4.4",
1100
+ * "uniVer": "x",
1101
+ * "unixVer": "4.31"
1102
+ * },
1103
+ * "ios": {
1104
+ * "osVer": "12.0",
1105
+ * "uniVer": "x",
1106
+ * "unixVer": "4.31"
1107
+ * },
1108
+ * },
1109
+ * }
1110
+ *
1111
+ */
1112
+ duration ?: number | null;
179
1113
  /**
180
1114
  * 接口调用成功的回调函数
181
1115
  * @defaultValue null
182
1116
  */
183
- success ?: ((result : any) => void) | null
1117
+ success ?: ((result : any) => void) | null;
184
1118
  /**
185
1119
  * 接口调用失败的回调函数
186
1120
  * @defaultValue null
187
1121
  */
188
- fail ?: ((result : any) => void) | null
1122
+ fail ?: ((result : MapContextFail) => void) | null;
189
1123
  /**
190
1124
  * 接口调用结束的回调函数(调用成功、失败都会执行)
191
1125
  * @defaultValue null
192
1126
  */
193
- complete ?: ((result : any) => void) | null
194
- }
195
-
1127
+ complete ?: ((result : any) => void) | null;
1128
+ };
196
1129
 
197
1130
  export type MapContextIncludePointsOptions = {
198
1131
  /**
199
1132
  * 要显示在可视区域内的坐标点列表,[{latitude, longitude}]
200
- */
201
- points : Array<LocationObject>,
1133
+ * @uniPlatform {
1134
+ * "app": {
1135
+ * "android": {
1136
+ * "osVer": "4.4",
1137
+ * "uniVer": "x",
1138
+ * "unixVer": "4.31"
1139
+ * },
1140
+ * "ios": {
1141
+ * "osVer": "12.0",
1142
+ * "uniVer": "x",
1143
+ * "unixVer": "4.31"
1144
+ * },
1145
+ * },
1146
+ * }
1147
+ *
1148
+ */
1149
+ points : LocationObject[];
202
1150
  /**
203
1151
  * 接口调用成功的回调函数
204
1152
  * @defaultValue null
205
1153
  */
206
- success ?: ((result : any) => void) | null
1154
+ success ?: ((result : any) => void) | null;
207
1155
  /**
208
1156
  * 接口调用失败的回调函数
209
1157
  * @defaultValue null
210
1158
  */
211
- fail ?: ((result : any) => void) | null
1159
+ fail ?: ((result : MapContextFail) => void) | null;
212
1160
  /**
213
1161
  * 接口调用结束的回调函数(调用成功、失败都会执行)
214
1162
  * @defaultValue null
215
1163
  */
216
- complete ?: ((result : any) => void) | null
217
-
218
- }
1164
+ complete ?: ((result : any) => void) | null;
1165
+ };
219
1166
 
220
1167
  export type MapContextGetRegionResult = {
221
1168
  /**
222
1169
  * 西南角的经纬度
223
- */
224
- southwest : LocationObject,
1170
+ * @uniPlatform {
1171
+ * "app": {
1172
+ * "android": {
1173
+ * "osVer": "4.4",
1174
+ * "uniVer": "x",
1175
+ * "unixVer": "4.31"
1176
+ * },
1177
+ * "ios": {
1178
+ * "osVer": "12.0",
1179
+ * "uniVer": "x",
1180
+ * "unixVer": "4.31"
1181
+ * },
1182
+ * },
1183
+ * }
1184
+ *
1185
+ */
1186
+ southwest : LocationObject;
225
1187
  /**
226
1188
  * 东北角的经纬度
227
- */
228
- northeast : LocationObject
229
- }
1189
+ * @uniPlatform {
1190
+ * "app": {
1191
+ * "android": {
1192
+ * "osVer": "4.4",
1193
+ * "uniVer": "x",
1194
+ * "unixVer": "4.31"
1195
+ * },
1196
+ * "ios": {
1197
+ * "osVer": "12.0",
1198
+ * "uniVer": "x",
1199
+ * "unixVer": "4.31"
1200
+ * },
1201
+ * },
1202
+ * }
1203
+ *
1204
+ */
1205
+ northeast : LocationObject;
1206
+ };
230
1207
 
231
1208
  export type MapContextGetRegionOptions = {
232
1209
  /**
233
1210
  * 接口调用成功的回调函数
234
1211
  * @defaultValue null
235
1212
  */
236
- success ?: ((result : MapContextGetRegionResult) => void) | null
1213
+ success ?: ((result : MapContextGetRegionResult) => void) | null;
237
1214
  /**
238
1215
  * 接口调用失败的回调函数
239
1216
  * @defaultValue null
240
1217
  */
241
- fail ?: ((result : any) => void) | null
1218
+ fail ?: ((result : MapContextFail) => void) | null;
242
1219
  /**
243
1220
  * 接口调用结束的回调函数(调用成功、失败都会执行)
244
1221
  * @defaultValue null
245
1222
  */
246
- complete ?: ((result : any) => void) | null
247
- }
1223
+ complete ?: ((result : any) => void) | null;
1224
+ };
248
1225
 
249
1226
  export type MapContextGetScaleResult = {
250
1227
  /**
251
1228
  * 地图缩放级别
252
- */
253
- scale : number
254
- }
1229
+ * @uniPlatform {
1230
+ * "app": {
1231
+ * "android": {
1232
+ * "osVer": "4.4",
1233
+ * "uniVer": "x",
1234
+ * "unixVer": "4.31"
1235
+ * },
1236
+ * "ios": {
1237
+ * "osVer": "12.0",
1238
+ * "uniVer": "x",
1239
+ * "unixVer": "4.31"
1240
+ * },
1241
+ * },
1242
+ * }
1243
+ *
1244
+ */
1245
+ scale : number;
1246
+ };
255
1247
 
256
1248
  export type MapContextGetScaleOptions = {
257
1249
  /**
258
1250
  * 接口调用成功的回调函数
259
1251
  * @defaultValue null
260
1252
  */
261
- success ?: ((result : MapContextGetScaleResult) => void) | null
1253
+ success ?: ((result : MapContextGetScaleResult) => void) | null;
262
1254
  /**
263
1255
  * 接口调用失败的回调函数
264
1256
  * @defaultValue null
265
1257
  */
266
- fail ?: ((result : any) => void) | null
1258
+ fail ?: ((result : MapContextFail) => void) | null;
267
1259
  /**
268
1260
  * 接口调用结束的回调函数(调用成功、失败都会执行)
269
1261
  * @defaultValue null
270
1262
  */
271
- complete ?: ((result : any) => void) | null
272
- }
1263
+ complete ?: ((result : any) => void) | null;
1264
+ };
273
1265
 
274
- export type MapContextAddGroundOverlayOptions = GroundOverlay
1266
+ export type MapContextAddGroundOverlayOptions = {
1267
+ /**
1268
+ * 图片图层 id
1269
+ * @uniPlatform {
1270
+ * "app": {
1271
+ * "android": {
1272
+ * "osVer": "4.4",
1273
+ * "uniVer": "x",
1274
+ * "unixVer": "4.31"
1275
+ * },
1276
+ * "ios": {
1277
+ * "osVer": "12.0",
1278
+ * "uniVer": "x",
1279
+ * "unixVer": "4.31"
1280
+ * },
1281
+ * },
1282
+ * }
1283
+ *
1284
+ */
1285
+ id : string;
1286
+ /**
1287
+ * 图片路径,支持网络图片、临时路径、代码包路径
1288
+ * @uniPlatform {
1289
+ * "app": {
1290
+ * "android": {
1291
+ * "osVer": "4.4",
1292
+ * "uniVer": "x",
1293
+ * "unixVer": "4.31"
1294
+ * },
1295
+ * "ios": {
1296
+ * "osVer": "12.0",
1297
+ * "uniVer": "x",
1298
+ * "unixVer": "4.31"
1299
+ * },
1300
+ * },
1301
+ * }
1302
+ *
1303
+ */
1304
+ src : string;
1305
+ /**
1306
+ * 图片覆盖的经纬度范围
1307
+ * @uniPlatform {
1308
+ * "app": {
1309
+ * "android": {
1310
+ * "osVer": "4.4",
1311
+ * "uniVer": "x",
1312
+ * "unixVer": "4.31"
1313
+ * },
1314
+ * "ios": {
1315
+ * "osVer": "12.0",
1316
+ * "uniVer": "x",
1317
+ * "unixVer": "4.31"
1318
+ * },
1319
+ * },
1320
+ * }
1321
+ *
1322
+ */
1323
+ bounds : Bounds;
1324
+ /**
1325
+ * 是否可见
1326
+ * @defaultValue false
1327
+ * @uniPlatform {
1328
+ * "app": {
1329
+ * "android": {
1330
+ * "osVer": "4.4",
1331
+ * "uniVer": "x",
1332
+ * "unixVer": "4.31"
1333
+ * },
1334
+ * "ios": {
1335
+ * "osVer": "12.0",
1336
+ * "uniVer": "x",
1337
+ * "unixVer": "4.31"
1338
+ * },
1339
+ * },
1340
+ * }
1341
+ *
1342
+ */
1343
+ visible ?: boolean | null;
1344
+ /**
1345
+ * 图层绘制顺序
1346
+ * @defaultValue 0
1347
+ * @uniPlatform {
1348
+ * "app": {
1349
+ * "android": {
1350
+ * "osVer": "4.4",
1351
+ * "uniVer": "x",
1352
+ * "unixVer": "4.31"
1353
+ * },
1354
+ * "ios": {
1355
+ * "osVer": "12.0",
1356
+ * "uniVer": "x",
1357
+ * "unixVer": "4.31"
1358
+ * },
1359
+ * },
1360
+ * }
1361
+ *
1362
+ */
1363
+ zIndex ?: number | null;
1364
+ /**
1365
+ * 图层透明度
1366
+ * @defaultValue 1
1367
+ * @uniPlatform {
1368
+ * "app": {
1369
+ * "android": {
1370
+ * "osVer": "4.4",
1371
+ * "uniVer": "x",
1372
+ * "unixVer": "4.31"
1373
+ * },
1374
+ * "ios": {
1375
+ * "osVer": "12.0",
1376
+ * "uniVer": "x",
1377
+ * "unixVer": "4.31"
1378
+ * },
1379
+ * },
1380
+ * }
1381
+ *
1382
+ */
1383
+ opacity ?: number | null;
1384
+
1385
+ /**
1386
+ * 接口调用成功的回调函数
1387
+ * @defaultValue null
1388
+ */
1389
+ success ?: ((result : any) => void) | null;
1390
+ /**
1391
+ * 接口调用失败的回调函数
1392
+ * @defaultValue null
1393
+ */
1394
+ fail ?: ((result : MapContextFail) => void) | null;
1395
+ /**
1396
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1397
+ * @defaultValue null
1398
+ */
1399
+ complete ?: ((result : any) => void) | null;
1400
+ };
275
1401
 
276
1402
  export type MapContextAddMarkersOptions = {
277
1403
  /**
278
1404
  * 同传入 map 组件的 marker 属性
279
- */
280
- markers : Array<Marker>,
1405
+ * @uniPlatform {
1406
+ * "app": {
1407
+ * "android": {
1408
+ * "osVer": "4.4",
1409
+ * "uniVer": "x",
1410
+ * "unixVer": "4.31"
1411
+ * },
1412
+ * "ios": {
1413
+ * "osVer": "12.0",
1414
+ * "uniVer": "x",
1415
+ * "unixVer": "4.31"
1416
+ * },
1417
+ * },
1418
+ * }
1419
+ *
1420
+ */
1421
+ markers : Marker[];
281
1422
  /**
282
1423
  * 是否先清空地图上所有 marker
283
- */
284
- clear : boolean,
1424
+ * @uniPlatform {
1425
+ * "app": {
1426
+ * "android": {
1427
+ * "osVer": "4.4",
1428
+ * "uniVer": "x",
1429
+ * "unixVer": "4.31"
1430
+ * },
1431
+ * "ios": {
1432
+ * "osVer": "12.0",
1433
+ * "uniVer": "x",
1434
+ * "unixVer": "4.31"
1435
+ * },
1436
+ * },
1437
+ * }
1438
+ *
1439
+ */
1440
+ clear : boolean;
285
1441
  /**
286
1442
  * 接口调用成功的回调函数
287
1443
  * @defaultValue null
288
1444
  */
289
- success ?: ((result : any) => void) | null
1445
+ success ?: ((result : any) => void) | null;
290
1446
  /**
291
1447
  * 接口调用失败的回调函数
292
1448
  * @defaultValue null
293
1449
  */
294
- fail ?: ((result : any) => void) | null
1450
+ fail ?: ((result : MapContextFail) => void) | null;
295
1451
  /**
296
1452
  * 接口调用结束的回调函数(调用成功、失败都会执行)
297
1453
  * @defaultValue null
298
1454
  */
299
- complete ?: ((result : any) => void) | null
300
- }
1455
+ complete ?: ((result : any) => void) | null;
1456
+ };
301
1457
 
302
1458
  export type MapContextMoveAlongOptions = {
303
1459
  /**
304
1460
  * 指定marker
305
- */
306
- markerId : number,
1461
+ * @uniPlatform {
1462
+ * "app": {
1463
+ * "android": {
1464
+ * "osVer": "4.4",
1465
+ * "uniVer": "x",
1466
+ * "unixVer": "4.31"
1467
+ * },
1468
+ * "ios": {
1469
+ * "osVer": "12.0",
1470
+ * "uniVer": "x",
1471
+ * "unixVer": "4.31"
1472
+ * },
1473
+ * },
1474
+ * }
1475
+ *
1476
+ */
1477
+ markerId : number;
307
1478
  /**
308
1479
  * 移动路径的坐标串,坐标点格式 {longitude, latitude}
309
- */
310
- path : Array<LocationObject>,
1480
+ * @uniPlatform {
1481
+ * "app": {
1482
+ * "android": {
1483
+ * "osVer": "4.4",
1484
+ * "uniVer": "x",
1485
+ * "unixVer": "4.31"
1486
+ * },
1487
+ * "ios": {
1488
+ * "osVer": "12.0",
1489
+ * "uniVer": "x",
1490
+ * "unixVer": "4.31"
1491
+ * },
1492
+ * },
1493
+ * }
1494
+ *
1495
+ */
1496
+ path : LocationObject[];
311
1497
  /**
312
1498
  * 平滑移动的时间
313
- */
314
- duration ?: number | null,
1499
+ * @defaultValue 1000
1500
+ * @uniPlatform {
1501
+ * "app": {
1502
+ * "android": {
1503
+ * "osVer": "4.4",
1504
+ * "uniVer": "x",
1505
+ * "unixVer": "4.31"
1506
+ * },
1507
+ * "ios": {
1508
+ * "osVer": "12.0",
1509
+ * "uniVer": "x",
1510
+ * "unixVer": "4.31"
1511
+ * },
1512
+ * },
1513
+ * }
1514
+ *
1515
+ */
1516
+ duration ?: number | null;
315
1517
  /**
316
1518
  * 接口调用成功的回调函数
317
1519
  * @defaultValue null
318
1520
  */
319
- success ?: ((result : any) => void) | null
1521
+ success ?: ((result : any) => void) | null;
320
1522
  /**
321
1523
  * 接口调用失败的回调函数
322
1524
  * @defaultValue null
323
1525
  */
324
- fail ?: ((result : any) => void) | null
1526
+ fail ?: ((result : MapContextFail) => void) | null;
325
1527
  /**
326
1528
  * 接口调用结束的回调函数(调用成功、失败都会执行)
327
1529
  * @defaultValue null
328
1530
  */
329
- complete ?: ((result : any) => void) | null
330
-
331
- }
332
-
1531
+ complete ?: ((result : any) => void) | null;
1532
+ };
333
1533
 
334
1534
  export type MapContextRemoveGroundOverlayOptions = {
335
1535
  /**
336
1536
  * 图片图层 id
337
- */
338
- id : string,
1537
+ * @uniPlatform {
1538
+ * "app": {
1539
+ * "android": {
1540
+ * "osVer": "4.4",
1541
+ * "uniVer": "x",
1542
+ * "unixVer": "4.31"
1543
+ * },
1544
+ * "ios": {
1545
+ * "osVer": "12.0",
1546
+ * "uniVer": "x",
1547
+ * "unixVer": "4.31"
1548
+ * },
1549
+ * },
1550
+ * }
1551
+ *
1552
+ */
1553
+ id : string;
339
1554
  /**
340
1555
  * 接口调用成功的回调函数
341
1556
  * @defaultValue null
342
1557
  */
343
- success ?: ((result : any) => void) | null
1558
+ success ?: ((result : any) => void) | null;
344
1559
  /**
345
1560
  * 接口调用失败的回调函数
346
1561
  * @defaultValue null
347
1562
  */
348
- fail ?: ((result : any) => void) | null
1563
+ fail ?: ((result : MapContextFail) => void) | null;
349
1564
  /**
350
1565
  * 接口调用结束的回调函数(调用成功、失败都会执行)
351
1566
  * @defaultValue null
352
1567
  */
353
- complete ?: ((result : any) => void) | null
354
- }
1568
+ complete ?: ((result : any) => void) | null;
1569
+ };
355
1570
 
356
1571
  export type MapContextRemoveMarkersOptions = {
357
1572
  /**
358
1573
  * 要被删除的marker的id属性组成的数组
1574
+ * @uniPlatform {
1575
+ * "app": {
1576
+ * "android": {
1577
+ * "osVer": "4.4",
1578
+ * "uniVer": "x",
1579
+ * "unixVer": "4.31"
1580
+ * },
1581
+ * "ios": {
1582
+ * "osVer": "12.0",
1583
+ * "uniVer": "x",
1584
+ * "unixVer": "4.31"
1585
+ * },
1586
+ * },
1587
+ * }
1588
+ *
1589
+ */
1590
+ markerIds : number[];
1591
+ /**
1592
+ * 接口调用成功的回调函数
1593
+ * @defaultValue null
359
1594
  */
360
- markerIds : Array<number>,
1595
+ success ?: ((result : any) => void) | null;
1596
+ /**
1597
+ * 接口调用失败的回调函数
1598
+ * @defaultValue null
1599
+ */
1600
+ fail ?: ((result : MapContextFail) => void) | null;
1601
+ /**
1602
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1603
+ * @defaultValue null
1604
+ */
1605
+ complete ?: ((result : any) => void) | null;
1606
+ };
1607
+
1608
+ export type MapContextUpdateGroundOverlayOptions = {
1609
+ /**
1610
+ * 图片图层 id
1611
+ * @uniPlatform {
1612
+ * "app": {
1613
+ * "android": {
1614
+ * "osVer": "4.4",
1615
+ * "uniVer": "x",
1616
+ * "unixVer": "4.31"
1617
+ * },
1618
+ * "ios": {
1619
+ * "osVer": "12.0",
1620
+ * "uniVer": "x",
1621
+ * "unixVer": "4.31"
1622
+ * },
1623
+ * },
1624
+ * }
1625
+ *
1626
+ */
1627
+ id : string;
1628
+ /**
1629
+ * 图片路径,支持网络图片、临时路径、代码包路径
1630
+ * @uniPlatform {
1631
+ * "app": {
1632
+ * "android": {
1633
+ * "osVer": "4.4",
1634
+ * "uniVer": "x",
1635
+ * "unixVer": "4.31"
1636
+ * },
1637
+ * "ios": {
1638
+ * "osVer": "12.0",
1639
+ * "uniVer": "x",
1640
+ * "unixVer": "4.31"
1641
+ * },
1642
+ * },
1643
+ * }
1644
+ *
1645
+ */
1646
+ src : string;
1647
+ /**
1648
+ * 图片覆盖的经纬度范围
1649
+ * @uniPlatform {
1650
+ * "app": {
1651
+ * "android": {
1652
+ * "osVer": "4.4",
1653
+ * "uniVer": "x",
1654
+ * "unixVer": "4.31"
1655
+ * },
1656
+ * "ios": {
1657
+ * "osVer": "12.0",
1658
+ * "uniVer": "x",
1659
+ * "unixVer": "4.31"
1660
+ * },
1661
+ * },
1662
+ * }
1663
+ *
1664
+ */
1665
+ bounds : Bounds;
1666
+ /**
1667
+ * 是否可见
1668
+ * @defaultValue true
1669
+ * @uniPlatform {
1670
+ * "app": {
1671
+ * "android": {
1672
+ * "osVer": "4.4",
1673
+ * "uniVer": "x",
1674
+ * "unixVer": "4.31"
1675
+ * },
1676
+ * "ios": {
1677
+ * "osVer": "12.0",
1678
+ * "uniVer": "x",
1679
+ * "unixVer": "4.31"
1680
+ * },
1681
+ * },
1682
+ * }
1683
+ *
1684
+ */
1685
+ visible ?: boolean | null;
1686
+ /**
1687
+ * 图层绘制顺序
1688
+ * @defaultValue 0
1689
+ * @uniPlatform {
1690
+ * "app": {
1691
+ * "android": {
1692
+ * "osVer": "4.4",
1693
+ * "uniVer": "x",
1694
+ * "unixVer": "4.31"
1695
+ * },
1696
+ * "ios": {
1697
+ * "osVer": "12.0",
1698
+ * "uniVer": "x",
1699
+ * "unixVer": "4.31"
1700
+ * },
1701
+ * },
1702
+ * }
1703
+ *
1704
+ */
1705
+ zIndex ?: number | null;
1706
+ /**
1707
+ * 图层透明度
1708
+ * @defaultValue 1
1709
+ * @uniPlatform {
1710
+ * "app": {
1711
+ * "android": {
1712
+ * "osVer": "4.4",
1713
+ * "uniVer": "x",
1714
+ * "unixVer": "4.31"
1715
+ * },
1716
+ * "ios": {
1717
+ * "osVer": "12.0",
1718
+ * "uniVer": "x",
1719
+ * "unixVer": "4.31"
1720
+ * },
1721
+ * },
1722
+ * }
1723
+ *
1724
+ */
1725
+ opacity ?: number | null;
1726
+
361
1727
  /**
362
1728
  * 接口调用成功的回调函数
363
1729
  * @defaultValue null
364
1730
  */
365
- success ?: ((result : any) => void) | null
1731
+ success ?: ((result : any) => void) | null;
366
1732
  /**
367
1733
  * 接口调用失败的回调函数
368
1734
  * @defaultValue null
369
1735
  */
370
- fail ?: ((result : any) => void) | null
1736
+ fail ?: ((result : MapContextFail) => void) | null;
371
1737
  /**
372
1738
  * 接口调用结束的回调函数(调用成功、失败都会执行)
373
1739
  * @defaultValue null
374
1740
  */
375
- complete ?: ((result : any) => void) | null
376
- }
1741
+ complete ?: ((result : any) => void) | null;
1742
+ };
377
1743
 
378
- export type MapContextUpdateGroundOverlayOptions = GroundOverlay
379
1744
 
380
- export interface MapContext {
1745
+ /**
1746
+ * 错误码
1747
+ */
1748
+ export type MapErrorCode =
1749
+ /**
1750
+ * 获取当前地图中心的经纬度失败
1751
+ */
1752
+ 500001 |
1753
+ /**
1754
+ * 未找到当前定位位置
1755
+ */
1756
+ 500002 |
1757
+ /**
1758
+ * 未找到marker
1759
+ */
1760
+ 500003 |
1761
+ /**
1762
+ * 创建自定义图片图层失败
1763
+ */
1764
+ 500004 |
1765
+ /**
1766
+ * 未找到自定义图层id
1767
+ */
1768
+ 500005 |
1769
+ /**
1770
+ * 网络图片加载失败
1771
+ */
1772
+ 500006 |
1773
+ /**
1774
+ * 地图内部错误
1775
+ */
1776
+ 500012;
381
1777
 
1778
+ /**
1779
+ * MapContext API调用失败
1780
+ */
1781
+ export interface MapContextFail extends IUniError {
1782
+ errCode : MapErrorCode
1783
+ };
1784
+
1785
+ export interface MapContext {
382
1786
  /**
383
1787
  * 获取当前地图中心的经纬度,返回的是 gcj02 坐标系,可以用于 uni.openLocation
384
- */
385
- getCenterLocation(options : MapContextGetCenterLocationOptions) : void
1788
+ * @uniPlatform {
1789
+ * "app": {
1790
+ * "android": {
1791
+ * "osVer": "4.4",
1792
+ * "uniVer": "x",
1793
+ * "unixVer": "4.31"
1794
+ * },
1795
+ * "ios": {
1796
+ * "osVer": "12.0",
1797
+ * "uniVer": "x",
1798
+ * "unixVer": "4.31"
1799
+ * },
1800
+ * },
1801
+ * }
1802
+ *
1803
+ */
1804
+ getCenterLocation(options : MapContextGetCenterLocationOptions) : void;
386
1805
 
387
1806
  /**
388
1807
  * 将地图中心移动到当前定位点,需要配合map组件的show-location使用
389
- */
390
- moveToLocation(options : MapContextMoveToLocationOptions) : void
1808
+ * @uniPlatform {
1809
+ * "app": {
1810
+ * "android": {
1811
+ * "osVer": "4.4",
1812
+ * "uniVer": "x",
1813
+ * "unixVer": "4.31"
1814
+ * },
1815
+ * "ios": {
1816
+ * "osVer": "12.0",
1817
+ * "uniVer": "x",
1818
+ * "unixVer": "4.31"
1819
+ * },
1820
+ * },
1821
+ * }
1822
+ *
1823
+ */
1824
+ moveToLocation(options : MapContextMoveToLocationOptions) : void;
391
1825
 
392
1826
  /**
393
1827
  * 平移marker,带动画
1828
+ * @uniPlatform {
1829
+ * "app": {
1830
+ * "android": {
1831
+ * "osVer": "4.4",
1832
+ * "uniVer": "x",
1833
+ * "unixVer": "4.31"
1834
+ * },
1835
+ * "ios": {
1836
+ * "osVer": "12.0",
1837
+ * "uniVer": "x",
1838
+ * "unixVer": "4.31"
1839
+ * },
1840
+ * },
1841
+ * }
1842
+ *
394
1843
  */
395
1844
  translateMarker(options : MapContextTranslateMarkerOptions) : void;
396
1845
 
397
1846
  /**
398
- * 缩放视野展示所有经纬度
1847
+ * 缩放视野展示所有经纬度
1848
+ * @uniPlatform {
1849
+ * "app": {
1850
+ * "android": {
1851
+ * "osVer": "4.4",
1852
+ * "uniVer": "x",
1853
+ * "unixVer": "4.31"
1854
+ * },
1855
+ * "ios": {
1856
+ * "osVer": "12.0",
1857
+ * "uniVer": "x",
1858
+ * "unixVer": "4.31"
1859
+ * },
1860
+ * },
1861
+ * }
1862
+ *
399
1863
  */
400
1864
  includePoints(options : MapContextIncludePointsOptions) : void;
401
1865
 
402
1866
  /**
403
1867
  * 获取当前地图的视野范围
1868
+ * @uniPlatform {
1869
+ * "app": {
1870
+ * "android": {
1871
+ * "osVer": "4.4",
1872
+ * "uniVer": "x",
1873
+ * "unixVer": "4.31"
1874
+ * },
1875
+ * "ios": {
1876
+ * "osVer": "12.0",
1877
+ * "uniVer": "x",
1878
+ * "unixVer": "4.31"
1879
+ * },
1880
+ * },
1881
+ * }
1882
+ *
404
1883
  */
405
1884
  getRegion(options : MapContextGetRegionOptions) : void;
406
1885
 
407
1886
  /**
408
1887
  * 获取当前地图的缩放级别
1888
+ * @uniPlatform {
1889
+ * "app": {
1890
+ * "android": {
1891
+ * "osVer": "4.4",
1892
+ * "uniVer": "x",
1893
+ * "unixVer": "4.31"
1894
+ * },
1895
+ * "ios": {
1896
+ * "osVer": "12.0",
1897
+ * "uniVer": "x",
1898
+ * "unixVer": "4.31"
1899
+ * },
1900
+ * },
1901
+ * }
1902
+ *
409
1903
  */
410
1904
  getScale(options : MapContextGetScaleOptions) : void;
411
1905
 
412
1906
  /**
413
1907
  * 创建自定义图片图层,图片会随着地图缩放而缩放
1908
+ * @uniPlatform {
1909
+ * "app": {
1910
+ * "android": {
1911
+ * "osVer": "4.4",
1912
+ * "uniVer": "x",
1913
+ * "unixVer": "4.31"
1914
+ * },
1915
+ * "ios": {
1916
+ * "osVer": "12.0",
1917
+ * "uniVer": "x",
1918
+ * "unixVer": "4.31"
1919
+ * },
1920
+ * },
1921
+ * }
1922
+ *
414
1923
  */
415
1924
  addGroundOverlay(options : MapContextAddGroundOverlayOptions) : void;
416
1925
 
417
1926
  /**
418
- * 创建自定义图片图层,图片会随着地图缩放而缩放
1927
+ * 添加 marker
1928
+ * @uniPlatform {
1929
+ * "app": {
1930
+ * "android": {
1931
+ * "osVer": "4.4",
1932
+ * "uniVer": "x",
1933
+ * "unixVer": "4.31"
1934
+ * },
1935
+ * "ios": {
1936
+ * "osVer": "12.0",
1937
+ * "uniVer": "x",
1938
+ * "unixVer": "4.31"
1939
+ * },
1940
+ * },
1941
+ * }
1942
+ *
419
1943
  */
420
1944
  addMarkers(options : MapContextAddMarkersOptions) : void;
421
1945
 
@@ -423,6 +1947,21 @@ export interface MapContext {
423
1947
 
424
1948
  /**
425
1949
  * 沿指定路径移动 marker,用于轨迹回放等场景。动画完成时触发回调事件,若动画进行中,对同一 marker 再次调用 moveAlong 方法,前一次的动画将被打断。
1950
+ * @uniPlatform {
1951
+ * "app": {
1952
+ * "android": {
1953
+ * "osVer": "4.4",
1954
+ * "uniVer": "x",
1955
+ * "unixVer": "4.31"
1956
+ * },
1957
+ * "ios": {
1958
+ * "osVer": "12.0",
1959
+ * "uniVer": "x",
1960
+ * "unixVer": "4.31"
1961
+ * },
1962
+ * },
1963
+ * }
1964
+ *
426
1965
  */
427
1966
  moveAlong(options : MapContextMoveAlongOptions) : void;
428
1967
 
@@ -430,16 +1969,61 @@ export interface MapContext {
430
1969
 
431
1970
  /**
432
1971
  * 移除自定义图片图层
1972
+ * @uniPlatform {
1973
+ * "app": {
1974
+ * "android": {
1975
+ * "osVer": "4.4",
1976
+ * "uniVer": "x",
1977
+ * "unixVer": "4.31"
1978
+ * },
1979
+ * "ios": {
1980
+ * "osVer": "12.0",
1981
+ * "uniVer": "x",
1982
+ * "unixVer": "4.31"
1983
+ * },
1984
+ * },
1985
+ * }
1986
+ *
433
1987
  */
434
1988
  removeGroundOverlay(options : MapContextRemoveGroundOverlayOptions) : void;
435
1989
 
436
1990
  /**
437
1991
  * 移除 marker
1992
+ * @uniPlatform {
1993
+ * "app": {
1994
+ * "android": {
1995
+ * "osVer": "4.4",
1996
+ * "uniVer": "x",
1997
+ * "unixVer": "4.31"
1998
+ * },
1999
+ * "ios": {
2000
+ * "osVer": "12.0",
2001
+ * "uniVer": "x",
2002
+ * "unixVer": "4.31"
2003
+ * },
2004
+ * },
2005
+ * }
2006
+ *
438
2007
  */
439
2008
  removeMarkers(options : MapContextRemoveMarkersOptions) : void;
440
2009
 
441
2010
  /**
442
2011
  * 更新自定义图片图层。
2012
+ * @uniPlatform {
2013
+ * "app": {
2014
+ * "android": {
2015
+ * "osVer": "4.4",
2016
+ * "uniVer": "x",
2017
+ * "unixVer": "4.31"
2018
+ * },
2019
+ * "ios": {
2020
+ * "osVer": "12.0",
2021
+ * "uniVer": "x",
2022
+ * "unixVer": "4.31"
2023
+ * },
2024
+ * },
2025
+ * }
2026
+ *
443
2027
  */
444
2028
  updateGroundOverlay(options : MapContextUpdateGroundOverlayOptions) : void;
445
2029
 
@@ -449,6 +2033,27 @@ export interface MapContext {
449
2033
  export interface Uni {
450
2034
  /**
451
2035
  * 创建并返回 map 上下文 mapContext 对象
452
- */
453
- createMapContext : CreateMapContext
2036
+ * @uniPlatform {
2037
+ * "app": {
2038
+ * "android": {
2039
+ * "osVer": "4.4",
2040
+ * "uniVer": "x",
2041
+ * "unixVer": "4.31"
2042
+ * },
2043
+ * "ios": {
2044
+ * "osVer": "12.0",
2045
+ * "uniVer": "x",
2046
+ * "unixVer": "4.31"
2047
+ * },
2048
+ * },
2049
+ * }
2050
+ * @uniVueVersion 2,3
2051
+ * @return {MapContext} map组件上下文对象
2052
+ *
2053
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/location/map.html#createmapcontext
2054
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/create-map-context.html
2055
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/create-map-context.html
2056
+ *
2057
+ */
2058
+ createMapContext : CreateMapContext;
454
2059
  }