@heycar/heycars-map 2.20.0-pointSource5 → 2.20.0-pointSource6

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.
@@ -116,7 +116,8 @@ async function apiGoogleRoutes(props) {
116
116
  });
117
117
  if (response.ok) {
118
118
  const result = await response.json();
119
- assertGoogleRoutesResponse(result);
119
+ if (!result.isCrossBorder)
120
+ assertGoogleRoutesResponse(result);
120
121
  return result;
121
122
  }
122
123
  const error = await response.json();
@@ -232,7 +232,11 @@ async function googleServiceApiDrivingRoute(from, to, waypoints, proxyUrl) {
232
232
  const routeSteps = [];
233
233
  for (const leg of firstRoute.legs) {
234
234
  distance += (_a = leg.distanceMeters) != null ? _a : 0;
235
- duration += (_b = leg.durationSeconds) != null ? _b : 0;
235
+ if (isCrossBorder) {
236
+ duration += leg.duration ? parseInt(leg.duration) : 0;
237
+ } else {
238
+ duration += (_b = leg.durationSeconds) != null ? _b : 0;
239
+ }
236
240
  const staticRatio = leg.staticDurationSeconds ? ((_c = leg.durationSeconds) != null ? _c : 0) / leg.staticDurationSeconds : 1;
237
241
  for (const step of leg.steps) {
238
242
  const stepPath = step.path.map(({ lng, lat }) => [lng(), lat()]);
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.20.0-pointSource5";
3
+ const pkgVersion = "2.20.0-pointSource6";
4
4
  const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
5
5
  const enableSessionLogKey = (key) => {
6
6
  const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
@@ -116,7 +116,8 @@ async function apiGoogleRoutes(props) {
116
116
  });
117
117
  if (response.ok) {
118
118
  const result = await response.json();
119
- assertGoogleRoutesResponse(result);
119
+ if (!result.isCrossBorder)
120
+ assertGoogleRoutesResponse(result);
120
121
  return result;
121
122
  }
122
123
  const error = await response.json();
@@ -232,7 +232,11 @@ async function googleServiceApiDrivingRoute(from, to, waypoints, proxyUrl) {
232
232
  const routeSteps = [];
233
233
  for (const leg of firstRoute.legs) {
234
234
  distance += (_a = leg.distanceMeters) != null ? _a : 0;
235
- duration += (_b = leg.durationSeconds) != null ? _b : 0;
235
+ if (isCrossBorder) {
236
+ duration += leg.duration ? parseInt(leg.duration) : 0;
237
+ } else {
238
+ duration += (_b = leg.durationSeconds) != null ? _b : 0;
239
+ }
236
240
  const staticRatio = leg.staticDurationSeconds ? ((_c = leg.durationSeconds) != null ? _c : 0) / leg.staticDurationSeconds : 1;
237
241
  for (const step of leg.steps) {
238
242
  const stepPath = step.path.map(({ lng, lat }) => [lng(), lat()]);
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.20.0-pointSource5";
3
+ const pkgVersion = "2.20.0-pointSource6";
4
4
  const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
5
5
  const enableSessionLogKey = (key) => {
6
6
  const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "2.20.0-pointSource5",
3
+ "version": "2.20.0-pointSource6",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",