@heycar/heycars-map 2.15.0-domestic3 → 2.15.0-domestic4

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
@@ -249,6 +249,8 @@ export type DriverStatus =
249
249
  // ICON_WAYPOINT_URL: "https://<支付宝oss域名>/heycar-map/svg/0.12/waypoint.svg";
250
250
  }
251
251
  }
252
+ // 可选,是否启用强制浏览器模式
253
+ forceBrowserPlatformH5
252
254
  // 地图加载失败时显示的标题
253
255
  renderLoadFailedTitle={() => (supplier === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败")}
254
256
  // 地图加载失败时显示的描述
@@ -5,7 +5,9 @@ import { type GmapLoaderProps, type UseMapLoaderProps } from "../../hooks/useMap
5
5
  import { type MapSupplierPayolad } from "../../hooks/useMapSupplier";
6
6
  import type { AmapMap } from "../../types/interface";
7
7
  import { type AmapProps } from "../Amap";
8
- export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
8
+ export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription"> & {
9
+ forceBrowserPlatformH5?: boolean;
10
+ };
9
11
  export declare const MapProvider: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<MapProviderProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<MapProviderProps, Required<MapProviderProps>>, "success" | "fail" | "downloadOptimizeEnd", MapProviderProps>;
10
12
  export interface HeycarMapProps extends Pick<GmapLoaderProps, "fallback" | "loading">, Pick<AmapProps, "center" | "zoom"> {
11
13
  mapRef?: SetMap<AmapMap> | SetMap<google.maps.Map>;
@@ -7,7 +7,7 @@ import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.j
7
7
  import { defineLagecySetup } from "../../types/helper.js";
8
8
  import "../../utils/alipayPolyfill.js";
9
9
  import { loadTraditionalChineseConvertOnce } from "../../utils/cn2tw.js";
10
- import { detectWebGL, WEBGL_STATUS, detectBrowserPlatform, OS_PLATFORM, BRWOSER_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
10
+ import { detectWebGL, WEBGL_STATUS, injectForcedBrowserPlatform, BRWOSER_PLATFORM, detectBrowserPlatform, OS_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
11
11
  import { vec2lnglat } from "../../utils/transform.js";
12
12
  import { Amap } from "../Amap/Amap.js";
13
13
  import { Gmap } from "../Gmap/Gmap.js";
@@ -45,12 +45,13 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
45
45
  return Reflect.get(target, name, receiver);
46
46
  }
47
47
  });
48
+ injectForcedBrowserPlatform(props.forceBrowserPlatformH5 ? BRWOSER_PLATFORM.H5 : void 0);
48
49
  provideMapSupplier(context);
49
50
  return () => {
50
51
  var _a;
51
52
  return h("div", [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
52
53
  };
53
- }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
54
+ }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription", "forceBrowserPlatformH5"]);
54
55
  const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
55
56
  slots,
56
57
  emit,
@@ -75,9 +75,6 @@ class SimpleGmapOverLayerGroup extends Set {
75
75
  }
76
76
  function gmapFitBoundNoAnimate(map, bound, padding) {
77
77
  const projection = map.getProjection();
78
- if (!projection) {
79
- debugger;
80
- }
81
78
  if (!projection || bound.isEmpty())
82
79
  return;
83
80
  const { top = 0, right = 0, bottom = 0, left = 0 } = padding;
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.15.0-domestic3";
3
+ const pkgVersion = "2.15.0-domestic4";
4
4
  const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
5
5
  const enableSessionLogKey = (key) => {
6
6
  const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
@@ -22,6 +22,7 @@ export declare enum ALIPAY_WALLET {
22
22
  TMN = "TMN"
23
23
  }
24
24
  export declare const detectAlipayWallet: () => ALIPAY_WALLET | undefined;
25
+ export declare const injectForcedBrowserPlatform: (platform: BRWOSER_PLATFORM | undefined) => BRWOSER_PLATFORM | undefined;
25
26
  export declare const detectBrowserPlatform: () => BRWOSER_PLATFORM;
26
27
  export declare const detectOSPlatform: () => OS_PLATFORM;
27
28
  /**
@@ -35,9 +35,13 @@ const detectAlipayWallet = () => {
35
35
  return "TMN";
36
36
  return void 0;
37
37
  };
38
+ let forcedBrowserPlatform = void 0;
39
+ const injectForcedBrowserPlatform = (platform) => forcedBrowserPlatform = platform;
38
40
  const detectBrowserPlatform = () => {
39
41
  if (typeof navigator === "undefined")
40
42
  return "NODE_JS";
43
+ if (forcedBrowserPlatform)
44
+ return forcedBrowserPlatform;
41
45
  const useragent = navigator.userAgent.toLowerCase();
42
46
  if (useragent.includes("micromessenger")) {
43
47
  return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : useragent.includes("wxwork") ? "ENTERPRISE_WECHAT" : "WECHAT";
@@ -93,5 +97,6 @@ export {
93
97
  detectBrowserPlatform,
94
98
  detectOSPlatform,
95
99
  detectTouchDevice,
96
- detectWebGL
100
+ detectWebGL,
101
+ injectForcedBrowserPlatform
97
102
  };
@@ -5,7 +5,9 @@ import { Status, type GmapLoaderProps, type UseMapLoaderProps } from "../../hook
5
5
  import { type MapSupplierPayolad } from "../../hooks/useMapSupplier";
6
6
  import type { AmapMap } from "../../types/interface";
7
7
  import { type AmapProps } from "../Amap";
8
- export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
8
+ export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription"> & {
9
+ forceBrowserPlatformH5?: boolean;
10
+ };
9
11
  export declare const MapProvider: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<MapProviderProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<MapProviderProps, Required<MapProviderProps>>, "success" | "fail" | "downloadOptimizeEnd", import("vue-demi").PublicProps, MapProviderProps, MapProviderProps, import("vue-demi").SlotsType<{
10
12
  renderLoadFailedTitle?: ((status: Status) => string | undefined) | undefined;
11
13
  renderLoadFailedDescription?: ((status: Status) => string | undefined) | undefined;
@@ -7,7 +7,7 @@ import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.j
7
7
  import { defineLagecySetup } from "../../types/helper.js";
8
8
  import "../../utils/alipayPolyfill.js";
9
9
  import { loadTraditionalChineseConvertOnce } from "../../utils/cn2tw.js";
10
- import { detectWebGL, WEBGL_STATUS, detectBrowserPlatform, OS_PLATFORM, BRWOSER_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
10
+ import { detectWebGL, WEBGL_STATUS, injectForcedBrowserPlatform, BRWOSER_PLATFORM, detectBrowserPlatform, OS_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
11
11
  import { vec2lnglat } from "../../utils/transform.js";
12
12
  import { Amap } from "../Amap/Amap.js";
13
13
  import { Gmap } from "../Gmap/Gmap.js";
@@ -48,12 +48,13 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
48
48
  return Reflect.get(target, name, receiver);
49
49
  }
50
50
  });
51
+ injectForcedBrowserPlatform(props.forceBrowserPlatformH5 ? BRWOSER_PLATFORM.H5 : void 0);
51
52
  provideMapSupplier(context);
52
53
  return () => {
53
54
  var _a;
54
55
  return createVNode("div", null, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
55
56
  };
56
- }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
57
+ }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription", "forceBrowserPlatformH5"]);
57
58
  const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
58
59
  slots,
59
60
  emit,
@@ -75,9 +75,6 @@ class SimpleGmapOverLayerGroup extends Set {
75
75
  }
76
76
  function gmapFitBoundNoAnimate(map, bound, padding) {
77
77
  const projection = map.getProjection();
78
- if (!projection) {
79
- debugger;
80
- }
81
78
  if (!projection || bound.isEmpty())
82
79
  return;
83
80
  const { top = 0, right = 0, bottom = 0, left = 0 } = padding;
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.15.0-domestic3";
3
+ const pkgVersion = "2.15.0-domestic4";
4
4
  const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
5
5
  const enableSessionLogKey = (key) => {
6
6
  const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
@@ -22,6 +22,7 @@ export declare enum ALIPAY_WALLET {
22
22
  TMN = "TMN"
23
23
  }
24
24
  export declare const detectAlipayWallet: () => ALIPAY_WALLET | undefined;
25
+ export declare const injectForcedBrowserPlatform: (platform: BRWOSER_PLATFORM | undefined) => BRWOSER_PLATFORM | undefined;
25
26
  export declare const detectBrowserPlatform: () => BRWOSER_PLATFORM;
26
27
  export declare const detectOSPlatform: () => OS_PLATFORM;
27
28
  /**
@@ -35,9 +35,13 @@ const detectAlipayWallet = () => {
35
35
  return "TMN";
36
36
  return void 0;
37
37
  };
38
+ let forcedBrowserPlatform = void 0;
39
+ const injectForcedBrowserPlatform = (platform) => forcedBrowserPlatform = platform;
38
40
  const detectBrowserPlatform = () => {
39
41
  if (typeof navigator === "undefined")
40
42
  return "NODE_JS";
43
+ if (forcedBrowserPlatform)
44
+ return forcedBrowserPlatform;
41
45
  const useragent = navigator.userAgent.toLowerCase();
42
46
  if (useragent.includes("micromessenger")) {
43
47
  return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : useragent.includes("wxwork") ? "ENTERPRISE_WECHAT" : "WECHAT";
@@ -93,5 +97,6 @@ export {
93
97
  detectBrowserPlatform,
94
98
  detectOSPlatform,
95
99
  detectTouchDevice,
96
- detectWebGL
100
+ detectWebGL,
101
+ injectForcedBrowserPlatform
97
102
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "2.15.0-domestic3",
3
+ "version": "2.15.0-domestic4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",