@heycar/heycars-map 2.15.0-domestic2 → 2.15.0-sgn1

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 (84) hide show
  1. package/README.md +15 -47
  2. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -2
  3. package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
  4. package/dist/v2/Demo/DemoBusinessTaxiEnd.js +2 -9
  5. package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -4
  6. package/dist/v2/Demo/DemoBusinessTaxiService.js +1 -19
  7. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  8. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
  9. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +2 -2
  10. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
  11. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
  12. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
  13. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
  14. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
  15. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
  16. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
  17. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
  18. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -80
  19. package/dist/v2/chunks/{BusinessRecomendPlaceMap.eebd0822.js → BusinessRecomendPlaceMap.ed4b75d5.js} +30 -11
  20. package/dist/{v3/chunks/Loading.4b53c31f.js → v2/chunks/Loading.70dfc720.js} +30 -34
  21. package/dist/v2/components/Loading/Loading.js +1 -1
  22. package/dist/v2/components/Loading/index.js +1 -1
  23. package/dist/v2/components/MapProvider/MapProvider.js +10 -21
  24. package/dist/v2/hooks/useMapCoordinatify.d.ts +1 -2
  25. package/dist/v2/hooks/useMapCoordinatify.js +1 -6
  26. package/dist/v2/hooks/useMapFitZoom.d.ts +6 -0
  27. package/dist/v2/hooks/useMapFitZoom.js +22 -2
  28. package/dist/v2/hooks/useMapLoader.js +3 -3
  29. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  30. package/dist/v2/index.js +1 -1
  31. package/dist/v2/types/interface.d.ts +0 -12
  32. package/dist/v2/utils/geometryPolygon.d.ts +0 -9
  33. package/dist/v2/utils/geometryPolygon.js +0 -19
  34. package/dist/v2/utils/log.js +1 -1
  35. package/dist/v2/utils/platform.d.ts +1 -2
  36. package/dist/v2/utils/platform.js +1 -2
  37. package/dist/v2/utils/typeChecking.d.ts +1 -7
  38. package/dist/v2/utils/typeChecking.js +0 -18
  39. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -2
  40. package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
  41. package/dist/v3/Demo/DemoBusinessTaxiEnd.js +2 -9
  42. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -4
  43. package/dist/v3/Demo/DemoBusinessTaxiService.js +1 -19
  44. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  45. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
  46. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +2 -2
  47. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
  48. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
  49. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
  50. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
  51. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
  52. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
  53. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
  54. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
  55. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -62
  56. package/dist/v3/chunks/{BusinessRecomendPlaceMap.71c439c6.js → BusinessRecomendPlaceMap.4ec9353a.js} +30 -9
  57. package/dist/{v2/chunks/Loading.8aa3aad3.js → v3/chunks/Loading.4c949ec9.js} +27 -47
  58. package/dist/v3/components/Loading/Loading.js +1 -1
  59. package/dist/v3/components/Loading/index.js +1 -1
  60. package/dist/v3/components/MapProvider/MapProvider.js +10 -21
  61. package/dist/v3/hooks/useMapCoordinatify.d.ts +1 -2
  62. package/dist/v3/hooks/useMapCoordinatify.js +1 -6
  63. package/dist/v3/hooks/useMapFitZoom.d.ts +6 -0
  64. package/dist/v3/hooks/useMapFitZoom.js +22 -2
  65. package/dist/v3/hooks/useMapLoader.js +3 -3
  66. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  67. package/dist/v3/index.js +1 -1
  68. package/dist/v3/types/interface.d.ts +0 -12
  69. package/dist/v3/utils/geometryPolygon.d.ts +0 -9
  70. package/dist/v3/utils/geometryPolygon.js +0 -19
  71. package/dist/v3/utils/log.js +1 -1
  72. package/dist/v3/utils/platform.d.ts +1 -2
  73. package/dist/v3/utils/platform.js +1 -2
  74. package/dist/v3/utils/typeChecking.d.ts +1 -7
  75. package/dist/v3/utils/typeChecking.js +0 -18
  76. package/package.json +1 -1
  77. package/dist/v2/Demo/demo.data.mock.d.ts +0 -4
  78. package/dist/v2/Demo/demo.data.mock.js +0 -1194
  79. package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +0 -6
  80. package/dist/v2/business-components/TaxiCar/RandomCars.js +0 -47
  81. package/dist/v3/Demo/demo.data.mock.d.ts +0 -4
  82. package/dist/v3/Demo/demo.data.mock.js +0 -1194
  83. package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +0 -8
  84. package/dist/v3/business-components/TaxiCar/RandomCars.js +0 -45
package/README.md CHANGED
@@ -133,17 +133,6 @@ export interface CoordinateTrackPoint {
133
133
  timestamp: number;
134
134
  }
135
135
 
136
- export interface CoordinateExternalRoute {
137
- path: CoordinatePoint[];
138
- duration: number;
139
- distance: number;
140
- }
141
-
142
- export type GetDriverRouteOrTrackOutput = {
143
- routes?: CoordinateExternalRoute;
144
- tracks?: CoordinateTrackPoint[];
145
- };
146
-
147
136
  export enum CenterPlaceStatus {
148
137
  GEO_LOADING = "GEO_LOADING",
149
138
  QUERYING_INFO = "QUERYING_INFO",
@@ -206,7 +195,6 @@ export type DriverStatus =
206
195
  gmapKey={gmapApiKey}
207
196
  // 使用哪个地图供应商,目前两个供应商: amap 高德 / gmap 谷歌
208
197
  supplier={"amap"}
209
- // 对于国内聚合,路径将 "/overseas/.*" 改为 "/now/.*"
210
198
  // 可选,高德驾车路线规划代理地址
211
199
  gaodeDirectionDrivingProxyUrl="/overseas/amap/driveGuide"
212
200
  // 可选,高德步行路线规划代理地址
@@ -361,8 +349,6 @@ export default defineComponent({
361
349
  queryingTitle={"正在获取地址信息"}
362
350
  recomendDescription={"您将在此处上车"}
363
351
  geoErrorOnceNotificationKey="BusinessReselectPlaceMap_GeoErrorOnceKey"
364
- // 是否显示附近车辆
365
- enableNearbyCars={true}
366
352
  defaultCenterPlace={(place) =>
367
353
  place ?? {
368
354
  lng: 139.777777,
@@ -372,6 +358,17 @@ export default defineComponent({
372
358
  displayName: "default place displayName",
373
359
  }
374
360
  }
361
+ // 可选,应用启动时是否跳过等待 GPS,默认 false
362
+ skipWaitGeo={
363
+ false ||
364
+ true || {
365
+ lng: 139.55555,
366
+ lat: 35.5555,
367
+ type: "wgs84",
368
+ name: "skip geo place name",
369
+ displayName: "skip geo place displayName",
370
+ }
371
+ }
375
372
  getAvailable={() => Promise.resolve(true)}
376
373
  getRecomendPlace={getRecomendPlace}
377
374
  getDefaultCenterPlace={getDefaultCenterPlace}
@@ -610,6 +607,10 @@ export default defineComponent({
610
607
  mapContext={mapContext}
611
608
  onClickStartPoint={(place) => console.log("点击起点时触发 palce = ", place)}
612
609
  onClickEndPoint={(place) => console.log("点击终点时触发 palce = ", place)}
610
+ onChangeGoogleConnection={(status) =>
611
+ // 根据目前的产品需求,连通性检测只会被检测一次。
612
+ console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
613
+ }
613
614
  />
614
615
  <div>
615
616
  经度 103.841974, 纬度 1.311295 在高德地图上的坐标类型是:
@@ -668,18 +669,6 @@ export default defineComponent({
668
669
  renderInServiceTitle={({ distance, duration }) =>
669
670
  `距离终点*${distance}*公里, 预计*${duration}*分钟`
670
671
  }
671
- // 选填。 司机接单时,第三方指定的起点到终点的路径
672
- confirmedPath={[
673
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
674
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
675
- {lng: 121.401795, lat: 31.21654, type: "gcj02"},
676
- ]}
677
- // 选填。 订单结束时,实际行驶路径
678
- endServicePath={[
679
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
680
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
681
- {lng: 121.401795, lat: 31.21654, type: "gcj02"},
682
- ]}
683
672
  getDriverPositionTrack={async () => {
684
673
  // 向后端请求司机的历史轨迹
685
674
  return Promise.resolve<TrackPoint[]>([
@@ -688,21 +677,6 @@ export default defineComponent({
688
677
  { lng: 121.403581, lat: 31.216415, type: "gcj02", angle: 30, timestamp: 1698058442000 },
689
678
  ]);
690
679
  }}
691
- // getDriverRouteOrTrack 与 getDriverPositionTrack 二选一
692
- getDriverRouteOrTrack={async () => {
693
- // 后端返回司机的真实导航路径或者历史轨迹
694
- return Promise.resolve<GetDriverRouteOrTrackOutput>({
695
- routes: {
696
- distance: 4270,
697
- duration: 1310,
698
- path: [
699
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
700
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
701
- {lng: 121.401795, lat: 31.21654, type: "gcj02"},
702
- ],
703
- },
704
- });
705
- }}
706
680
  interval={5000}
707
681
  mapContext={mapContext}
708
682
  />
@@ -738,12 +712,6 @@ export default defineComponent({
738
712
  displayName: "长城美华 Coffee Shop (CCMW)",
739
713
  type: "wgs84",
740
714
  }}
741
- // 选填。实际行驶路径
742
- path={[
743
- { lng: 103.996211, lat: 1.35202, type: "wgs84" },
744
- { lng: 103.996469, lat: 1.352348, type: "wgs84" },
745
- { lng: 103.996581, lat: 1.3526, type: "wgs84" },
746
- ]}
747
715
  />
748
716
  );
749
717
  },
@@ -1,5 +1,5 @@
1
1
  import { h } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.eebd0822.js";
2
+ import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
3
3
  import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
4
4
  import { defineSetup } from "../types/helper.js";
5
5
  import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
@@ -124,7 +124,6 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
124
124
  name: "default place name",
125
125
  displayName: "default place displayName"
126
126
  },
127
- "enableNearbyCars": true,
128
127
  "getAvailable": () => Promise.resolve(true),
129
128
  "getRecomendPlace": getRecomendPlace,
130
129
  "renderPlacePhoto": (place) => {
@@ -1,7 +1,6 @@
1
- import { type CoordinatePlace, type CoordinatePoint } from "../types/interface";
1
+ import { type CoordinatePlace } from "../types/interface";
2
2
  export declare const DemoBusinessTaxiEnd: import("vue-demi").DefineComponent<{}, unknown, {
3
3
  from: CoordinatePlace;
4
4
  to: CoordinatePlace;
5
- path: CoordinatePoint[];
6
5
  contentHeight: number;
7
6
  }, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}>;
@@ -2,7 +2,6 @@ import { h } from "vue";
2
2
  import { defineComponent } from "vue-demi";
3
3
  import { BusinessTaxiEndMap } from "../business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
4
4
  import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
5
- import { mockPath } from "./demo.data.mock.js";
6
5
  const DemoBusinessTaxiEnd = defineComponent({
7
6
  name: "DemoBusinessTaxiEnd",
8
7
  data() {
@@ -21,7 +20,6 @@ const DemoBusinessTaxiEnd = defineComponent({
21
20
  displayName: "",
22
21
  type: "wgs84"
23
22
  },
24
- path: [],
25
23
  contentHeight: 200
26
24
  };
27
25
  },
@@ -45,16 +43,12 @@ const DemoBusinessTaxiEnd = defineComponent({
45
43
  setTimeout(() => {
46
44
  this.contentHeight = 600;
47
45
  }, 2500);
48
- setTimeout(() => {
49
- this.path = [...mockPath];
50
- }, 3500);
51
46
  },
52
47
  render() {
53
48
  const {
54
49
  from,
55
50
  to,
56
- contentHeight,
57
- path
51
+ contentHeight
58
52
  } = this;
59
53
  return h("div", {
60
54
  "class": layout
@@ -62,8 +56,7 @@ const DemoBusinessTaxiEnd = defineComponent({
62
56
  "class": adjustedDemo,
63
57
  "attrs": {
64
58
  "from": from,
65
- "to": to,
66
- "path": path
59
+ "to": to
67
60
  }
68
61
  }), h("div", {
69
62
  "style": {
@@ -1,4 +1,4 @@
1
- import { type CoordinatePlace, type CoordinatePoint, type CoordinateTrackPoint, type DriverStatus, type GetDriverRouteOrTrackOutput } from "../types/interface";
1
+ import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus } from "../types/interface";
2
2
  export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent<Readonly<{}>, {
3
3
  mapContext: import("../hooks-business/useBusinessTaxiServiceMap").BusinessTaxiServiceContext;
4
4
  }, {
@@ -7,9 +7,6 @@ export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent
7
7
  relayTo: Partial<CoordinatePlace>;
8
8
  status: DriverStatus;
9
9
  contentHeight: number;
10
- confirmedPath: CoordinatePoint[];
11
- endServicePath: CoordinatePoint[];
12
10
  }, {}, {
13
11
  getDriverPositionTrack(): Promise<CoordinateTrackPoint[]>;
14
- getDriverRouteOrTrack(): Promise<GetDriverRouteOrTrackOutput>;
15
12
  }, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<Readonly<{}>>>, {}>;
@@ -4,9 +4,7 @@ import { BusinessTaxiServiceMap } from "../business-components/BusinessTaxiServi
4
4
  import { useBusinessTaxiServiceMap } from "../hooks-business/useBusinessTaxiServiceMap.js";
5
5
  import { isCoordinatePoint } from "../utils/typeChecking.js";
6
6
  import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
7
- import { mockConfirmedPath, mockExternalRoute } from "./demo.data.mock.js";
8
7
  const allDriverStatus = ["dispatching", "book-dispatching", "dispatched", "driverStartRelayService", "driverStartService", "book-driverStartService", "book-dispatched", "driverArrived", "inService", "canceled", "endService", "completed", "canceling", "banlanceRefund", "waitBanlanceRefund", "rechargePayed", "waitRechargePay", "payed", "waitpay", "refund", "confirmed", "assign"];
9
- const mockDriverRoute = mockExternalRoute;
10
8
  const mockDriverTrackPoints = [{
11
9
  lng: 121.4036983,
12
10
  lat: 31.216324,
@@ -42,9 +40,7 @@ const DemoBusinessTaxiService = defineComponent({
42
40
  to: {},
43
41
  relayTo: {},
44
42
  status: "driverStartRelayService",
45
- contentHeight: 200,
46
- confirmedPath: [],
47
- endServicePath: []
43
+ contentHeight: 200
48
44
  };
49
45
  },
50
46
  created() {
@@ -89,24 +85,10 @@ const DemoBusinessTaxiService = defineComponent({
89
85
  type
90
86
  });
91
87
  };
92
- window.updateDriverRoute = () => {
93
- mockDriverRoute.path = mockDriverRoute.path.slice(5);
94
- };
95
- window.updateConfirmedPath = () => {
96
- this.confirmedPath = [...mockConfirmedPath];
97
- };
98
- window.updateEndServicePath = () => {
99
- this.endServicePath = [...mockConfirmedPath];
100
- };
101
88
  },
102
89
  methods: {
103
90
  getDriverPositionTrack() {
104
91
  return Promise.resolve(mockDriverTrackPoints);
105
- },
106
- getDriverRouteOrTrack() {
107
- return Promise.resolve({
108
- routes: mockDriverRoute
109
- });
110
92
  }
111
93
  },
112
94
  render() {
@@ -5,7 +5,7 @@ import { type UseMapDragProps } from "../../hooks/useMapDrag";
5
5
  import type { UseMapPlaceProps } from "../../hooks/useMapPlace";
6
6
  import { type UseMapRecomendPlaceProps } from "../../hooks/useMapRecomendPlace";
7
7
  import type { Coordinatify, CoordinatifyProps } from "../../types/coordinatify";
8
- import { type BusinessGeolocationPositionError, type CoordinatePlace } from "../../types/interface";
8
+ import { type BusinessGeolocationPositionError, type CoordinatePlace, type CoordinatePoint } from "../../types/interface";
9
9
  import { type AbsoluteAddressBoxProps } from "../AbsoluteAddressBox";
10
10
  import { type PickupPointsProps } from "../PickupPoints";
11
11
  export declare const RECOMMEND_PLACE_DRAG_LIMIT = 10;
@@ -28,12 +28,12 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
28
28
  emptyTitle: string;
29
29
  queryingTitle: string;
30
30
  recomendDescription: string;
31
- enableNearbyCars?: boolean;
32
31
  disableLocator?: boolean;
33
32
  disableLocatorPhoto?: boolean;
34
33
  geoErrorOnceNotificationKey?: string;
35
34
  mapContext: CoordinatifyProps<BusinessRecomendPlaceContext>;
36
35
  defaultCenterPlace?: CoordinatePlace | ((place?: CoordinatePlace) => CoordinatePlace | undefined);
36
+ skipWaitGeo?: boolean | CoordinatePlace | CoordinatePoint;
37
37
  renderPlacePhoto?: (place: CoordinatePlace) => undefined | {
38
38
  src: string;
39
39
  title?: string;
@@ -2,6 +2,7 @@ import "vue";
2
2
  import "vue-demi";
3
3
  import "../../api/browser.js";
4
4
  import "../../api/memory.js";
5
+ import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
5
6
  import "../../components/MapProvider/MapProvider.js";
6
7
  import "../../demi-polyfill/demi-polyfill.js";
7
8
  import "../../hooks/useGeoLocation.js";
@@ -26,12 +27,10 @@ import "../DeviceOrientation/DeviceOrientation.js";
26
27
  import "../GreenZone/GreenZone.js";
27
28
  import "../PassengerCircle/PassengerCircle.js";
28
29
  import "../PickupPoints/PickupPoints.js";
29
- import "../TaxiCar/RandomCars.js";
30
30
  import "./useCacheCenterPlace.js";
31
- import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.eebd0822.js";
32
31
  export {
33
32
  B as BusinessRecomendPlaceMap,
34
- f as BusinessRecomendPlaceMapInner,
33
+ g as BusinessRecomendPlaceMapInner,
35
34
  D as DEFAULT_ZOOM,
36
35
  E as EMPTY_PLACE,
37
36
  R as RECOMMEND_PLACE_DRAG_LIMIT,
@@ -1,7 +1,7 @@
1
- import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.eebd0822.js";
1
+ import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
2
2
  export {
3
3
  B as BusinessRecomendPlaceMap,
4
- f as BusinessRecomendPlaceMapInner,
4
+ g as BusinessRecomendPlaceMapInner,
5
5
  D as DEFAULT_ZOOM,
6
6
  E as EMPTY_PLACE,
7
7
  R as RECOMMEND_PLACE_DRAG_LIMIT,
@@ -1,7 +1,8 @@
1
- import type { CoordinatePlace, Point } from "../../types/interface";
1
+ import type { CoordinatePlace, CoordinatePoint, Point } from "../../types/interface";
2
2
  interface UseDefaultCenterPlaceProps {
3
3
  emptyTitle: string;
4
4
  geoLoadingTitle: string;
5
+ skipWaitGeo?: boolean | CoordinatePlace | CoordinatePoint;
5
6
  defaultCenterPlace?: CoordinatePlace | ((place?: CoordinatePlace) => CoordinatePlace | undefined);
6
7
  }
7
8
  export declare const useCacheCenterPlace: (props: UseDefaultCenterPlaceProps) => {
@@ -3,13 +3,21 @@ import { apiGetCenterPlaceFromCache } from "../../api/browser.js";
3
3
  import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
4
4
  import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
5
5
  import { maybeFunctionToFunction, lnglat2point } from "../../utils/transform.js";
6
+ import { t as throttle } from "../../chunks/throttle.8bdd8d3b.js";
6
7
  const IS_FIRST_LOAD_KEY = "IS_FIRST_LOAD_KEY";
8
+ const THROTTLE_TIME = 3e3;
9
+ const throttledApiMemoryShouldSkipByKey = throttle(apiMemoryShouldSkipByKey, THROTTLE_TIME, {
10
+ trailing: false
11
+ });
7
12
  const useCacheCenterPlace = (props) => {
8
- const { geoLoadingTitle, emptyTitle } = props;
9
- const isFirstLoad = !apiMemoryShouldSkipByKey(IS_FIRST_LOAD_KEY);
13
+ var _a;
14
+ const { geoLoadingTitle, emptyTitle, skipWaitGeo } = props;
15
+ const isAppFirstLoad = !throttledApiMemoryShouldSkipByKey(IS_FIRST_LOAD_KEY);
16
+ const isFirstLoadWithGps = isAppFirstLoad && !skipWaitGeo;
10
17
  const getDefaultCenterPlace = maybeFunctionToFunction(props.defaultCenterPlace);
11
18
  const { unCoordinatifyPlace } = useMapCoordinatify();
12
- const inputDefaultCenterPlace = getDefaultCenterPlace == null ? void 0 : getDefaultCenterPlace(apiGetCenterPlaceFromCache());
19
+ const inputSkipGeoPlace = typeof skipWaitGeo === "object" ? skipWaitGeo : void 0;
20
+ const inputDefaultCenterPlace = (_a = isAppFirstLoad ? inputSkipGeoPlace : void 0) != null ? _a : getDefaultCenterPlace == null ? void 0 : getDefaultCenterPlace(apiGetCenterPlaceFromCache());
13
21
  const defaultCenterPlace = {
14
22
  lng: 0,
15
23
  lat: 0,
@@ -21,10 +29,10 @@ const useCacheCenterPlace = (props) => {
21
29
  const centerPlace = reactive({
22
30
  lng: defaultCenterPlace.lng,
23
31
  lat: defaultCenterPlace.lat,
24
- name: isFirstLoad ? geoLoadingTitle : defaultCenterPlace.name,
25
- displayName: isFirstLoad ? geoLoadingTitle : defaultCenterPlace.displayName
32
+ name: isFirstLoadWithGps ? geoLoadingTitle : defaultCenterPlace.name,
33
+ displayName: isFirstLoadWithGps ? geoLoadingTitle : defaultCenterPlace.displayName
26
34
  });
27
- return { isFirstLoad, centerPlace, geoDefaultPosition, defaultCenterPlace };
35
+ return { isFirstLoad: isFirstLoadWithGps, centerPlace, geoDefaultPosition, defaultCenterPlace };
28
36
  };
29
37
  export {
30
38
  useCacheCenterPlace
@@ -1,6 +1,7 @@
1
1
  import { h } from "vue";
2
2
  import { reactive, watch, watchEffect, onUnmounted } from "vue-demi";
3
3
  import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
4
+ import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING, f as airportSgnBounds } from "../../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
4
5
  import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
5
6
  import { createElement } from "../../demi-polyfill/demi-polyfill.js";
6
7
  import { useGeoLocation } from "../../hooks/useGeoLocation.js";
@@ -21,7 +22,6 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
21
22
  import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
22
23
  import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
23
24
  import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
24
- import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.eebd0822.js";
25
25
  import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
26
26
  import { GreenZone } from "../GreenZone/GreenZone.js";
27
27
  import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
@@ -74,7 +74,11 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
74
74
  setFitZoom
75
75
  } = useMapFitZoom({
76
76
  mapRef,
77
- padding: ZONE_FITVIEW_PANDING
77
+ padding: ZONE_FITVIEW_PANDING,
78
+ certainZoomAreas: [{
79
+ zoom: DEFAULT_ZOOM,
80
+ points: airportSgnBounds
81
+ }]
78
82
  });
79
83
  const {
80
84
  assertSupplier
@@ -1,8 +1,7 @@
1
- import type { CoordinatePlace, CoordinatePoint } from "../../types/interface";
1
+ import type { Place } from "../../types/interface";
2
2
  export interface BusinessTaxiEndMapProps {
3
- from: Partial<CoordinatePlace>;
4
- to: Partial<CoordinatePlace>;
5
- path?: CoordinatePoint[];
3
+ from: Partial<Place>;
4
+ to: Partial<Place>;
6
5
  }
7
6
  export declare const BusinessTaxiEndMapInner: import("vue/types/v3-define-component").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessTaxiEndMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiEndMapProps, Required<BusinessTaxiEndMapProps>>, never, BusinessTaxiEndMapProps>;
8
7
  export declare const BusinessTaxiEndMap: import("vue/types/v3-define-component").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessTaxiEndMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiEndMapProps, Required<BusinessTaxiEndMapProps>>, never, BusinessTaxiEndMapProps>;
@@ -8,7 +8,7 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
8
8
  import { useMapSupplier } from "../../hooks/useMapSupplier.js";
9
9
  import { defineSetup } from "../../types/helper.js";
10
10
  import { place2point, pipeDefer } from "../../utils/transform.js";
11
- import { isCoordinatePoint, toCoordinatePlaceType, toCoordinatePointType } from "../../utils/typeChecking.js";
11
+ import { isCoordinatePoint, toCoordinatePlaceType } from "../../utils/typeChecking.js";
12
12
  import { SectionEndService } from "../BusinessTaxiServiceMap/BusinessTaxiServiceSection.js";
13
13
  const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(props, {
14
14
  attrs
@@ -18,7 +18,6 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
18
18
  setMap
19
19
  } = useHeycarMap();
20
20
  const {
21
- unCoordinatifyPoint,
22
21
  unCoordinatifyPlace
23
22
  } = useMapCoordinatify();
24
23
  const {
@@ -32,13 +31,11 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
32
31
  return () => {
33
32
  const {
34
33
  from: inputFrom,
35
- to: inputTo,
36
- path: inputPath
34
+ to: inputTo
37
35
  } = props;
38
36
  const isReady = isCoordinatePoint(inputFrom) && isCoordinatePoint(inputTo);
39
37
  const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
40
38
  const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
41
- const path = inputPath == null ? void 0 : inputPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
42
39
  const center = isReady ? place2point(from) : [...BEIJIN_POINT];
43
40
  return h(HeycarMap, {
44
41
  "class": attrs.class,
@@ -56,7 +53,6 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
56
53
  "attrs": {
57
54
  "from": from,
58
55
  "to": to,
59
- "routePath": path,
60
56
  "registerOverlay": registerFitVeiw
61
57
  }
62
58
  })]);
@@ -1,7 +1,7 @@
1
1
  import { type HeycarMapProps } from "../../components/MapProvider";
2
2
  import type { BusinessTaxiServiceContext } from "../../hooks-business/useBusinessTaxiServiceMap";
3
3
  import type { CoordinatifyProps } from "../../types/coordinatify";
4
- import type { CoordinatePlace, CoordinatePoint, CoordinateTrackPoint, DriverStatus, GetDriverRouteOrTrackOutput } from "../../types/interface";
4
+ import type { CoordinatePlace, CoordinateTrackPoint, DriverStatus } from "../../types/interface";
5
5
  export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps, "center" | "zoom" | "mapRef">> & {
6
6
  from: CoordinatePlace;
7
7
  to: CoordinatePlace;
@@ -15,8 +15,6 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
15
15
  driverStatus: DriverStatus;
16
16
  interval: number;
17
17
  disablePassenger?: boolean;
18
- confirmedPath?: CoordinatePoint[];
19
- endServicePath?: CoordinatePoint[];
20
18
  mapContext: CoordinatifyProps<BusinessTaxiServiceContext>;
21
19
  renderStartSerivceTitle: (titleProps: {
22
20
  distance: number;
@@ -27,7 +25,6 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
27
25
  duration: number;
28
26
  }) => string;
29
27
  getDriverPositionTrack?: () => Promise<CoordinateTrackPoint[]>;
30
- getDriverRouteOrTrack?: () => Promise<GetDriverRouteOrTrackOutput>;
31
28
  };
32
29
  export declare const BusinessTaxiServiceMapInner: import("vue-demi").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessTaxiServiceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiServiceMapProps, Required<BusinessTaxiServiceMapProps>>, "resize" | "dragEnd" | "zoomEnd", BusinessTaxiServiceMapProps>;
33
30
  export declare const BusinessTaxiServiceMap: import("vue-demi").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessTaxiServiceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiServiceMapProps, Required<BusinessTaxiServiceMapProps>>, "resize" | "dragEnd" | "zoomEnd", BusinessTaxiServiceMapProps>;
@@ -10,10 +10,9 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
10
10
  import { useMapAssertSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
11
11
  import { defineSetup, defineLagecySetup } from "../../types/helper.js";
12
12
  import { MANUAL_ABORT_MESSAGE } from "../../utils/ManualAbortError.js";
13
- import { computeLineAngle } from "../../utils/geometryPolygon.js";
14
13
  import { createAbortable, assertNotEmptyArray } from "../../utils/helper.js";
15
14
  import { place2point, pipeDefer, lnglat2point } from "../../utils/transform.js";
16
- import { toCoordinatePlaceType, toCoordinatePointType, createTypeError, toCoordinateExternalRoute, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
15
+ import { toCoordinatePlaceType, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
17
16
  import { AuxiliaryGraspRoad } from "../AuxiliaryGraspRoad/AuxiliaryGraspRoad.js";
18
17
  import { AuxiliaryPassanger } from "../AuxiliaryPassanger/AuxiliaryPassanger.js";
19
18
  import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
@@ -24,7 +23,6 @@ const IS_ENABLE_AUXILIARY_GRASP_ROAD = apiGetAuxiliaryGrapStatus();
24
23
  const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", function(props, {
25
24
  attrs
26
25
  }) {
27
- var _a;
28
26
  const {
29
27
  interval,
30
28
  disablePassenger,
@@ -42,17 +40,10 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
42
40
  } = useMapAssertSupplier();
43
41
  const abortController = new AbortController();
44
42
  const abortable = createAbortable(abortController.signal);
45
- const getDriverRouteOrTrack = abortable((_a = props.getDriverRouteOrTrack) != null ? _a : async () => {
46
- var _a2;
47
- return {
48
- tracks: await ((_a2 = props.getDriverPositionTrack) == null ? void 0 : _a2.call(props))
49
- };
50
- });
43
+ const getDriverPositionTrack = abortable(props.getDriverPositionTrack);
51
44
  const {
52
- unCoordinatifyPoint,
53
45
  unCoordinatifyPlace,
54
- unCoordinatifyTrackPoint,
55
- unCoordinatifyExternalRoute
46
+ unCoordinatifyTrackPoint
56
47
  } = useMapCoordinatify();
57
48
  const {
58
49
  registerFitVeiw: registerOverlay,
@@ -73,27 +64,11 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
73
64
  const carPositionRef = ref();
74
65
  const carAngleRef = ref();
75
66
  const carTrackPositionsRef = ref([]);
76
- const carRouteRef = ref();
77
67
  watch(() => props.driverStatus, (status, _, onCleanup) => {
78
68
  if (!STATUS_NEED_CAR_POSITION.includes(status))
79
69
  return;
80
70
  const update = async () => {
81
- const output = await (getDriverRouteOrTrack == null ? void 0 : getDriverRouteOrTrack());
82
- if (!("tracks" in output) && !("routes" in output)) {
83
- throw createTypeError("GetDriverRouteOrTrackOutput", output);
84
- }
85
- if ("routes" in output) {
86
- const routes = unCoordinatifyExternalRoute(toCoordinateExternalRoute(output.routes));
87
- assertNotEmptyArray(routes.path, "routes.path");
88
- carPositionRef.value = routes.path[0];
89
- carAngleRef.value = computeLineAngle(routes.path[0], routes.path[1]);
90
- carTrackPositionsRef.value = [];
91
- carRouteRef.value = routes;
92
- return;
93
- }
94
- const {
95
- tracks
96
- } = output;
71
+ const tracks = await (getDriverPositionTrack == null ? void 0 : getDriverPositionTrack());
97
72
  assertNotEmptyArray(tracks, "tracks");
98
73
  const trackPositions = tracks.map((p) => unCoordinatifyTrackPoint(toCoordinateTrackPoint(p)));
99
74
  const [{
@@ -102,7 +77,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
102
77
  carPositionRef.value = lnglat2point(trackPositions[trackPositions.length - 1]);
103
78
  carAngleRef.value = angle;
104
79
  carTrackPositionsRef.value = trackPositions;
105
- carRouteRef.value = void 0;
106
80
  };
107
81
  const timer = setInterval(update, interval);
108
82
  update();
@@ -121,21 +95,16 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
121
95
  dispatchingTitle,
122
96
  bookDispatchingTitle,
123
97
  bookDispatchedTitle,
124
- driverArrivedTitle,
125
- confirmedPath: inputConfirmedPath,
126
- endServicePath: inputEndServicePath
98
+ driverArrivedTitle
127
99
  } = props;
128
100
  const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
129
101
  const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
130
102
  const relayTo = inputRelayTo ? unCoordinatifyPlace(toCoordinatePlaceType(inputRelayTo)) : void 0;
131
- const confirmedPath = inputConfirmedPath == null ? void 0 : inputConfirmedPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
132
- const endServicePath = inputEndServicePath == null ? void 0 : inputEndServicePath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
133
103
  const carPosition = carPositionRef.value;
134
104
  const carAngle = carAngleRef.value;
135
105
  const carTrackPositions = carTrackPositionsRef.value;
136
106
  const touchEnable = !["canceled", "canceling", "completed", "endService", "waitpay", "waitRechargePay", "refund", "rechargePayed", "payed"].includes(driverStatus);
137
107
  const passengerPosition = disablePassenger || geoLoading.value || geoError.value ? void 0 : geoPosition.value;
138
- const carRoute = carRouteRef.value;
139
108
  return h(HeycarMap, {
140
109
  "class": attrs.class,
141
110
  "style": attrs.style,
@@ -168,7 +137,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
168
137
  "attrs": {
169
138
  "from": from,
170
139
  "to": to,
171
- "routePath": confirmedPath,
172
140
  "passengerPosition": passengerPosition,
173
141
  "passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
174
142
  "registerOverlay": registerOverlay
@@ -186,7 +154,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
186
154
  "carPosition": carPosition,
187
155
  "carAngle": carAngle,
188
156
  "carTrackPositions": carTrackPositions,
189
- "carRoute": carRoute,
190
157
  "passengerPosition": passengerPosition,
191
158
  "passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
192
159
  "relayToTitle": relayToTitle,
@@ -205,7 +172,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
205
172
  "carPosition": carPosition,
206
173
  "carAngle": carAngle,
207
174
  "carTrackPositions": carTrackPositions,
208
- "carRoute": carRoute,
209
175
  "passengerPosition": passengerPosition,
210
176
  "passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
211
177
  "renderTitle": renderStartSerivceTitle,
@@ -222,7 +188,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
222
188
  "from": from,
223
189
  "to": to,
224
190
  "title": bookDispatchedTitle,
225
- "routePath": confirmedPath,
226
191
  "passengerPosition": passengerPosition,
227
192
  "passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
228
193
  "registerOverlay": registerOverlay
@@ -235,7 +200,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
235
200
  "carPosition": carPosition,
236
201
  "carAngle": carAngle,
237
202
  "carTrackPositions": carTrackPositions,
238
- "carRoute": carRoute,
239
203
  "renderTitle": renderInServiceTitle,
240
204
  "registerOverlay": registerOverlay
241
205
  },
@@ -266,7 +230,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
266
230
  "attrs": {
267
231
  "from": from,
268
232
  "to": to,
269
- "routePath": endServicePath,
270
233
  "registerOverlay": registerOverlay
271
234
  }
272
235
  }) : (
@@ -275,11 +238,10 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
275
238
  "attrs": {
276
239
  "from": from,
277
240
  "to": to,
278
- "routePath": endServicePath,
279
241
  "registerOverlay": registerOverlay
280
242
  }
281
243
  })
282
- ), IS_ENABLE_AUXILIARY_GRASP_ROAD && !carRoute && h(AuxiliaryGraspRoad, {
244
+ ), IS_ENABLE_AUXILIARY_GRASP_ROAD && h(AuxiliaryGraspRoad, {
283
245
  "attrs": {
284
246
  "status": driverStatus,
285
247
  "trackPoints": carTrackPositions,
@@ -309,7 +271,7 @@ const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", funct
309
271
  attrs: props,
310
272
  key: `${payload.supplier}${instanceNo}`
311
273
  });
312
- }).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "getDriverRouteOrTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "confirmedPath", "endServicePath", "to"]);
274
+ }).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "to"]);
313
275
  export {
314
276
  BusinessTaxiServiceMap,
315
277
  BusinessTaxiServiceMapInner