@heycar/heycars-map 2.12.0-color7 → 2.13.0-relay1
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.
- package/README.md +8 -0
- package/dist/v2/Demo/DemoBusinessQuoting.d.ts +7 -1
- package/dist/v2/Demo/DemoBusinessQuoting.js +60 -30
- package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -0
- package/dist/v2/Demo/DemoBusinessTaxiService.js +44 -23
- package/dist/v2/api/cdn.d.ts +1 -0
- package/dist/v2/api/cdn.js +3 -1
- package/dist/v2/api/contants.d.ts +1 -1
- package/dist/v2/api/contants.js +1 -1
- package/dist/v2/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.d.ts +1 -0
- package/dist/v2/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.js +6 -3
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -0
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +25 -3
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +5 -0
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +123 -1
- package/dist/v2/business-components/PlaceCircle/PlaceCircle.js +1 -1
- package/dist/v2/business-components/StartEndPoint/StartEndPoint.css.d.ts +5 -0
- package/dist/v2/business-components/StartEndPoint/StartEndPoint.d.ts +1 -1
- package/dist/v2/business-components/StartEndPoint/StartEndPoint.js +4 -4
- package/dist/v2/business-components/TaxiCar/TaxiCar.js +1 -1
- package/dist/v2/chunks/{StartEndPoint.css.ca6c9719.js → StartEndPoint.css.4d9c0791.js} +4 -4
- package/dist/{v3/css/PlaceCircle-00817652.css → v2/css/PlaceCircle-80eb763c.css} +1 -0
- package/dist/v2/css/{StartEndPoint-f6a6f7d3.css → StartEndPoint-d1c9154a.css} +7 -2
- package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.d.ts +2 -1
- package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.js +12 -5
- package/dist/v2/hooks/useDrivingRoute.d.ts +4 -3
- package/dist/v2/hooks/useDrivingRoute.js +12 -12
- package/dist/v2/types/interface.d.ts +1 -1
- package/dist/v2/utils/compatibleDrivingRoute.d.ts +5 -5
- package/dist/v2/utils/compatibleDrivingRoute.js +23 -11
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/Demo/DemoBusinessQuoting.d.ts +7 -3
- package/dist/v3/Demo/DemoBusinessQuoting.js +62 -32
- package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -0
- package/dist/v3/Demo/DemoBusinessTaxiService.js +44 -23
- package/dist/v3/api/cdn.d.ts +1 -0
- package/dist/v3/api/cdn.js +3 -1
- package/dist/v3/api/contants.d.ts +1 -1
- package/dist/v3/api/contants.js +1 -1
- package/dist/v3/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.d.ts +1 -0
- package/dist/v3/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.js +6 -3
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -0
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +21 -3
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +9 -0
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +99 -1
- package/dist/v3/business-components/PlaceCircle/PlaceCircle.js +1 -1
- package/dist/v3/business-components/StartEndPoint/StartEndPoint.css.d.ts +5 -0
- package/dist/v3/business-components/StartEndPoint/StartEndPoint.d.ts +1 -1
- package/dist/v3/business-components/StartEndPoint/StartEndPoint.js +4 -4
- package/dist/v3/business-components/TaxiCar/TaxiCar.js +1 -1
- package/dist/v3/chunks/{StartEndPoint.css.ca6c9719.js → StartEndPoint.css.4d9c0791.js} +4 -4
- package/dist/{v2/css/PlaceCircle-00817652.css → v3/css/PlaceCircle-80eb763c.css} +1 -0
- package/dist/v3/css/{StartEndPoint-f6a6f7d3.css → StartEndPoint-d1c9154a.css} +7 -2
- package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.d.ts +2 -1
- package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.js +12 -5
- package/dist/v3/hooks/useDrivingRoute.d.ts +4 -3
- package/dist/v3/hooks/useDrivingRoute.js +12 -12
- package/dist/v3/types/interface.d.ts +1 -1
- package/dist/v3/utils/compatibleDrivingRoute.d.ts +5 -5
- package/dist/v3/utils/compatibleDrivingRoute.js +23 -11
- package/dist/v3/utils/log.js +1 -1
- 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)
|
package/dist/v3/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.
|
|
3
|
+
const pkgVersion = "2.13.0-relay1";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|