@heycar/heycars-map 2.15.0-domestic5 → 2.15.5-drivingCorrect

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 +37 -49
  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 +1 -2
  9. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  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 +1 -1
  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.51ef1e3d.js → BusinessRecomendPlaceMap.ed4b75d5.js} +5 -9
  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.d.ts +1 -3
  24. package/dist/v2/components/MapProvider/MapProvider.js +13 -25
  25. package/dist/v2/hooks/useMapCoordinatify.d.ts +1 -2
  26. package/dist/v2/hooks/useMapCoordinatify.js +1 -6
  27. package/dist/v2/hooks/useMapFitView.js +3 -0
  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 -3
  36. package/dist/v2/utils/platform.js +2 -8
  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 +1 -2
  46. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  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 +1 -1
  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.4e383d44.js → BusinessRecomendPlaceMap.4ec9353a.js} +5 -7
  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.d.ts +1 -3
  61. package/dist/v3/components/MapProvider/MapProvider.js +14 -26
  62. package/dist/v3/hooks/useMapCoordinatify.d.ts +1 -2
  63. package/dist/v3/hooks/useMapCoordinatify.js +1 -6
  64. package/dist/v3/hooks/useMapFitView.js +3 -0
  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 -3
  73. package/dist/v3/utils/platform.js +2 -8
  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
  // 可选,高德步行路线规划代理地址
@@ -249,8 +237,6 @@ export type DriverStatus =
249
237
  // ICON_WAYPOINT_URL: "https://<支付宝oss域名>/heycar-map/svg/0.12/waypoint.svg";
250
238
  }
251
239
  }
252
- // 可选,是否启用强制浏览器模式
253
- forceBrowserPlatformH5
254
240
  // 地图加载失败时显示的标题
255
241
  renderLoadFailedTitle={() => (supplier === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败")}
256
242
  // 地图加载失败时显示的描述
@@ -363,8 +349,6 @@ export default defineComponent({
363
349
  queryingTitle={"正在获取地址信息"}
364
350
  recomendDescription={"您将在此处上车"}
365
351
  geoErrorOnceNotificationKey="BusinessReselectPlaceMap_GeoErrorOnceKey"
366
- // 是否显示附近车辆
367
- enableNearbyCars={true}
368
352
  defaultCenterPlace={(place) =>
369
353
  place ?? {
370
354
  lng: 139.777777,
@@ -374,6 +358,17 @@ export default defineComponent({
374
358
  displayName: "default place displayName",
375
359
  }
376
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
+ }
377
372
  getAvailable={() => Promise.resolve(true)}
378
373
  getRecomendPlace={getRecomendPlace}
379
374
  getDefaultCenterPlace={getDefaultCenterPlace}
@@ -612,6 +607,10 @@ export default defineComponent({
612
607
  mapContext={mapContext}
613
608
  onClickStartPoint={(place) => console.log("点击起点时触发 palce = ", place)}
614
609
  onClickEndPoint={(place) => console.log("点击终点时触发 palce = ", place)}
610
+ onChangeGoogleConnection={(status) =>
611
+ // 根据目前的产品需求,连通性检测只会被检测一次。
612
+ console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
613
+ }
615
614
  />
616
615
  <div>
617
616
  经度 103.841974, 纬度 1.311295 在高德地图上的坐标类型是:
@@ -670,18 +669,6 @@ export default defineComponent({
670
669
  renderInServiceTitle={({ distance, duration }) =>
671
670
  `距离终点*${distance}*公里, 预计*${duration}*分钟`
672
671
  }
673
- // 选填。 司机接单时,第三方指定的起点到终点的路径
674
- confirmedPath={[
675
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
676
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
677
- {lng: 121.401795, lat: 31.21654, type: "gcj02"},
678
- ]}
679
- // 选填。 订单结束时,实际行驶路径
680
- endServicePath={[
681
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
682
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
683
- {lng: 121.401795, lat: 31.21654, type: "gcj02"},
684
- ]}
685
672
  getDriverPositionTrack={async () => {
686
673
  // 向后端请求司机的历史轨迹
687
674
  return Promise.resolve<TrackPoint[]>([
@@ -690,21 +677,6 @@ export default defineComponent({
690
677
  { lng: 121.403581, lat: 31.216415, type: "gcj02", angle: 30, timestamp: 1698058442000 },
691
678
  ]);
692
679
  }}
693
- // getDriverRouteOrTrack 与 getDriverPositionTrack 二选一
694
- getDriverRouteOrTrack={async () => {
695
- // 后端返回司机的真实导航路径或者历史轨迹
696
- return Promise.resolve<GetDriverRouteOrTrackOutput>({
697
- routes: {
698
- distance: 4270,
699
- duration: 1310,
700
- path: [
701
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
702
- {lng: 121.401554, lat: 31.21653, type: "gcj02"},
703
- {lng: 121.401795, lat: 31.21654, type: "gcj02"},
704
- ],
705
- },
706
- });
707
- }}
708
680
  interval={5000}
709
681
  mapContext={mapContext}
710
682
  />
@@ -740,12 +712,6 @@ export default defineComponent({
740
712
  displayName: "长城美华 Coffee Shop (CCMW)",
741
713
  type: "wgs84",
742
714
  }}
743
- // 选填。实际行驶路径
744
- path={[
745
- { lng: 103.996211, lat: 1.35202, type: "wgs84" },
746
- { lng: 103.996469, lat: 1.352348, type: "wgs84" },
747
- { lng: 103.996581, lat: 1.3526, type: "wgs84" },
748
- ]}
749
715
  />
750
716
  );
751
717
  },
@@ -852,3 +818,25 @@ isCoordinatePointEqual(
852
818
  { type: "wgs84", lng: 114.21016180538568, lat: 22.219570659901557 },
853
819
  ) === true;
854
820
  ```
821
+
822
+ ```ts
823
+ import { inChina, inHongKong, inMacau, inTaiwan, inKorean } from "@heycar/heycars-map";
824
+
825
+ // 判断某点是否在某区域内
826
+ const point = [114.215114, 22.215972];
827
+
828
+ // 是否在中国 (不包含台湾)
829
+ inChina(point);
830
+
831
+ // 是否在香港
832
+ inHongKong(point);
833
+
834
+ // 是否在澳门
835
+ inMacau(point);
836
+
837
+ // 是否在台湾
838
+ inTaiwan(point);
839
+
840
+ // 是否在韩国
841
+ inKorean(point);
842
+ ```
@@ -1,5 +1,5 @@
1
1
  import { h } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.51ef1e3d.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,7 +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.51ef1e3d.js";
5
+ import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
6
6
  import "../../components/MapProvider/MapProvider.js";
7
7
  import "../../demi-polyfill/demi-polyfill.js";
8
8
  import "../../hooks/useGeoLocation.js";
@@ -27,7 +27,6 @@ import "../DeviceOrientation/DeviceOrientation.js";
27
27
  import "../GreenZone/GreenZone.js";
28
28
  import "../PassengerCircle/PassengerCircle.js";
29
29
  import "../PickupPoints/PickupPoints.js";
30
- import "../TaxiCar/RandomCars.js";
31
30
  import "./useCacheCenterPlace.js";
32
31
  export {
33
32
  B as BusinessRecomendPlaceMap,
@@ -1,4 +1,4 @@
1
- import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.51ef1e3d.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
4
  g as BusinessRecomendPlaceMapInner,
@@ -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,7 +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.51ef1e3d.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";
5
5
  import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
6
6
  import { createElement } from "../../demi-polyfill/demi-polyfill.js";
7
7
  import { useGeoLocation } from "../../hooks/useGeoLocation.js";
@@ -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