@heycar/heycars-map 0.11.0-google3 → 1.0.0-coordinate

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 (104) hide show
  1. package/README.md +97 -39
  2. package/dist/v2/Demo/DemoBusinessQuoting.js +6 -4
  3. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +36 -3
  4. package/dist/v2/Demo/DemoBusinessReselectPlace.js +37 -3
  5. package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +3 -12
  6. package/dist/v2/Demo/DemoBusinessTaxiEnd.js +8 -4
  7. package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +4 -4
  8. package/dist/v2/Demo/DemoBusinessTaxiService.js +10 -5
  9. package/dist/v2/api/browser.d.ts +3 -3
  10. package/dist/v2/api/browser.js +2 -2
  11. package/dist/v2/api/googleSnapRoad.d.ts +2 -1
  12. package/dist/v2/api/googleSnapRoad.js +23 -9
  13. package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +7 -6
  14. package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +11 -5
  15. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +12 -11
  16. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +37 -25
  17. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +3 -2
  18. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
  19. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +31 -21
  20. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +9 -5
  21. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +7 -5
  22. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +13 -5
  23. package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.js +1 -3
  24. package/dist/v2/hooks/useGeoLocation.d.ts +4 -12
  25. package/dist/v2/hooks/useGeoLocation.js +7 -7
  26. package/dist/v2/hooks/useMapCoordinatify.d.ts +15 -0
  27. package/dist/v2/hooks/useMapCoordinatify.js +95 -0
  28. package/dist/v2/hooks/useMapGCJ02.d.ts +10 -1
  29. package/dist/v2/hooks/useMapGCJ02.js +35 -21
  30. package/dist/v2/hooks/useMapGraspRoad.d.ts +2 -11
  31. package/dist/v2/hooks/useMapGraspRoad.js +23 -36
  32. package/dist/v2/hooks/useMapInChina.d.ts +7 -1
  33. package/dist/v2/hooks/useMapInChina.js +1156 -4
  34. package/dist/v2/hooks/useMapRecomendPlace.d.ts +1 -1
  35. package/dist/v2/hooks/useMapRecomendPlace.js +4 -10
  36. package/dist/v2/hooks-business/useBusinessAlarm.d.ts +1 -0
  37. package/dist/v2/hooks-business/useBusinessAlarm.js +41 -1
  38. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.d.ts +19 -13
  39. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -0
  40. package/dist/v2/hooks-business/useBusinessReselectPlaceMap.d.ts +9 -3
  41. package/dist/v2/types/coordinatify.d.ts +14 -0
  42. package/dist/v2/types/coordinatify.js +1 -0
  43. package/dist/v2/types/helper.js +3 -2
  44. package/dist/v2/types/interface.d.ts +34 -0
  45. package/dist/v2/utils/helper.d.ts +1 -2
  46. package/dist/v2/utils/helper.js +0 -4
  47. package/dist/v2/utils/log.js +1 -1
  48. package/dist/v2/utils/transform.d.ts +2 -40
  49. package/dist/v2/utils/transform.js +0 -88
  50. package/dist/v2/utils/typeChecking.d.ts +40 -0
  51. package/dist/v2/utils/typeChecking.js +91 -0
  52. package/dist/v3/Demo/DemoBusinessQuoting.js +6 -4
  53. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +36 -3
  54. package/dist/v3/Demo/DemoBusinessReselectPlace.js +37 -3
  55. package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +3 -12
  56. package/dist/v3/Demo/DemoBusinessTaxiEnd.js +8 -4
  57. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +4 -4
  58. package/dist/v3/Demo/DemoBusinessTaxiService.js +10 -5
  59. package/dist/v3/api/browser.d.ts +3 -3
  60. package/dist/v3/api/browser.js +2 -2
  61. package/dist/v3/api/googleSnapRoad.d.ts +2 -1
  62. package/dist/v3/api/googleSnapRoad.js +23 -9
  63. package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +8 -7
  64. package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +11 -5
  65. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +13 -12
  66. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +37 -25
  67. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +3 -2
  68. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +3 -3
  69. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +31 -21
  70. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +9 -5
  71. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +8 -6
  72. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +13 -5
  73. package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.js +1 -3
  74. package/dist/v3/hooks/useGeoLocation.d.ts +4 -12
  75. package/dist/v3/hooks/useGeoLocation.js +7 -7
  76. package/dist/v3/hooks/useMapCoordinatify.d.ts +15 -0
  77. package/dist/v3/hooks/useMapCoordinatify.js +95 -0
  78. package/dist/v3/hooks/useMapGCJ02.d.ts +10 -1
  79. package/dist/v3/hooks/useMapGCJ02.js +35 -21
  80. package/dist/v3/hooks/useMapGraspRoad.d.ts +2 -11
  81. package/dist/v3/hooks/useMapGraspRoad.js +23 -36
  82. package/dist/v3/hooks/useMapInChina.d.ts +7 -1
  83. package/dist/v3/hooks/useMapInChina.js +1156 -4
  84. package/dist/v3/hooks/useMapRecomendPlace.d.ts +1 -1
  85. package/dist/v3/hooks/useMapRecomendPlace.js +4 -10
  86. package/dist/v3/hooks-business/useBusinessAlarm.d.ts +1 -0
  87. package/dist/v3/hooks-business/useBusinessAlarm.js +41 -1
  88. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.d.ts +19 -13
  89. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -0
  90. package/dist/v3/hooks-business/useBusinessReselectPlaceMap.d.ts +9 -3
  91. package/dist/v3/types/coordinatify.d.ts +14 -0
  92. package/dist/v3/types/coordinatify.js +1 -0
  93. package/dist/v3/types/helper.js +3 -2
  94. package/dist/v3/types/interface.d.ts +34 -0
  95. package/dist/v3/utils/helper.d.ts +1 -2
  96. package/dist/v3/utils/helper.js +0 -4
  97. package/dist/v3/utils/log.js +1 -1
  98. package/dist/v3/utils/transform.d.ts +2 -40
  99. package/dist/v3/utils/transform.js +0 -88
  100. package/dist/v3/utils/typeChecking.d.ts +40 -0
  101. package/dist/v3/utils/typeChecking.js +91 -0
  102. package/package.json +2 -1
  103. package/dist/v2/chunks/isArray.16337f6b.js +0 -5
  104. package/dist/v3/chunks/isArray.16337f6b.js +0 -5
package/README.md CHANGED
@@ -40,24 +40,50 @@ body {
40
40
  常用数据结构
41
41
 
42
42
  ```typescript
43
- export type Point = [number, number];
43
+ export type CoordinateType = "wgs84" | "gcj02" | "bd09";
44
44
 
45
- export type Place = {
45
+ export type CoordinatePoint = {
46
46
  lng: number;
47
47
  lat: number;
48
+ type: CoordinateType;
49
+ };
50
+
51
+ export type CoordinatePlace = {
52
+ lng: number;
53
+ lat: number;
54
+ type: CoordinateType;
48
55
  name: string;
49
56
  displayName: string;
50
57
  };
51
58
 
52
- export interface Zone {
59
+ export interface CoordinateZone {
53
60
  name: string;
54
- path: Point[];
61
+ path: CoordinatePoint[];
55
62
  }
56
63
 
57
- export interface RecommendZonePlaces {
64
+ export interface CoordinateRecommendZonePlaces {
65
+ // 是否强制吸附
66
+ adsorption?: boolean;
67
+ // 是否强制推荐点
68
+ force?: boolean;
69
+ // 是否可以提供服务
58
70
  available?: boolean;
59
- zone?: Zone;
60
- places?: Place[];
71
+ zone?: CoordinateZone;
72
+ places?: CoordinatePlace[];
73
+ }
74
+
75
+ export interface CoordinateGeoPosition {
76
+ position: CoordinatePoint;
77
+ coords?: GeolocationCoordinates;
78
+ }
79
+
80
+ export interface CoordinateTrackPoint {
81
+ lng: number;
82
+ lat: number;
83
+ type: CoordinateType;
84
+ angle?: number;
85
+ speed?: number;
86
+ timestamp: number;
61
87
  }
62
88
 
63
89
  export enum CenterPlaceStatus {
@@ -143,6 +169,7 @@ export default defineComponent({
143
169
  place: {
144
170
  lng: 139.56,
145
171
  lat: 35.56,
172
+ type: "gcj02",
146
173
  name: "user specified place in zone",
147
174
  displayName: "user specified place in zone",
148
175
  },
@@ -152,9 +179,9 @@ export default defineComponent({
152
179
  zone: {
153
180
  name: "zone 1",
154
181
  path: [
155
- [139.569, 35.555],
156
- [139.558, 35.55],
157
- [139.56, 35.565],
182
+ { lng: 139.569, lat: 35.555, type: "gcj02" },
183
+ { lng: 139.558, lat: 35.55, type: "gcj02" },
184
+ { lng: 139.56, lat: 35.565, type: "gcj02" },
158
185
  ],
159
186
  },
160
187
  // 绿区内的推荐点列表
@@ -162,12 +189,14 @@ export default defineComponent({
162
189
  {
163
190
  lng: 139.56,
164
191
  lat: 35.56,
192
+ type: "gcj02",
165
193
  name: "user specified place in zone",
166
194
  displayName: "user specified place in zone",
167
195
  },
168
196
  {
169
197
  lng: 139.562,
170
198
  lat: 35.562,
199
+ type: "gcj02",
171
200
  name: "recommend place 2",
172
201
  displayName: "recommend place 2",
173
202
  },
@@ -188,6 +217,7 @@ export default defineComponent({
188
217
  place ?? {
189
218
  lng: 139.777777,
190
219
  lat: 35.777777,
220
+ type: "gcj02",
191
221
  name: "default place name",
192
222
  displayName: "default place displayName",
193
223
  }
@@ -262,6 +292,7 @@ export default defineComponent({
262
292
  place: {
263
293
  lng: 139.56,
264
294
  lat: 35.56,
295
+ type: "gcj02",
265
296
  name: "user specified place in zone",
266
297
  displayName: "user specified place in zone",
267
298
  },
@@ -271,9 +302,9 @@ export default defineComponent({
271
302
  zone: {
272
303
  name: "zone 1",
273
304
  path: [
274
- [139.569, 35.555],
275
- [139.558, 35.55],
276
- [139.56, 35.565],
305
+ { lng: 139.569, lat: 35.555, type: "gcj02" },
306
+ { lng: 139.558, lat: 35.55, type: "gcj02" },
307
+ { lng: 139.56, lat: 35.565, type: "gcj02" },
277
308
  ],
278
309
  },
279
310
  // 绿区内的推荐点列表
@@ -281,12 +312,14 @@ export default defineComponent({
281
312
  {
282
313
  lng: 139.56,
283
314
  lat: 35.56,
315
+ type: "gcj02",
284
316
  name: "user specified place in zone",
285
317
  displayName: "user specified place in zone",
286
318
  },
287
319
  {
288
320
  lng: 139.562,
289
321
  lat: 35.562,
322
+ type: "gcj02",
290
323
  name: "recommend place 2",
291
324
  displayName: "recommend place 2",
292
325
  },
@@ -307,11 +340,12 @@ export default defineComponent({
307
340
  defaultPlace={{
308
341
  lng: 139.777777,
309
342
  lat: 35.777777,
343
+ type: "gcj02",
310
344
  name: "default place name",
311
345
  displayName: "default place display name",
312
346
  }}
313
347
  getAvailable={() => Promise.resolve(true)}
314
- getRecomendPlace={async ({ lng, lat }) => {
348
+ getRecomendPlace={async ({ lng, lat, type }) => {
315
349
  // 向后端获取推荐点信息
316
350
  return {
317
351
  // 服务是否可用
@@ -320,16 +354,34 @@ export default defineComponent({
320
354
  zone: {
321
355
  name: "绿区名称",
322
356
  path: [
323
- [lng - 0.001, lat + 0.001],
324
- [lng, lat - 0.001],
325
- [lng + 0.001, lat + 0.0005],
357
+ { lng: lng - 0.001, lat: lat + 0.001, type },
358
+ { lng: lng, lat: lat - 0.001, type },
359
+ { lng: lng + 0.001, lat: lat + 0.0005, type },
326
360
  ],
327
361
  },
328
362
  // 推荐点列表
329
363
  places: [
330
- { lat: lat - 0.00001, lng: lng + 0.0001, name: "place 1", displayName: "place 1" },
331
- { lat: lat - 0.0002, lng: lng + 0.0002, name: "place 2", displayName: "place 2" },
332
- { lat: lat - 0.0002, lng: lng - 0.0001, name: "place 3", displayName: "place 3" },
364
+ {
365
+ lat: lat - 0.00001,
366
+ lng: lng + 0.0001,
367
+ type,
368
+ name: "place 1",
369
+ displayName: "place 1",
370
+ },
371
+ {
372
+ lat: lat - 0.0002,
373
+ lng: lng + 0.0002,
374
+ type,
375
+ name: "place 2",
376
+ displayName: "place 2",
377
+ },
378
+ {
379
+ lat: lat - 0.0002,
380
+ lng: lng - 0.0001,
381
+ type,
382
+ name: "place 3",
383
+ displayName: "place 3",
384
+ },
333
385
  ],
334
386
  };
335
387
  }}
@@ -380,14 +432,16 @@ export default defineComponent({
380
432
  <BusinessQuotingMap
381
433
  class={"demo"}
382
434
  from={{
383
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
384
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
435
+ displayName: "The Malayan Council",
436
+ name: "10 Winstedt Rd, #01-17, Singapore 227977",
437
+ type: "wgs84",
385
438
  lat: 1.311295,
386
439
  lng: 103.841974,
387
440
  }}
388
441
  to={{
389
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
390
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
442
+ displayName: "CDG Engie Charging Station",
443
+ name: "21 Kent Ridge Rd, Singapore 119220",
444
+ type: "wgs84",
391
445
  lat: 1.2966426,
392
446
  lng: 103.7763939,
393
447
  }}
@@ -420,14 +474,16 @@ export default defineComponent({
420
474
  <BusinessTaxiServiceMap
421
475
  class={css.adjustedDemo}
422
476
  from={{
423
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
424
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
477
+ displayName: "The Malayan Council",
478
+ name: "10 Winstedt Rd, #01-17, Singapore 227977",
479
+ type: "wgs84",
425
480
  lat: 1.311295,
426
481
  lng: 103.841974,
427
482
  }}
428
483
  to={{
429
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
430
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
484
+ displayName: "CDG Engie Charging Station",
485
+ name: "21 Kent Ridge Rd, Singapore 119220",
486
+ type: "wgs84",
431
487
  lat: 1.2966426,
432
488
  lng: 103.7763939,
433
489
  }}
@@ -444,9 +500,9 @@ export default defineComponent({
444
500
  getDriverPositionTrack={async () => {
445
501
  // 向后端请求司机的历史轨迹
446
502
  return Promise.resolve<TrackPoint[]>([
447
- { lng: 121.4036983, lat: 31.216324, angle: 30, timestamp: 1698058438000 },
448
- { lng: 121.4036983, lat: 31.216324, angle: 30, timestamp: 1698058439000 },
449
- { lng: 121.403581, lat: 31.216415, angle: 30, timestamp: 1698058442000 },
503
+ { lng: 121.4036983, lat: 31.216324, type: "gcj02", angle: 30, timestamp: 1698058438000 },
504
+ { lng: 121.4036983, lat: 31.216324, type: "gcj02", angle: 30, timestamp: 1698058439000 },
505
+ { lng: 121.403581, lat: 31.216415, type: "gcj02", angle: 30, timestamp: 1698058442000 },
450
506
  ]);
451
507
  }}
452
508
  interval={5000}
@@ -472,16 +528,18 @@ export default defineComponent({
472
528
  <BusinessTaxiEndMap
473
529
  class={"demo"}
474
530
  from={{
475
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
476
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
477
- lat: 1.311295,
478
- lng: 103.841974,
531
+ displayName: "樟宜机场",
532
+ name: "樟宜机场",
533
+ lat: 1.35019,
534
+ lng: 103.994003,
535
+ type: "wgs84",
479
536
  }}
480
537
  to={{
481
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
482
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
483
- lat: 1.2966426,
484
- lng: 103.7763939,
538
+ lat: 1.346493,
539
+ lng: 103.746209,
540
+ name: "长城美华 Coffee Shop (CCMW)",
541
+ displayName: "长城美华 Coffee Shop (CCMW)",
542
+ type: "wgs84",
485
543
  }}
486
544
  />
487
545
  );
@@ -12,14 +12,16 @@ const DemoBusinessQuoting = defineSetup("DemoBusinessQuoting", function() {
12
12
  "class": demo,
13
13
  "attrs": {
14
14
  "from": {
15
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
16
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
15
+ displayName: "The Malayan Council",
16
+ name: "10 Winstedt Rd, #01-17, Singapore 227977",
17
+ type: "wgs84",
17
18
  lat: 1.311295,
18
19
  lng: 103.841974
19
20
  },
20
21
  "to": {
21
- displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
22
- name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
22
+ displayName: "CDG Engie Charging Station",
23
+ name: "21 Kent Ridge Rd, Singapore 119220",
24
+ type: "wgs84",
23
25
  lat: 1.2966426,
24
26
  lng: 103.7763939
25
27
  },
@@ -6,28 +6,44 @@ import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
6
6
  const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", function() {
7
7
  const getRecomendPlace = async ({
8
8
  lng,
9
- lat
9
+ lat,
10
+ type
10
11
  }) => {
11
12
  await new Promise((r) => setTimeout(r, 3e3));
12
13
  return {
13
14
  available: true,
14
15
  zone: {
15
16
  name: "",
16
- path: [[lng - 1e-3, lat + 1e-3], [lng, lat - 1e-3], [lng + 1e-3, lat + 5e-4]]
17
+ path: [{
18
+ lng: lng - 1e-3,
19
+ lat: lat + 1e-3,
20
+ type
21
+ }, {
22
+ lng,
23
+ lat: lat - 1e-3,
24
+ type
25
+ }, {
26
+ lng: lng + 1e-3,
27
+ lat: lat + 5e-4,
28
+ type
29
+ }]
17
30
  },
18
31
  places: [{
19
32
  lat: lat - 1e-5,
20
33
  lng: lng + 1e-4,
34
+ type,
21
35
  name: "place 1",
22
36
  displayName: "place 1"
23
37
  }, {
24
38
  lat: lat - 3e-4,
25
39
  lng: lng + 2e-4,
40
+ type,
26
41
  name: "place 2",
27
42
  displayName: "place 2"
28
43
  }, {
29
44
  lat: lat - 2e-4,
30
45
  lng: lng - 1e-4,
46
+ type,
31
47
  name: "place 3",
32
48
  displayName: "place 3"
33
49
  }]
@@ -43,6 +59,7 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
43
59
  window.changeUserSpecifiedPlace = () => setCenterPlaceByUserSpecified({
44
60
  lng: 139.55,
45
61
  lat: 35.55,
62
+ type: "gcj02",
46
63
  name: "user specified place",
47
64
  displayName: "user specified place"
48
65
  });
@@ -50,22 +67,37 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
50
67
  place: {
51
68
  lng: 139.56,
52
69
  lat: 35.56,
70
+ type: "gcj02",
53
71
  name: "user specified place in zone",
54
72
  displayName: "user specified place in zone"
55
73
  },
56
74
  recommends: {
57
75
  zone: {
58
76
  name: "zone 1",
59
- path: [[139.569, 35.555], [139.558, 35.55], [139.56, 35.565]]
77
+ path: [{
78
+ lng: 139.569,
79
+ lat: 35.555,
80
+ type: "gcj02"
81
+ }, {
82
+ lng: 139.558,
83
+ lat: 35.55,
84
+ type: "gcj02"
85
+ }, {
86
+ lng: 139.56,
87
+ lat: 35.565,
88
+ type: "gcj02"
89
+ }]
60
90
  },
61
91
  places: [{
62
92
  lng: 139.56,
63
93
  lat: 35.56,
94
+ type: "gcj02",
64
95
  name: "user specified place in zone",
65
96
  displayName: "user specified place in zone"
66
97
  }, {
67
98
  lng: 139.562,
68
99
  lat: 35.562,
100
+ type: "gcj02",
69
101
  name: "recommend place 2",
70
102
  displayName: "recommend place 2"
71
103
  }]
@@ -84,6 +116,7 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
84
116
  "defaultCenterPlace": (place) => place != null ? place : {
85
117
  lng: 139.777777,
86
118
  lat: 35.777777,
119
+ type: "gcj02",
87
120
  name: "default place name",
88
121
  displayName: "default place displayName"
89
122
  },
@@ -6,28 +6,44 @@ import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
6
6
  const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", function() {
7
7
  const getRecomendPlace = async ({
8
8
  lng,
9
- lat
9
+ lat,
10
+ type
10
11
  }) => {
11
12
  await new Promise((r) => setTimeout(r, 3e3));
12
13
  return {
13
14
  available: true,
14
15
  zone: {
15
16
  name: "",
16
- path: [[lng - 1e-3, lat + 1e-3], [lng, lat - 1e-3], [lng + 1e-3, lat + 5e-4]]
17
+ path: [{
18
+ lng: lng - 1e-3,
19
+ lat: lat + 1e-3,
20
+ type
21
+ }, {
22
+ lng,
23
+ lat: lat - 1e-3,
24
+ type
25
+ }, {
26
+ lng: lng + 1e-3,
27
+ lat: lat + 5e-4,
28
+ type
29
+ }]
17
30
  },
18
31
  places: [{
19
32
  lat: lat - 1e-5,
20
33
  lng: lng + 1e-4,
34
+ type,
21
35
  name: "place 1",
22
36
  displayName: "place 1"
23
37
  }, {
24
38
  lat: lat - 2e-4,
25
39
  lng: lng + 2e-4,
40
+ type,
26
41
  name: "place 2",
27
42
  displayName: "place 2"
28
43
  }, {
29
44
  lat: lat - 2e-4,
30
45
  lng: lng - 1e-4,
46
+ type,
31
47
  name: "place 3",
32
48
  displayName: "place 3"
33
49
  }]
@@ -42,6 +58,7 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
42
58
  window.changeUserSpecifiedPlace = () => setCenterPlaceByUserSpecified({
43
59
  lng: 139.55,
44
60
  lat: 35.55,
61
+ type: "gcj02",
45
62
  name: "user specified place",
46
63
  displayName: "user specified place"
47
64
  });
@@ -49,27 +66,43 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
49
66
  place: {
50
67
  lng: 139.56,
51
68
  lat: 35.56,
69
+ type: "gcj02",
52
70
  name: "user specified place in zone",
53
71
  displayName: "user specified place in zone"
54
72
  },
55
73
  recommends: {
56
74
  zone: {
57
75
  name: "zone 1",
58
- path: [[139.569, 35.555], [139.558, 35.55], [139.56, 35.565]]
76
+ path: [{
77
+ lng: 139.569,
78
+ lat: 35.555,
79
+ type: "gcj02"
80
+ }, {
81
+ lng: 139.558,
82
+ lat: 35.55,
83
+ type: "gcj02"
84
+ }, {
85
+ lng: 139.56,
86
+ lat: 35.565,
87
+ type: "gcj02"
88
+ }]
59
89
  },
60
90
  places: [{
61
91
  lng: 139.56,
62
92
  lat: 35.56,
93
+ type: "gcj02",
63
94
  name: "user specified place in zone",
64
95
  displayName: "user specified place in zone"
65
96
  }, {
66
97
  lng: 139.562,
67
98
  lat: 35.562,
99
+ type: "gcj02",
68
100
  name: "recommend place 2",
69
101
  displayName: "recommend place 2"
70
102
  }, {
71
103
  lng: 139.563,
72
104
  lat: 35.562,
105
+ type: "gcj02",
73
106
  name: "recommend place 3",
74
107
  displayName: "recommend place 3"
75
108
  }]
@@ -87,6 +120,7 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
87
120
  "defaultPlace": {
88
121
  lng: 139.777777,
89
122
  lat: 35.777777,
123
+ type: "gcj02",
90
124
  name: "default place name",
91
125
  displayName: "default place display name"
92
126
  },
@@ -1,15 +1,6 @@
1
+ import { type CoordinatePlace } from "../types/interface";
1
2
  export declare const DemoBusinessTaxiEnd: import("vue-demi").DefineComponent<{}, unknown, {
2
- from: {
3
- lat: number;
4
- lng: number;
5
- name: string;
6
- displayName: string;
7
- };
8
- to: {
9
- lat: number;
10
- lng: number;
11
- name: string;
12
- displayName: string;
13
- };
3
+ from: CoordinatePlace;
4
+ to: CoordinatePlace;
14
5
  contentHeight: number;
15
6
  }, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}>;
@@ -10,13 +10,15 @@ const DemoBusinessTaxiEnd = defineComponent({
10
10
  lat: 0,
11
11
  lng: 0,
12
12
  name: "",
13
- displayName: ""
13
+ displayName: "",
14
+ type: "wgs84"
14
15
  },
15
16
  to: {
16
17
  lat: 0,
17
18
  lng: 0,
18
19
  name: "",
19
- displayName: ""
20
+ displayName: "",
21
+ type: "wgs84"
20
22
  },
21
23
  contentHeight: 200
22
24
  };
@@ -27,13 +29,15 @@ const DemoBusinessTaxiEnd = defineComponent({
27
29
  displayName: "樟宜机场",
28
30
  name: "樟宜机场",
29
31
  lat: 1.35019,
30
- lng: 103.994003
32
+ lng: 103.994003,
33
+ type: "wgs84"
31
34
  };
32
35
  this.to = {
33
36
  lat: 1.346493,
34
37
  lng: 103.746209,
35
38
  name: "长城美华 Coffee Shop (CCMW)",
36
- displayName: "长城美华 Coffee Shop (CCMW)"
39
+ displayName: "长城美华 Coffee Shop (CCMW)",
40
+ type: "wgs84"
37
41
  };
38
42
  }, 2e3);
39
43
  setTimeout(() => {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="google.maps" />
2
- import type { DriverStatus, Place, TrackPoint } from "../types/interface";
2
+ import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus } from "../types/interface";
3
3
  export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent<Readonly<{}>, {
4
4
  setMap: import("../hooks/useHeycarMap").SetMap<import("../components/Amap/SafeAmap").SafeAmap> | import("../hooks/useHeycarMap").SetMap<google.maps.Map>;
5
5
  registerFitVeiw: import("../types/interface").RegisterOverlay<({
@@ -2392,10 +2392,10 @@ export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent
2392
2392
  getEvents(): Record<string, any[]>;
2393
2393
  }) & import("../hooks/useOverlay").GmapOverlay>;
2394
2394
  }, {
2395
- from: Partial<Place>;
2396
- to: Partial<Place>;
2395
+ from: Partial<CoordinatePlace>;
2396
+ to: Partial<CoordinatePlace>;
2397
2397
  status: DriverStatus;
2398
2398
  contentHeight: number;
2399
2399
  }, {}, {
2400
- getDriverPositionTrack(): Promise<TrackPoint[]>;
2400
+ getDriverPositionTrack(): Promise<CoordinateTrackPoint[]>;
2401
2401
  }, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<Readonly<{}>>>, {}>;
@@ -2,7 +2,7 @@ import { h } from "vue";
2
2
  import { defineComponent } from "vue-demi";
3
3
  import { BusinessTaxiServiceMap } from "../business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js";
4
4
  import { useBusinessTaxiServiceMap } from "../hooks-business/useBusinessTaxiServiceMap.js";
5
- import { isPlace } from "../utils/helper.js";
5
+ import { isCoordinatePoint } from "../utils/typeChecking.js";
6
6
  import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
7
7
  const allDriverStatus = ["dispatching", "book-dispatching", "dispatched", "driverStartService", "book-driverStartService", "book-dispatched", "driverArrived", "inService", "canceled", "endService", "completed", "canceling", "banlanceRefund", "waitBanlanceRefund", "rechargePayed", "waitRechargePay", "payed", "waitpay", "refund", "confirmed", "assign"];
8
8
  const DemoBusinessTaxiService = defineComponent({
@@ -30,11 +30,13 @@ const DemoBusinessTaxiService = defineComponent({
30
30
  this.from = {
31
31
  lat: 31.217624,
32
32
  lng: 121.415595,
33
+ type: "gcj02",
33
34
  name: "中山公园地铁站"
34
35
  };
35
36
  this.to = {
36
37
  lat: 31.26402206282826,
37
38
  lng: 121.3995217963426,
39
+ type: "gcj02",
38
40
  name: "上海站"
39
41
  };
40
42
  }, 1e3);
@@ -56,17 +58,20 @@ const DemoBusinessTaxiService = defineComponent({
56
58
  lng: 121.4036983,
57
59
  lat: 31.216324,
58
60
  angle: 30,
59
- timestamp: 1698058438e3
61
+ timestamp: 1698058438e3,
62
+ type: "gcj02"
60
63
  }, {
61
64
  lng: 121.4036983,
62
65
  lat: 31.216324,
63
66
  angle: 30,
64
- timestamp: 1698058439e3
67
+ timestamp: 1698058439e3,
68
+ type: "gcj02"
65
69
  }, {
66
70
  lng: 121.403581,
67
71
  lat: 31.216415,
68
72
  angle: 30,
69
- timestamp: 1698058442e3
73
+ timestamp: 1698058442e3,
74
+ type: "gcj02"
70
75
  }]);
71
76
  }
72
77
  },
@@ -79,7 +84,7 @@ const DemoBusinessTaxiService = defineComponent({
79
84
  to,
80
85
  status
81
86
  } = this;
82
- const isReady = isPlace(from) && isPlace(to);
87
+ const isReady = isCoordinatePoint(from) && isCoordinatePoint(to);
83
88
  if (!isReady)
84
89
  return null;
85
90
  const {
@@ -1,6 +1,6 @@
1
- import type { Place } from "../types/interface";
1
+ import type { CoordinatePlace } from "../types/interface";
2
2
  import type { WxGetLocationSuccessResponse } from "../types/wx";
3
- export declare const apiSaveCenterPlaceToCache: (position: Place) => void;
4
- export declare const apiGetCenterPlaceFromCache: () => Place | undefined;
3
+ export declare const apiSaveCenterPlaceToCache: (position: CoordinatePlace) => void;
4
+ export declare const apiGetCenterPlaceFromCache: () => CoordinatePlace | undefined;
5
5
  export declare const apiGetWxInitialWxGetLocationWithin5Seconds: () => undefined | Promise<WxGetLocationSuccessResponse>;
6
6
  export declare const apiGetAuxiliaryGrapStatus: () => boolean;
@@ -1,4 +1,4 @@
1
- import { toPlaceType } from "../utils/transform.js";
1
+ import { toCoordinatePlaceType } from "../utils/typeChecking.js";
2
2
  const CACHE_KEY_CENTER_PLACE = "HEYCAR_MAP_CACHE_KEY_CENTER_PLACE_12jw8w34j34tr";
3
3
  const AUXILIARY_GRASP_STATUS_KEY = "AUXILIARY_GRASP_STATUS_KEY_KQ23RJ3RJIQJRI";
4
4
  const apiSaveCenterPlaceToCache = (position) => {
@@ -7,7 +7,7 @@ const apiSaveCenterPlaceToCache = (position) => {
7
7
  const apiGetCenterPlaceFromCache = () => {
8
8
  const value = localStorage.getItem(CACHE_KEY_CENTER_PLACE);
9
9
  try {
10
- return value ? toPlaceType(JSON.parse(value)) : void 0;
10
+ return value ? toCoordinatePlaceType(JSON.parse(value)) : void 0;
11
11
  } catch {
12
12
  return void 0;
13
13
  }
@@ -15,7 +15,8 @@ export interface SnapToRoadsResponse {
15
15
  export interface ApiGoogleSnapRoadProps {
16
16
  interpolate?: boolean;
17
17
  path: Point[];
18
- proxyUrl: string;
18
+ proxyUrl?: string;
19
19
  }
20
20
  export declare function apiGoogleSnapRoad(props: ApiGoogleSnapRoadProps): Promise<SnapToRoadsResponse>;
21
+ export declare const setGlobalGoogleSnapRoadProxyUrl: (url?: string) => void;
21
22
  export {};