@heycar/heycars-map 2.15.0-sgn1 → 2.16.0-downgrade1

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 CHANGED
@@ -204,7 +204,7 @@ export type DriverStatus =
204
204
  // 弃用,谷歌路线规划代理地址
205
205
  googleDirectionsProxyUrl="/overseas/maps/directions/json"
206
206
  // 可选,谷歌路由服务代理地址
207
- googleRoutesProxyUrl="/overseas/maps/routes/directions"
207
+ googleRoutesProxyUrl="/overseas/maps/routes/directions/v2"
208
208
  // 可选,自定义地图颜色
209
209
  themeVariables={
210
210
  {
package/dist/v2/App.js CHANGED
@@ -8,7 +8,7 @@ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
8
8
  const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
9
9
  const App = defineComponent({
10
10
  setup() {
11
- const supplierRef = ref("amap");
11
+ const supplierRef = ref("gmap");
12
12
  window.supplierRef = supplierRef;
13
13
  return () => h(MapProvider, {
14
14
  "attrs": {
@@ -19,7 +19,7 @@ const App = defineComponent({
19
19
  "language": "en",
20
20
  "supplier": supplierRef.value,
21
21
  "googleSnapRoadProxyUrl": "/overseas/maps/snapToRoads",
22
- "googleRoutesProxyUrl": "/overseas/maps/routes/directions",
22
+ "googleRoutesProxyUrl": "/overseas/maps/routes/directions/v2",
23
23
  "themeVariables": {
24
24
  // 默认主题
25
25
  // TRAFFIC_UNKNOWN_BACKGROUND_COLOR: "#00C875",
@@ -1,5 +1,6 @@
1
1
  import { googleEncodedPolyline2googleLatLng } from "../utils/transform.js";
2
2
  import { isProxyServiceError, createTypeError } from "../utils/typeChecking.js";
3
+ const DEFAULT_GOOGLE_ROUTES_FIELDS = ["routes.polyline", "routes.legs"];
3
4
  const ALL_ROUTES_STATUS = [
4
5
  "OK",
5
6
  "CANCELLED",
@@ -104,6 +105,7 @@ async function apiGoogleRoutes(props) {
104
105
  const { protocol, host } = location;
105
106
  const baseUrl = proxyUrl.startsWith(protocol) ? void 0 : `${protocol}//${host}`;
106
107
  const url = new URL(proxyUrl, baseUrl);
108
+ url.searchParams.set("fields", DEFAULT_GOOGLE_ROUTES_FIELDS.join(","));
107
109
  const response = await fetch(url, {
108
110
  method: "POST",
109
111
  headers: { "Content-Type": "application/json" },
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.15.0-sgn1";
3
+ const pkgVersion = "2.16.0-downgrade1";
4
4
  const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
5
5
  const enableSessionLogKey = (key) => {
6
6
  const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
package/dist/v3/App.js CHANGED
@@ -8,7 +8,7 @@ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
8
8
  const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
9
9
  const App = /* @__PURE__ */ defineComponent({
10
10
  setup() {
11
- const supplierRef = ref("amap");
11
+ const supplierRef = ref("gmap");
12
12
  window.supplierRef = supplierRef;
13
13
  return () => createVNode(MapProvider, {
14
14
  "amapKey": amapApiKey,
@@ -18,7 +18,7 @@ const App = /* @__PURE__ */ defineComponent({
18
18
  "language": "en",
19
19
  "supplier": supplierRef.value,
20
20
  "googleSnapRoadProxyUrl": "/overseas/maps/snapToRoads",
21
- "googleRoutesProxyUrl": "/overseas/maps/routes/directions",
21
+ "googleRoutesProxyUrl": "/overseas/maps/routes/directions/v2",
22
22
  "themeVariables": {
23
23
  // 默认主题
24
24
  // TRAFFIC_UNKNOWN_BACKGROUND_COLOR: "#00C875",
@@ -1,5 +1,6 @@
1
1
  import { googleEncodedPolyline2googleLatLng } from "../utils/transform.js";
2
2
  import { isProxyServiceError, createTypeError } from "../utils/typeChecking.js";
3
+ const DEFAULT_GOOGLE_ROUTES_FIELDS = ["routes.polyline", "routes.legs"];
3
4
  const ALL_ROUTES_STATUS = [
4
5
  "OK",
5
6
  "CANCELLED",
@@ -104,6 +105,7 @@ async function apiGoogleRoutes(props) {
104
105
  const { protocol, host } = location;
105
106
  const baseUrl = proxyUrl.startsWith(protocol) ? void 0 : `${protocol}//${host}`;
106
107
  const url = new URL(proxyUrl, baseUrl);
108
+ url.searchParams.set("fields", DEFAULT_GOOGLE_ROUTES_FIELDS.join(","));
107
109
  const response = await fetch(url, {
108
110
  method: "POST",
109
111
  headers: { "Content-Type": "application/json" },
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.15.0-sgn1";
3
+ const pkgVersion = "2.16.0-downgrade1";
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.15.0-sgn1",
3
+ "version": "2.16.0-downgrade1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",