@heycar/heycars-map 2.12.0-color7 → 2.13.0-relay2

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 (76) hide show
  1. package/README.md +43 -0
  2. package/dist/v2/Demo/DemoBusinessQuoting.d.ts +7 -1
  3. package/dist/v2/Demo/DemoBusinessQuoting.js +60 -30
  4. package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -0
  5. package/dist/v2/Demo/DemoBusinessTaxiService.js +44 -23
  6. package/dist/v2/api/cdn.d.ts +1 -1
  7. package/dist/v2/api/cdn.js +3 -3
  8. package/dist/v2/api/contants.d.ts +1 -1
  9. package/dist/v2/api/contants.js +1 -1
  10. package/dist/v2/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +7 -1
  11. package/dist/v2/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.d.ts +1 -0
  12. package/dist/v2/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.js +6 -3
  13. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -0
  14. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +25 -3
  15. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +5 -0
  16. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +123 -1
  17. package/dist/v2/business-components/PlaceCircle/PlaceCircle.js +1 -1
  18. package/dist/v2/business-components/StartEndPoint/StartEndPoint.css.d.ts +5 -0
  19. package/dist/v2/business-components/StartEndPoint/StartEndPoint.d.ts +5 -2
  20. package/dist/v2/business-components/StartEndPoint/StartEndPoint.js +21 -6
  21. package/dist/v2/business-components/TaxiCar/TaxiCar.d.ts +1 -0
  22. package/dist/v2/business-components/TaxiCar/TaxiCar.js +17 -6
  23. package/dist/v2/chunks/{Loading.96f573fe.js → Loading.70dfc720.js} +7 -1
  24. package/dist/{v3/chunks/StartEndPoint.css.ca6c9719.js → v2/chunks/StartEndPoint.css.4d9c0791.js} +4 -4
  25. package/dist/v2/components/Loading/Loading.d.ts +1 -0
  26. package/dist/v2/components/Loading/Loading.js +2 -1
  27. package/dist/v2/components/Loading/index.js +1 -1
  28. package/dist/v2/components/MapProvider/MapProvider.js +1 -1
  29. package/dist/{v3/css/PlaceCircle-00817652.css → v2/css/PlaceCircle-80eb763c.css} +1 -0
  30. package/dist/{v3/css/StartEndPoint-f6a6f7d3.css → v2/css/StartEndPoint-d1c9154a.css} +7 -2
  31. package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.d.ts +2 -1
  32. package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.js +12 -5
  33. package/dist/v2/hooks/useDrivingRoute.d.ts +4 -3
  34. package/dist/v2/hooks/useDrivingRoute.js +12 -12
  35. package/dist/v2/types/interface.d.ts +8 -1
  36. package/dist/v2/utils/compatibleDrivingRoute.d.ts +5 -5
  37. package/dist/v2/utils/compatibleDrivingRoute.js +23 -11
  38. package/dist/v2/utils/log.js +1 -1
  39. package/dist/v3/Demo/DemoBusinessQuoting.d.ts +7 -3
  40. package/dist/v3/Demo/DemoBusinessQuoting.js +62 -32
  41. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -0
  42. package/dist/v3/Demo/DemoBusinessTaxiService.js +44 -23
  43. package/dist/v3/api/cdn.d.ts +1 -1
  44. package/dist/v3/api/cdn.js +3 -3
  45. package/dist/v3/api/contants.d.ts +1 -1
  46. package/dist/v3/api/contants.js +1 -1
  47. package/dist/v3/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +7 -1
  48. package/dist/v3/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.d.ts +1 -0
  49. package/dist/v3/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.js +6 -3
  50. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -0
  51. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +21 -3
  52. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +9 -0
  53. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +99 -1
  54. package/dist/v3/business-components/PlaceCircle/PlaceCircle.js +1 -1
  55. package/dist/v3/business-components/StartEndPoint/StartEndPoint.css.d.ts +5 -0
  56. package/dist/v3/business-components/StartEndPoint/StartEndPoint.d.ts +5 -2
  57. package/dist/v3/business-components/StartEndPoint/StartEndPoint.js +21 -6
  58. package/dist/v3/business-components/TaxiCar/TaxiCar.d.ts +1 -0
  59. package/dist/v3/business-components/TaxiCar/TaxiCar.js +17 -6
  60. package/dist/v3/chunks/{Loading.8c26ab6c.js → Loading.4c949ec9.js} +7 -1
  61. package/dist/{v2/chunks/StartEndPoint.css.ca6c9719.js → v3/chunks/StartEndPoint.css.4d9c0791.js} +4 -4
  62. package/dist/v3/components/Loading/Loading.d.ts +1 -0
  63. package/dist/v3/components/Loading/Loading.js +2 -1
  64. package/dist/v3/components/Loading/index.js +1 -1
  65. package/dist/v3/components/MapProvider/MapProvider.js +1 -1
  66. package/dist/{v2/css/PlaceCircle-00817652.css → v3/css/PlaceCircle-80eb763c.css} +1 -0
  67. package/dist/{v2/css/StartEndPoint-f6a6f7d3.css → v3/css/StartEndPoint-d1c9154a.css} +7 -2
  68. package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.d.ts +2 -1
  69. package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.js +12 -5
  70. package/dist/v3/hooks/useDrivingRoute.d.ts +4 -3
  71. package/dist/v3/hooks/useDrivingRoute.js +12 -12
  72. package/dist/v3/types/interface.d.ts +8 -1
  73. package/dist/v3/utils/compatibleDrivingRoute.d.ts +5 -5
  74. package/dist/v3/utils/compatibleDrivingRoute.js +23 -11
  75. package/dist/v3/utils/log.js +1 -1
  76. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { apiGaodeDirectionDriving } from "../api/gaodeDirectionDriving.js";
2
2
  import { apiGoogleDirections } from "../api/googleDirections.js";
3
3
  import { apiGoogleRoutes } from "../api/googleRoutes.js";
4
- import { amapTraffic2trafficStatus, stringifyPoint } from "./transform.js";
4
+ import { vec2lnglat, amapTraffic2trafficStatus, stringifyPoint } from "./transform.js";
5
5
  const amapTmcs2trafficJams = (tmcs) => {
6
6
  const trafficJams = {};
7
7
  let prevStatus = "UNKNOWN";
@@ -20,12 +20,12 @@ const amapTmcs2trafficJams = (tmcs) => {
20
20
  }
21
21
  return trafficJams;
22
22
  };
23
- function amapJsApiDrivingRoute(from, to, amapDriving) {
23
+ function amapJsApiDrivingRoute(from, to, waypoints, amapDriving) {
24
24
  return new Promise((resolve, reject) => {
25
25
  amapDriving.search(
26
26
  AMap.LngLat.from(from),
27
27
  AMap.LngLat.from(to),
28
- { waypoints: [] },
28
+ { waypoints: waypoints.map((p) => AMap.LngLat.from(p)) },
29
29
  (status, result) => {
30
30
  const trafficJams = {};
31
31
  switch (status) {
@@ -67,11 +67,12 @@ function amapJsApiDrivingRoute(from, to, amapDriving) {
67
67
  );
68
68
  });
69
69
  }
70
- async function gaodeServiceApiDrivingRoute(from, to, proxyUrl) {
70
+ async function gaodeServiceApiDrivingRoute(from, to, waypoints, proxyUrl) {
71
71
  const { status, routes, error_message } = await apiGaodeDirectionDriving({
72
72
  proxyUrl,
73
73
  origin: [from],
74
- destination: to
74
+ destination: to,
75
+ waypoints
75
76
  });
76
77
  const trafficJams = {};
77
78
  switch (status) {
@@ -107,13 +108,14 @@ async function gaodeServiceApiDrivingRoute(from, to, proxyUrl) {
107
108
  throw Error(error_message);
108
109
  }
109
110
  }
110
- function gmapJsApiDrivingRoute(from, to, gmapDirectionsService) {
111
+ function gmapJsApiDrivingRoute(from, to, waypoints, gmapDirectionsService) {
111
112
  return new Promise((resolve, reject) => {
112
113
  gmapDirectionsService.route(
113
114
  {
114
115
  origin: { lng: from[0], lat: from[1] },
115
116
  destination: { lng: to[0], lat: to[1] },
116
- travelMode: google.maps.TravelMode.DRIVING
117
+ travelMode: google.maps.TravelMode.DRIVING,
118
+ waypoints: waypoints.map((p) => ({ location: vec2lnglat(p) }))
117
119
  },
118
120
  (result, status) => {
119
121
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -151,12 +153,13 @@ function gmapJsApiDrivingRoute(from, to, gmapDirectionsService) {
151
153
  );
152
154
  });
153
155
  }
154
- async function googleServiceApiDrivingDirection(from, to, proxyUrl) {
156
+ async function googleServiceApiDrivingDirection(from, to, waypoints, proxyUrl) {
155
157
  var _a, _b, _c, _d, _e, _f, _g, _h;
156
158
  const { status, routes, error_message } = await apiGoogleDirections({
157
159
  proxyUrl,
158
160
  origin: from,
159
- destination: to
161
+ destination: to,
162
+ waypoints
160
163
  });
161
164
  switch (status) {
162
165
  case "OK": {
@@ -189,7 +192,7 @@ async function googleServiceApiDrivingDirection(from, to, proxyUrl) {
189
192
  throw Error(error_message != null ? error_message : status);
190
193
  }
191
194
  }
192
- async function googleServiceApiDrivingRoute(from, to, proxyUrl) {
195
+ async function googleServiceApiDrivingRoute(from, to, waypoints, proxyUrl) {
193
196
  var _a, _b, _c, _d, _e;
194
197
  const { routes } = await apiGoogleRoutes({
195
198
  proxyUrl,
@@ -207,8 +210,17 @@ async function googleServiceApiDrivingRoute(from, to, proxyUrl) {
207
210
  latitude: to[1],
208
211
  longitude: to[0]
209
212
  }
213
+ },
214
+ vehicleStopover: true
215
+ },
216
+ intermediates: waypoints.map((p) => ({
217
+ location: {
218
+ latLng: {
219
+ latitude: p[1],
220
+ longitude: p[0]
221
+ }
210
222
  }
211
- }
223
+ }))
212
224
  });
213
225
  const firstRoute = routes == null ? void 0 : routes[0];
214
226
  if (!firstRoute)
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.12.0-color7";
3
+ const pkgVersion = "2.13.0-relay2";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "2.12.0-color7",
3
+ "version": "2.13.0-relay2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",