@heycar/heycars-map 2.25.0-gaodeRegeo → 2.26.0-setLimitBounds

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 (66) hide show
  1. package/README.md +30 -1
  2. package/dist/v2/App.js +2 -3
  3. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +2 -2
  4. package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +4 -1
  5. package/dist/v2/Demo/DemoBusinessTaxiService.js +26 -3
  6. package/dist/v2/Demo/demo.data.mock.d.ts +4 -0
  7. package/dist/v2/Demo/demo.data.mock.js +1194 -0
  8. package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +1 -0
  9. package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +43 -46
  10. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +15 -4
  11. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +52 -10
  12. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +27 -5
  13. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +184 -30
  14. package/dist/v2/business-components/StartEndPoint/StartEndPoint.css.d.ts +7 -0
  15. package/dist/v2/business-components/StartEndPoint/StartEndPoint.d.ts +1 -0
  16. package/dist/v2/business-components/StartEndPoint/StartEndPoint.js +20 -7
  17. package/dist/v2/business-components/TaxiCar/TaxiCar.d.ts +5 -3
  18. package/dist/v2/business-components/TaxiCar/TaxiCar.js +136 -65
  19. package/dist/v2/chunks/StartEndPoint.css.889b3eed.js +35 -0
  20. package/dist/v2/components/Amap/Amap.d.ts +2 -0
  21. package/dist/v2/components/Amap/Amap.js +22 -1
  22. package/dist/v2/components/MapProvider/MapProvider.d.ts +1 -1
  23. package/dist/v2/components/MapProvider/MapProvider.js +5 -3
  24. package/dist/v2/css/{StartEndPoint-d1c9154a.css → StartEndPoint-ac8c0529.css} +64 -8
  25. package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.js +2 -0
  26. package/dist/v2/hooks/useMapCoordinatify.d.ts +2 -1
  27. package/dist/v2/hooks/useMapCoordinatify.js +6 -1
  28. package/dist/v2/hooks/useMapSupplier.d.ts +2 -1
  29. package/dist/v2/types/interface.d.ts +12 -0
  30. package/dist/v2/utils/log.js +1 -1
  31. package/dist/v2/utils/typeChecking.d.ts +7 -1
  32. package/dist/v2/utils/typeChecking.js +18 -0
  33. package/dist/v3/App.js +2 -3
  34. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +2 -2
  35. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +4 -1
  36. package/dist/v3/Demo/DemoBusinessTaxiService.js +24 -3
  37. package/dist/v3/Demo/demo.data.mock.d.ts +4 -0
  38. package/dist/v3/Demo/demo.data.mock.js +1194 -0
  39. package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +1 -0
  40. package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +34 -33
  41. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +21 -4
  42. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +46 -10
  43. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +34 -5
  44. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +152 -28
  45. package/dist/v3/business-components/StartEndPoint/StartEndPoint.css.d.ts +7 -0
  46. package/dist/v3/business-components/StartEndPoint/StartEndPoint.d.ts +1 -0
  47. package/dist/v3/business-components/StartEndPoint/StartEndPoint.js +20 -7
  48. package/dist/v3/business-components/TaxiCar/TaxiCar.d.ts +5 -3
  49. package/dist/v3/business-components/TaxiCar/TaxiCar.js +126 -63
  50. package/dist/v3/chunks/StartEndPoint.css.889b3eed.js +35 -0
  51. package/dist/v3/components/Amap/Amap.d.ts +2 -0
  52. package/dist/v3/components/Amap/Amap.js +22 -1
  53. package/dist/v3/components/MapProvider/MapProvider.d.ts +1 -1
  54. package/dist/v3/components/MapProvider/MapProvider.js +5 -3
  55. package/dist/v3/css/{StartEndPoint-d1c9154a.css → StartEndPoint-ac8c0529.css} +64 -8
  56. package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.js +2 -0
  57. package/dist/v3/hooks/useMapCoordinatify.d.ts +2 -1
  58. package/dist/v3/hooks/useMapCoordinatify.js +6 -1
  59. package/dist/v3/hooks/useMapSupplier.d.ts +2 -1
  60. package/dist/v3/types/interface.d.ts +12 -0
  61. package/dist/v3/utils/log.js +1 -1
  62. package/dist/v3/utils/typeChecking.d.ts +7 -1
  63. package/dist/v3/utils/typeChecking.js +18 -0
  64. package/package.json +1 -1
  65. package/dist/v2/chunks/StartEndPoint.css.4d9c0791.js +0 -23
  66. package/dist/v3/chunks/StartEndPoint.css.4d9c0791.js +0 -23
package/README.md CHANGED
@@ -133,6 +133,19 @@ 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
+ | {
144
+ routes?: CoordinateExternalRoute;
145
+ tracks?: CoordinateTrackPoint[];
146
+ }
147
+ | undefined;
148
+
136
149
  export enum CenterPlaceStatus {
137
150
  GEO_LOADING = "GEO_LOADING",
138
151
  QUERYING_INFO = "QUERYING_INFO",
@@ -584,6 +597,7 @@ export default defineComponent({
584
597
  <BusinessQuotingMap
585
598
  class={"demo"}
586
599
  isBezierCurve
600
+ isNeedMapRouteData
587
601
  from={{
588
602
  displayName: "The Malayan Council",
589
603
  name: "10 Winstedt Rd, #01-17, Singapore 227977",
@@ -662,7 +676,7 @@ export default defineComponent({
662
676
  relayToTitle="上个乘客将\n在这下车"
663
677
  bookDispatchingTitle="2月14日 11:00 用车"
664
678
  dispatchingTitle="正在为您搜索附近司机"
665
- bookDispatchedTitle="*6月12日 11:00* 用车"
679
+ renderBookDispatchedTitle={() => "*6月12日 11:00* 用车"}
666
680
  driverArrivedTitle="司机已等待 00:35"
667
681
  renderStartSerivceTitle={({ distance, duration }) =>
668
682
  `距你*${distance}*公里, *${duration}*分钟`
@@ -678,6 +692,21 @@ export default defineComponent({
678
692
  { lng: 121.403581, lat: 31.216415, type: "gcj02", angle: 30, timestamp: 1698058442000 },
679
693
  ]);
680
694
  }}
695
+ // getDriverRouteOrTrack 与 getDriverPositionTrack 二选一
696
+ getDriverRouteOrTrack={async () => {
697
+ // 后端返回司机的真实导航路径或者历史轨迹
698
+ return Promise.resolve<GetDriverRouteOrTrackOutput>({
699
+ routes: {
700
+ distance: 4270,
701
+ duration: 1310,
702
+ path: [
703
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
704
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
705
+ {lng: 121.401795, lat: 31.21654, type: "gcj02"},
706
+ ],
707
+ },
708
+ });
709
+ }}
681
710
  interval={5000}
682
711
  mapContext={mapContext}
683
712
  />
package/dist/v2/App.js CHANGED
@@ -15,13 +15,12 @@ const App = defineComponent({
15
15
  "amapKey": amapApiKey,
16
16
  "amapSecret": amapApiSecret,
17
17
  "gmapId": gmapId,
18
+ "amapLimitBounds": [-180, 18.158333, 180, 90],
18
19
  "gmapKey": gmapApiKey,
19
- "language": "zh",
20
+ "language": "en",
20
21
  "supplier": supplierRef.value,
21
22
  "gaodeRegeoProxyUrl": "/overseas/amap/regeo",
22
- "googleRegeoProxyUrl": "/overseas/maps/regeo",
23
23
  "hkGovernRegeoProxyUrl": "/overseas/gov/hk/identify",
24
- "gaodeDirectionDrivingProxyUrl": "/overseas/amap/driveGuide",
25
24
  "googleSnapRoadProxyUrl": "/overseas/maps/snapToRoads",
26
25
  "googleRoutesProxyUrl": "/overseas/maps/routes/directions/v2",
27
26
  "themeVariables": {
@@ -53,8 +53,8 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
53
53
  setCenterPlaceByUserSpecifiedInZone
54
54
  } = useBusinessRecomendPlaceMap();
55
55
  window.changeUserSpecifiedPlace = () => setCenterPlaceByUserSpecified({
56
- lng: 114.226288,
57
- lat: 22.27965,
56
+ lng: 121.4,
57
+ lat: 31.2,
58
58
  type: "gcj02",
59
59
  name: "user specified place",
60
60
  displayName: "user specified place"
@@ -1,4 +1,4 @@
1
- import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus } from "../types/interface";
1
+ import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus, type GetDriverRouteOrTrackOutput } from "../types/interface";
2
2
  export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent<Readonly<{}>, {
3
3
  mapContext: import("../hooks-business/useBusinessTaxiServiceMap").BusinessTaxiServiceContext;
4
4
  }, {
@@ -9,4 +9,7 @@ export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent
9
9
  contentHeight: number;
10
10
  }, {}, {
11
11
  getDriverPositionTrack(): Promise<CoordinateTrackPoint[]>;
12
+ renderStartServiceSubTitle(): string;
13
+ renderStartSubTitle(): string;
14
+ getDriverRouteOrTrack(): Promise<GetDriverRouteOrTrackOutput>;
12
15
  }, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<Readonly<{}>>>, {}>;
@@ -4,7 +4,9 @@ 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 { mockExternalRoute } from "./demo.data.mock.js";
7
8
  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;
8
10
  const mockDriverTrackPoints = [{
9
11
  lng: 121.4036983,
10
12
  lat: 31.216324,
@@ -39,7 +41,7 @@ const DemoBusinessTaxiService = defineComponent({
39
41
  from: {},
40
42
  to: {},
41
43
  relayTo: {},
42
- status: "driverStartRelayService",
44
+ status: "dispatched",
43
45
  contentHeight: 200
44
46
  };
45
47
  },
@@ -89,16 +91,30 @@ const DemoBusinessTaxiService = defineComponent({
89
91
  methods: {
90
92
  getDriverPositionTrack() {
91
93
  return Promise.resolve(mockDriverTrackPoints);
94
+ },
95
+ renderStartServiceSubTitle() {
96
+ return "司機未按路線接駕?" + Math.random().toFixed(2);
97
+ },
98
+ renderStartSubTitle() {
99
+ return "接駕路線錯誤?" + Math.random().toFixed(2);
100
+ },
101
+ getDriverRouteOrTrack() {
102
+ return Promise.resolve({
103
+ routes: mockDriverRoute
104
+ });
92
105
  }
93
106
  },
94
107
  render() {
95
108
  const {
96
109
  mapContext,
97
110
  getDriverPositionTrack,
111
+ getDriverRouteOrTrack,
98
112
  from,
99
113
  to,
100
114
  status,
101
- relayTo
115
+ relayTo,
116
+ renderStartServiceSubTitle,
117
+ renderStartSubTitle
102
118
  } = this;
103
119
  const isReady = isCoordinatePoint(from) && isCoordinatePoint(to);
104
120
  if (!isReady)
@@ -117,20 +133,27 @@ const DemoBusinessTaxiService = defineComponent({
117
133
  "driverStatus": status,
118
134
  "relayToTitle": "上个乘客将\n在这下车",
119
135
  "bookDispatchingTitle": "2月14日 11:00 用车",
120
- "bookDispatchedTitle": "*6月12日 11:00* 用车",
136
+ "renderBookDispatchedTitle": () => "*6月12日 11:00* 用车",
121
137
  "dispatchingTitle": "正在为您搜索附近司机",
122
138
  "driverArrivedTitle": "司机已等待 00:35",
123
139
  "renderStartSerivceTitle": ({
124
140
  distance,
125
141
  duration
126
142
  }) => `距你*${distance / 1e3}*公里, *${duration}*分钟`,
143
+ "renderStartServiceSubTitle": renderStartServiceSubTitle,
144
+ "renderStartSubTitle": renderStartSubTitle,
127
145
  "renderInServiceTitle": ({
128
146
  distance,
129
147
  duration
130
148
  }) => `距离终点*${distance / 1e3}*公里, 预计*${duration}*分钟`,
131
149
  "getDriverPositionTrack": getDriverPositionTrack,
150
+ "getDriverRouteOrTrack": getDriverRouteOrTrack,
132
151
  "interval": 5e3,
133
152
  "mapContext": mapContext
153
+ },
154
+ "on": {
155
+ "clickStartServicePoint": () => console.log("777-onClickStartServicePoint被点击了"),
156
+ "clickStartPoint": (value) => console.log("7777-onClickStartPoint:路线规划接口参数", value)
134
157
  }
135
158
  }), h("div", {
136
159
  "style": {
@@ -0,0 +1,4 @@
1
+ import type { CoordinateExternalRoute, CoordinatePoint } from "../types/interface";
2
+ export declare const mockPath: CoordinatePoint[];
3
+ export declare const mockExternalRoute: CoordinateExternalRoute;
4
+ export declare const mockConfirmedPath: CoordinatePoint[];