@heycar/heycars-map 2.15.0-domestic4 → 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.
Files changed (92) hide show
  1. package/README.md +16 -50
  2. package/dist/v2/App.js +2 -2
  3. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -2
  4. package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
  5. package/dist/v2/Demo/DemoBusinessTaxiEnd.js +2 -9
  6. package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -4
  7. package/dist/v2/Demo/DemoBusinessTaxiService.js +1 -19
  8. package/dist/v2/api/googleRoutes.js +2 -0
  9. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  10. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
  11. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +2 -2
  12. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
  13. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
  14. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
  15. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
  16. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
  17. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
  18. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
  19. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
  20. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -80
  21. package/dist/v2/chunks/{BusinessRecomendPlaceMap.eebd0822.js → BusinessRecomendPlaceMap.ed4b75d5.js} +30 -11
  22. package/dist/{v3/chunks/Loading.4b53c31f.js → v2/chunks/Loading.70dfc720.js} +30 -34
  23. package/dist/v2/components/Loading/Loading.js +1 -1
  24. package/dist/v2/components/Loading/index.js +1 -1
  25. package/dist/v2/components/MapProvider/MapProvider.d.ts +1 -3
  26. package/dist/v2/components/MapProvider/MapProvider.js +13 -25
  27. package/dist/v2/hooks/useMapCoordinatify.d.ts +1 -2
  28. package/dist/v2/hooks/useMapCoordinatify.js +1 -6
  29. package/dist/v2/hooks/useMapFitView.js +3 -0
  30. package/dist/v2/hooks/useMapFitZoom.d.ts +6 -0
  31. package/dist/v2/hooks/useMapFitZoom.js +22 -2
  32. package/dist/v2/hooks/useMapLoader.js +3 -3
  33. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  34. package/dist/v2/index.js +1 -1
  35. package/dist/v2/types/interface.d.ts +0 -12
  36. package/dist/v2/utils/geometryPolygon.d.ts +0 -9
  37. package/dist/v2/utils/geometryPolygon.js +0 -19
  38. package/dist/v2/utils/log.js +1 -1
  39. package/dist/v2/utils/platform.d.ts +1 -3
  40. package/dist/v2/utils/platform.js +2 -8
  41. package/dist/v2/utils/typeChecking.d.ts +1 -7
  42. package/dist/v2/utils/typeChecking.js +0 -18
  43. package/dist/v3/App.js +2 -2
  44. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -2
  45. package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
  46. package/dist/v3/Demo/DemoBusinessTaxiEnd.js +2 -9
  47. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -4
  48. package/dist/v3/Demo/DemoBusinessTaxiService.js +1 -19
  49. package/dist/v3/api/googleRoutes.js +2 -0
  50. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  51. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
  52. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +2 -2
  53. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
  54. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
  55. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
  56. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
  57. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
  58. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
  59. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
  60. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
  61. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -62
  62. package/dist/v3/chunks/{BusinessRecomendPlaceMap.71c439c6.js → BusinessRecomendPlaceMap.4ec9353a.js} +30 -9
  63. package/dist/{v2/chunks/Loading.8aa3aad3.js → v3/chunks/Loading.4c949ec9.js} +27 -47
  64. package/dist/v3/components/Loading/Loading.js +1 -1
  65. package/dist/v3/components/Loading/index.js +1 -1
  66. package/dist/v3/components/MapProvider/MapProvider.d.ts +1 -3
  67. package/dist/v3/components/MapProvider/MapProvider.js +14 -26
  68. package/dist/v3/hooks/useMapCoordinatify.d.ts +1 -2
  69. package/dist/v3/hooks/useMapCoordinatify.js +1 -6
  70. package/dist/v3/hooks/useMapFitView.js +3 -0
  71. package/dist/v3/hooks/useMapFitZoom.d.ts +6 -0
  72. package/dist/v3/hooks/useMapFitZoom.js +22 -2
  73. package/dist/v3/hooks/useMapLoader.js +3 -3
  74. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  75. package/dist/v3/index.js +1 -1
  76. package/dist/v3/types/interface.d.ts +0 -12
  77. package/dist/v3/utils/geometryPolygon.d.ts +0 -9
  78. package/dist/v3/utils/geometryPolygon.js +0 -19
  79. package/dist/v3/utils/log.js +1 -1
  80. package/dist/v3/utils/platform.d.ts +1 -3
  81. package/dist/v3/utils/platform.js +2 -8
  82. package/dist/v3/utils/typeChecking.d.ts +1 -7
  83. package/dist/v3/utils/typeChecking.js +0 -18
  84. package/package.json +1 -1
  85. package/dist/v2/Demo/demo.data.mock.d.ts +0 -4
  86. package/dist/v2/Demo/demo.data.mock.js +0 -1194
  87. package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +0 -6
  88. package/dist/v2/business-components/TaxiCar/RandomCars.js +0 -47
  89. package/dist/v3/Demo/demo.data.mock.d.ts +0 -4
  90. package/dist/v3/Demo/demo.data.mock.js +0 -1194
  91. package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +0 -8
  92. package/dist/v3/business-components/TaxiCar/RandomCars.js +0 -45
@@ -26,7 +26,6 @@ import { DeviceOrientation } from "../business-components/DeviceOrientation/Devi
26
26
  import { GreenZone } from "../business-components/GreenZone/GreenZone.js";
27
27
  import { PassengerCircle } from "../business-components/PassengerCircle/PassengerCircle.js";
28
28
  import { PickupPoints } from "../business-components/PickupPoints/PickupPoints.js";
29
- import { RandomCars } from "../business-components/TaxiCar/RandomCars.js";
30
29
  import { useCacheCenterPlace } from "../business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js";
31
30
  import { b as baseGetTag, r as root } from "./isSymbol.555c14bf.js";
32
31
  import { i as isObject } from "./debounce.5afe7867.js";
@@ -260,6 +259,24 @@ function memoize(func, resolver) {
260
259
  return memoized;
261
260
  }
262
261
  memoize.Cache = MapCache;
262
+ const airportSgnBounds = [
263
+ [
264
+ 106.632607,
265
+ 10.832126
266
+ ],
267
+ [
268
+ 106.67934,
269
+ 10.832126
270
+ ],
271
+ [
272
+ 106.67934,
273
+ 10.805079
274
+ ],
275
+ [
276
+ 106.632607,
277
+ 10.805079
278
+ ]
279
+ ];
263
280
  const RECOMMEND_PLACE_DRAG_LIMIT = 10;
264
281
  const RECOMMEND_PLACE_LARGE_LIMIT = 100;
265
282
  const RECOMMEND_PLACE_ICON_ZOOM_MIN = 16.25;
@@ -287,7 +304,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
287
304
  geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
288
305
  getAvailable: inputGetAvailable,
289
306
  getRecomendPlace: inputGetRecomendPlace,
290
- mapContext
307
+ mapContext,
308
+ skipWaitGeo
291
309
  } = props;
292
310
  const abortController = new AbortController();
293
311
  const {
@@ -320,7 +338,11 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
320
338
  setFitZoom
321
339
  } = useMapFitZoom({
322
340
  mapRef,
323
- padding: ZONE_FITVIEW_PANDING
341
+ padding: ZONE_FITVIEW_PANDING,
342
+ certainZoomAreas: [{
343
+ zoom: DEFAULT_ZOOM,
344
+ points: airportSgnBounds
345
+ }]
324
346
  });
325
347
  const {
326
348
  readyPromise,
@@ -337,7 +359,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
337
359
  } = useCacheCenterPlace({
338
360
  defaultCenterPlace: props.defaultCenterPlace,
339
361
  emptyTitle,
340
- geoLoadingTitle
362
+ geoLoadingTitle,
363
+ skipWaitGeo
341
364
  });
342
365
  const centerSource = {
343
366
  source: "default"
@@ -557,7 +580,6 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
557
580
  recomendDescription,
558
581
  unavailableTitle,
559
582
  forbiddenTitle,
560
- enableNearbyCars,
561
583
  disableLocator,
562
584
  renderPlacePhoto,
563
585
  renderPlaceTag
@@ -605,8 +627,6 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
605
627
  "zoomIconMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_ICON_MIN : RECOMMEND_PLACE_ICON_ZOOM_MIN,
606
628
  "zoomTextMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_TEXT_MIN : RECOMMEND_PLACE_TEXT_ZOOM_MIN,
607
629
  "onClick": panToCenterByPlace
608
- }, null), !!enableNearbyCars && zoomRef.value >= RECOMMEND_PLACE_ZONE_ICON_MIN && createVNode(RandomCars, {
609
- "center": [centerPlace.lng, centerPlace.lat]
610
630
  }, null)];
611
631
  }
612
632
  });
@@ -631,7 +651,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
631
651
  key: `${payload.supplier}${instanceNo}`,
632
652
  on: generateCreateElementV2PropsOn(props, emit, ["loadGeoLocation", "loadDefaultGeoLocation", "changeByDrag", "changeGeoLocation", "changePlace", "changeRecomandPlace", "geoError", "geoErrorOnce", "clickLocatorText", "clickLocatorPhoto"])
633
653
  });
634
- }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "geoErrorOnceNotificationKey", "unavailableTitle", "forbiddenTitle", "recomendDescription", "enableNearbyCars", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
654
+ }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "skipWaitGeo", "geoErrorOnceNotificationKey", "unavailableTitle", "forbiddenTitle", "recomendDescription", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
635
655
  export {
636
656
  BusinessRecomendPlaceMap as B,
637
657
  DEFAULT_ZOOM as D,
@@ -643,6 +663,7 @@ export {
643
663
  RECOMMEND_PLACE_ICON_ZOOM_MIN as c,
644
664
  RECOMMEND_PLACE_ZONE_TEXT_MIN as d,
645
665
  RECOMMEND_PLACE_TEXT_ZOOM_MIN as e,
646
- BusinessRecomendPlaceMapInner as f,
666
+ airportSgnBounds as f,
667
+ BusinessRecomendPlaceMapInner as g,
647
668
  memoize as m
648
669
  };
@@ -1,5 +1,5 @@
1
1
  import "../css/Loading-49e58ced.css";
2
- import { h } from "vue";
2
+ import { createVNode } from "vue";
3
3
  import { ICON_LOAD_FAILED_URL } from "../api/cdn.js";
4
4
  import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
5
5
  import { useMapSupplier } from "../hooks/useMapSupplier.js";
@@ -14,58 +14,38 @@ var loadingBg = "_17ify491";
14
14
  var loadingLayout = "_17ify490";
15
15
  var title = "_17ify495";
16
16
  var verticalGap = "_17ify494";
17
- const Loading = defineSetup("Loading", function(_, {
18
- attrs
19
- }) {
20
- return () => {
21
- var _a;
22
- return h("div", {
23
- "class": `${loadingLayout} ${(_a = attrs.class) != null ? _a : ""}`,
24
- "style": attrs.style
25
- }, [h("img", {
26
- "class": loadingBg,
27
- "attrs": {
28
- "src": imgGrid
29
- }
30
- }), h(AbsoluteAddressBox, {
31
- "attrs": {
32
- "type": "loading",
33
- "title": ""
34
- }
35
- })]);
36
- };
17
+ const Loading = defineSetup("Loading", function() {
18
+ return () => createVNode("div", {
19
+ "class": loadingLayout
20
+ }, [createVNode("img", {
21
+ "class": loadingBg,
22
+ "src": imgGrid
23
+ }, null), createVNode(AbsoluteAddressBox, {
24
+ "type": "loading",
25
+ "title": ""
26
+ }, null)]);
37
27
  });
38
- const LoadFailed = defineSetup("LoadFailed", function(props, {
39
- attrs
40
- }) {
28
+ const LoadFailed = defineSetup("LoadFailed", function(props) {
41
29
  var _a, _b;
42
30
  const {
43
31
  themeVariables
44
32
  } = useMapSupplier();
45
33
  const icon = (_b = (_a = props.icon) != null ? _a : themeVariables == null ? void 0 : themeVariables.ICON_LOAD_FAILED_URL) != null ? _b : ICON_LOAD_FAILED_URL;
46
- return () => {
47
- var _a2;
48
- return h("div", {
49
- "class": `${loadingLayout} ${(_a2 = attrs.class) != null ? _a2 : ""}`,
50
- "style": attrs.style
51
- }, [h("img", {
52
- "class": loadingBg,
53
- "attrs": {
54
- "src": imgGrid
55
- }
56
- }), h("div", {
57
- "class": contentLayout
58
- }, [h(SvgInlineWebComponentTag, {
59
- "class": iconLoadFailed,
60
- "attrs": {
61
- "src": icon
62
- }
63
- }), h("span", {
64
- "class": `${title} ${verticalGap}`
65
- }, [props.title]), h("span", {
66
- "class": `${description} ${verticalGap}`
67
- }, [props.description])])]);
68
- };
34
+ return () => createVNode("div", {
35
+ "class": loadingLayout
36
+ }, [createVNode("img", {
37
+ "class": loadingBg,
38
+ "src": imgGrid
39
+ }, null), createVNode("div", {
40
+ "class": contentLayout
41
+ }, [createVNode(SvgInlineWebComponentTag, {
42
+ "class": iconLoadFailed,
43
+ "src": icon
44
+ }, null), createVNode("span", {
45
+ "class": `${title} ${verticalGap}`
46
+ }, [props.title]), createVNode("span", {
47
+ "class": `${description} ${verticalGap}`
48
+ }, [props.description])])]);
69
49
  });
70
50
  export {
71
51
  LoadFailed as L,
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
2
  import "../../api/cdn.js";
3
- import { L, a } from "../../chunks/Loading.4b53c31f.js";
3
+ import { L, a } from "../../chunks/Loading.4c949ec9.js";
4
4
  import "../../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
5
5
  import "../../hooks/useMapSupplier.js";
6
6
  import "../../types/helper.js";
@@ -1,4 +1,4 @@
1
- import { L, a } from "../../chunks/Loading.4b53c31f.js";
1
+ import { L, a } from "../../chunks/Loading.4c949ec9.js";
2
2
  export {
3
3
  L as LoadFailed,
4
4
  a as Loading
@@ -5,9 +5,7 @@ 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"> & {
9
- forceBrowserPlatformH5?: boolean;
10
- };
8
+ export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
11
9
  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<{
12
10
  renderLoadFailedTitle?: ((status: Status) => string | undefined) | undefined;
13
11
  renderLoadFailedDescription?: ((status: Status) => string | undefined) | undefined;
@@ -1,13 +1,13 @@
1
1
  import "../../css/MapProvider-156bfd53.css";
2
2
  import { createVNode, isVNode } from "vue";
3
3
  import { reactive, toRefs } from "vue-demi";
4
- import { L as LoadFailed, a as Loading, i as imgGrid } from "../../chunks/Loading.4b53c31f.js";
4
+ import { L as LoadFailed, a as Loading, i as imgGrid } from "../../chunks/Loading.4c949ec9.js";
5
5
  import { useMapLoader, Status } from "../../hooks/useMapLoader.js";
6
6
  import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
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, injectForcedBrowserPlatform, BRWOSER_PLATFORM, detectBrowserPlatform, OS_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
10
+ import { detectWebGL, WEBGL_STATUS, detectBrowserPlatform, OS_PLATFORM, BRWOSER_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,13 +48,12 @@ 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);
52
51
  provideMapSupplier(context);
53
52
  return () => {
54
53
  var _a;
55
54
  return createVNode("div", null, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
56
55
  };
57
- }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription", "forceBrowserPlatformH5"]);
56
+ }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
58
57
  const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
59
58
  slots,
60
59
  emit,
@@ -84,7 +83,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
84
83
  });
85
84
  loadTraditionalChineseConvertOnce(payload.language === "zh-TW");
86
85
  return () => {
87
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
86
+ var _a, _b, _c, _d, _e, _f, _g, _h;
88
87
  const {
89
88
  supplier,
90
89
  gmapId,
@@ -103,28 +102,17 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
103
102
  const node = (_a = slots.fallback) == null ? void 0 : _a.call(slots);
104
103
  const title = (_b = payload.renderLoadFailedTitle) == null ? void 0 : _b.call(payload, status);
105
104
  const description = (_c = payload.renderLoadFailedDescription) == null ? void 0 : _c.call(payload, status);
106
- return node ? createVNode("div", {
107
- "class": (_d = attrs.class) != null ? _d : "",
108
- "style": attrs.style
109
- }, [node]) : createVNode(LoadFailed, {
110
- "class": (_e = attrs.class) != null ? _e : "",
105
+ return node ? createVNode("div", null, [node]) : createVNode(LoadFailed, {
111
106
  "title": title,
112
- "description": description,
113
- "style": attrs.style
107
+ "description": description
114
108
  }, null);
115
109
  }
116
110
  if (status === Status.LOADING || status === Status.SUCCESS && pingStatus === "pending") {
117
- const node = (_f = slots.loading) == null ? void 0 : _f.call(slots);
118
- return node ? createVNode("div", {
119
- "class": (_g = attrs.class) != null ? _g : "",
120
- "style": attrs.style
121
- }, [node]) : createVNode(Loading, {
122
- "class": (_h = attrs.class) != null ? _h : "",
123
- "style": attrs.style
124
- }, null);
111
+ const node = (_d = slots.loading) == null ? void 0 : _d.call(slots);
112
+ return node ? createVNode("div", null, [node]) : createVNode(Loading, null, null);
125
113
  }
126
- const children = (_i = slots.default) == null ? void 0 : _i.call(slots);
127
- const outArea = (_j = slots.outerArea) == null ? void 0 : _j.call(slots);
114
+ const children = (_e = slots.default) == null ? void 0 : _e.call(slots);
115
+ const outArea = (_f = slots.outerArea) == null ? void 0 : _f.call(slots);
128
116
  switch (supplier) {
129
117
  case "gmap": {
130
118
  const renderingType = compatibleGmapRenderingType({
@@ -132,7 +120,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
132
120
  touchZoomCenter
133
121
  });
134
122
  return createVNode("div", {
135
- "class": `${heycarMap} ${(_k = attrs.class) != null ? _k : ""}`,
123
+ "class": `${heycarMap} ${(_g = attrs.class) != null ? _g : ""}`,
136
124
  "lang": language,
137
125
  "style": attrs.style
138
126
  }, [createVNode(Gmap, {
@@ -152,8 +140,8 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
152
140
  "onDragEnd": gmapHandleDargEnd,
153
141
  "onResize": handleResize,
154
142
  "backgroundColor": "transparent"
155
- }, {
156
- default: () => [createVNode("div", null, [children])]
143
+ }, _isSlot(children) ? children : {
144
+ default: () => [children]
157
145
  }), createVNode("img", {
158
146
  "class": heycarGmapBackgroundDefaultLoadingImage,
159
147
  "src": imgGrid
@@ -161,7 +149,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
161
149
  }
162
150
  default:
163
151
  return createVNode("div", {
164
- "class": `${heycarMap} ${(_l = attrs.class) != null ? _l : ""}`,
152
+ "class": `${heycarMap} ${(_h = attrs.class) != null ? _h : ""}`,
165
153
  "lang": language,
166
154
  "style": attrs.style
167
155
  }, [createVNode(Amap, {
@@ -1,4 +1,4 @@
1
- import { type CoordinateExternalRoute, type CoordinateGeoPosition, type CoordinatePlace, type CoordinatePoint, type CoordinateRecommendZonePlaces, type CoordinateTrackPoint, type CoordinateValueOfOnChangeRecommendPlace, type CoordinateZone, type ExternalRoute, type GeoPosition, type Place, type Point, type RecommendZonePlaces, type TrackPoint, type ValueOfOnChangeRecommendPlace, type Zone } from "../types/interface";
1
+ import { type CoordinateGeoPosition, type CoordinatePlace, type CoordinatePoint, type CoordinateRecommendZonePlaces, type CoordinateTrackPoint, type CoordinateValueOfOnChangeRecommendPlace, type CoordinateZone, type GeoPosition, type Place, type Point, type RecommendZonePlaces, type TrackPoint, type ValueOfOnChangeRecommendPlace, type Zone } from "../types/interface";
2
2
  export declare function useMapCoordinatify(): {
3
3
  coordinatifyPoint: (value: Point) => CoordinatePoint;
4
4
  unCoordinatifyPoint: (value: CoordinatePoint) => Point;
@@ -12,5 +12,4 @@ export declare function useMapCoordinatify(): {
12
12
  unCoordinatifyValueOfOnChangeRecommendPlace: (value: CoordinateValueOfOnChangeRecommendPlace) => ValueOfOnChangeRecommendPlace;
13
13
  coordinatifyGeoPosition: (value: GeoPosition) => CoordinateGeoPosition;
14
14
  unCoordinatifyTrackPoint: (value: CoordinateTrackPoint) => TrackPoint;
15
- unCoordinatifyExternalRoute: (value: CoordinateExternalRoute) => ExternalRoute;
16
15
  };
@@ -74,10 +74,6 @@ function useMapCoordinatify() {
74
74
  const [lng, lat] = unCoordinatifyPoint(value);
75
75
  return { ...others, lng, lat };
76
76
  };
77
- const unCoordinatifyExternalRoute = (value) => {
78
- const { path, duration, distance } = value;
79
- return { path: path.map(unCoordinatifyPoint), duration, distance };
80
- };
81
77
  const coordinatifyGeoPosition = (value) => {
82
78
  return {
83
79
  ...value,
@@ -96,8 +92,7 @@ function useMapCoordinatify() {
96
92
  coordinatifyValueOfOnChangeRecommendPlace,
97
93
  unCoordinatifyValueOfOnChangeRecommendPlace,
98
94
  coordinatifyGeoPosition,
99
- unCoordinatifyTrackPoint,
100
- unCoordinatifyExternalRoute
95
+ unCoordinatifyTrackPoint
101
96
  };
102
97
  }
103
98
  export {
@@ -75,6 +75,9 @@ 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
+ }
78
81
  if (!projection || bound.isEmpty())
79
82
  return;
80
83
  const { top = 0, right = 0, bottom = 0, left = 0 } = padding;
@@ -1,9 +1,15 @@
1
1
  /// <reference types="google.maps" />
2
2
  import type { AmapMap, MapShallowRef, Point } from "../types/interface";
3
+ interface CertainZoomArea {
4
+ zoom: number;
5
+ points: Point[];
6
+ }
3
7
  export interface UseMapFitZoomProps<M = AmapMap | google.maps.Map> {
4
8
  mapRef: MapShallowRef<M>;
5
9
  padding?: [number, number, number, number];
10
+ certainZoomAreas?: CertainZoomArea[];
6
11
  }
7
12
  export declare const useMapFitZoom: (props: UseMapFitZoomProps) => {
8
13
  setFitZoom: (points?: Point[], base?: Point, immediate?: boolean) => void;
9
14
  };
15
+ export {};
@@ -1,3 +1,4 @@
1
+ import { pointInPolygon } from "../utils/geometryPolygon.js";
1
2
  import { vec2lnglat, deltaZoom2animationDuration } from "../utils/transform.js";
2
3
  import { useMapSupplier } from "./useMapSupplier.js";
3
4
  const points2bound = (points) => {
@@ -7,8 +8,17 @@ const points2bound = (points) => {
7
8
  const latList = points.map((p) => p[1]);
8
9
  return [Math.min(...latList), Math.max(...lngList), Math.max(...latList), Math.min(...lngList)];
9
10
  };
11
+ const matchCertainZoomArea = (point, certainZoomAreas) => {
12
+ if (!point || !certainZoomAreas)
13
+ return void 0;
14
+ for (const area of certainZoomAreas) {
15
+ if (pointInPolygon(point, area.points) >= 0)
16
+ return area.zoom;
17
+ }
18
+ return void 0;
19
+ };
10
20
  const useAmapFitZoom = (props) => {
11
- const { mapRef, padding = [0, 0, 0, 0] } = props;
21
+ const { mapRef, padding = [0, 0, 0, 0], certainZoomAreas } = props;
12
22
  const setZoom = (v, immediate = false) => {
13
23
  var _a, _b, _c, _d;
14
24
  if (immediate)
@@ -21,6 +31,11 @@ const useAmapFitZoom = (props) => {
21
31
  const map = mapRef.value;
22
32
  if (!points || !(map == null ? void 0 : map.amap))
23
33
  return;
34
+ const matchedCertainZoom = matchCertainZoomArea(points[0], certainZoomAreas);
35
+ if (matchedCertainZoom) {
36
+ setZoom(matchedCertainZoom, immediate);
37
+ return;
38
+ }
24
39
  const bound = points2bound(points.map((p) => {
25
40
  var _a;
26
41
  return (_a = map.lngLatToPixel(p, 0)) == null ? void 0 : _a.toArray();
@@ -49,7 +64,7 @@ const useAmapFitZoom = (props) => {
49
64
  return { setFitZoom };
50
65
  };
51
66
  const useGmapFitZoom = (props) => {
52
- const { mapRef, padding = [0, 0, 0, 0] } = props;
67
+ const { mapRef, padding = [0, 0, 0, 0], certainZoomAreas } = props;
53
68
  const setZoom = (v, immediate = false) => {
54
69
  var _a, _b;
55
70
  if (immediate)
@@ -63,6 +78,11 @@ const useGmapFitZoom = (props) => {
63
78
  const projection = map.getProjection();
64
79
  if (!projection)
65
80
  return;
81
+ const matchedCertainZoom = matchCertainZoomArea(points[0], certainZoomAreas);
82
+ if (matchedCertainZoom) {
83
+ setZoom(matchedCertainZoom, immediate);
84
+ return;
85
+ }
66
86
  const bound = points2bound(
67
87
  points.map((p) => {
68
88
  const { x, y } = projection.fromLatLngToPoint(vec2lnglat(p));
@@ -549,7 +549,7 @@ var dist = {
549
549
  });
550
550
  })(dist);
551
551
  const MIN_MAP_RELOAD_INTERVAL = 5e3;
552
- const MIN_GMAP_LOAD_RESET_THRESHOLD = 1e3;
552
+ const MIN_MAP_LOAD_RESET_THRESHOLD = 1e3;
553
553
  const DEFAULT_AMAP_PLUGINS = [
554
554
  "AMap.Geocoder",
555
555
  "AMap.Driving",
@@ -608,7 +608,7 @@ const useAmapLoader = (props) => {
608
608
  if (statusRef.value === "SUCCESS")
609
609
  return Promise.resolve();
610
610
  defineSecurityOnce();
611
- distExports.reset();
611
+ throttledExecute(() => distExports.reset());
612
612
  statusRef.value = "LOADING";
613
613
  setTimeout(preloadAmapStyleOnce);
614
614
  const startTime = Date.now();
@@ -651,7 +651,7 @@ const useAmapLoader = (props) => {
651
651
  watchPostEffectForDeepOption(() => [optionsRef.value, disableRef == null ? void 0 : disableRef.value], keepRetry);
652
652
  return { statusRef, pingStatusRef, readyPromise };
653
653
  };
654
- const throttledExecute = throttle((fn) => fn(), MIN_GMAP_LOAD_RESET_THRESHOLD, {
654
+ const throttledExecute = throttle((fn) => fn(), MIN_MAP_LOAD_RESET_THRESHOLD, {
655
655
  trailing: false
656
656
  });
657
657
  const useGmapLoader = (props) => {
@@ -1,5 +1,5 @@
1
1
  import { reactive, ref, readonly } from "vue-demi";
2
- import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.71c439c6.js";
2
+ import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.4ec9353a.js";
3
3
  import { CenterPlaceStatus } from "../types/interface.js";
4
4
  import { proxyFunctionalProperty, assertAssingedBeforeUsed } from "../utils/helper.js";
5
5
  const useBusinessRecomendPlaceMap = () => {
package/dist/v3/index.js CHANGED
@@ -2,7 +2,7 @@ import "./utils/alipayPolyfill.js";
2
2
  import { isCoordinatePointEqual } from "./api/geometry.js";
3
3
  import { AbsoluteAddressBox } from "./business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
4
4
  import { BusinessQuotingMap } from "./business-components/BusinessQuotingMap/BusinessQuotingMap.js";
5
- import { B } from "./chunks/BusinessRecomendPlaceMap.71c439c6.js";
5
+ import { B } from "./chunks/BusinessRecomendPlaceMap.4ec9353a.js";
6
6
  import { BusinessReselectPlaceMap } from "./business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js";
7
7
  import { BusinessTaxiEndMap } from "./business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
8
8
  import { BusinessTaxiServiceMap } from "./business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js";
@@ -80,11 +80,6 @@ export interface Route {
80
80
  steps: RouteStep[];
81
81
  trafficJams?: TrafficJams;
82
82
  }
83
- export interface ExternalRoute {
84
- path: Point[];
85
- duration: number;
86
- distance: number;
87
- }
88
83
  export interface TrackPoint {
89
84
  lng: number;
90
85
  lat: number;
@@ -95,13 +90,6 @@ export interface TrackPoint {
95
90
  export interface CoordinateTrackPoint extends TrackPoint {
96
91
  type: CoordinateType;
97
92
  }
98
- export interface CoordinateExternalRoute extends Omit<ExternalRoute, "path"> {
99
- path: CoordinatePoint[];
100
- }
101
- export type GetDriverRouteOrTrackOutput = {
102
- routes?: CoordinateExternalRoute;
103
- tracks?: CoordinateTrackPoint[];
104
- };
105
93
  export type RecommendType = "Restricted" | "Forbidden" | "Recommend";
106
94
  export type DriverStatus = "dispatching" | "book-dispatching" | "dispatched" | "driverStartService" | "driverStartRelayService" | "book-driverStartService" | "book-dispatched" | "driverArrived" | "inService" | "canceled" | "endService" | "completed" | "canceling" | "banlanceRefund" | "waitBanlanceRefund" | "rechargePayed" | "waitRechargePay" | "payed" | "waitpay" | "refund" | "confirmed" | "assign" | "orderReassigned";
107
95
  export declare enum CenterPlaceStatus {
@@ -9,12 +9,3 @@ export declare const distanceBetweenTwoPoints: (from: Point, to: Point) => numbe
9
9
  * 计算折线(按顺序连接各点)总长度。
10
10
  */
11
11
  export declare const computeLineLength: (line: Point[]) => number;
12
- /**
13
- * 计算从起点指向终点的初始方位角(heading)。
14
- * 说明:
15
- * - 基于球面大圆航线计算(WGS84 半径近似),与常见地图 SDK 的 heading 含义一致
16
- * - 返回范围为 [-180, 180](度):0 表示正北,正值为东偏北,负值为西偏南
17
- * - 起终点经纬完全相同返回 0
18
- * @returns 初始方位角(度)
19
- */
20
- export declare const computeLineAngle: (from: Point, to: Point) => number;
@@ -47,26 +47,7 @@ const computeLineLength = (line) => {
47
47
  }
48
48
  return totalLength;
49
49
  };
50
- const computeLineAngle = (from, to) => {
51
- const [lng1, lat1] = from;
52
- const [lng2, lat2] = to;
53
- if (lng1 === lng2 && lat1 === lat2)
54
- return 0;
55
- const toRad = (deg) => deg * Math.PI / 180;
56
- const toDeg = (rad) => rad * 180 / Math.PI;
57
- const phi1 = toRad(lat1);
58
- const phi2 = toRad(lat2);
59
- const lambda1 = toRad(lng1);
60
- const lambda2 = toRad(lng2);
61
- const deltaLambda = lambda2 - lambda1;
62
- const y = Math.sin(deltaLambda) * Math.cos(phi2);
63
- const x = Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(deltaLambda);
64
- let heading = toDeg(Math.atan2(y, x));
65
- heading = (heading + 540) % 360 - 180;
66
- return heading;
67
- };
68
50
  export {
69
- computeLineAngle,
70
51
  computeLineLength,
71
52
  distanceBetweenTwoPoints,
72
53
  pointInPolygon
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.15.0-domestic4";
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);
@@ -4,8 +4,7 @@ export declare enum BRWOSER_PLATFORM {
4
4
  ALIPAY = "ALIPAY",
5
5
  ALIPAY_MINIPROGRAM = "ALIPAY_MINIPROGRAM",
6
6
  H5 = "H5",
7
- NODE_JS = "NODE_JS",
8
- ENTERPRISE_WECHAT = "ENTERPRISE_WECHAT"
7
+ NODE_JS = "NODE_JS"
9
8
  }
10
9
  export declare enum OS_PLATFORM {
11
10
  IOS = "IOS",
@@ -22,7 +21,6 @@ export declare enum ALIPAY_WALLET {
22
21
  TMN = "TMN"
23
22
  }
24
23
  export declare const detectAlipayWallet: () => ALIPAY_WALLET | undefined;
25
- export declare const injectForcedBrowserPlatform: (platform: BRWOSER_PLATFORM | undefined) => BRWOSER_PLATFORM | undefined;
26
24
  export declare const detectBrowserPlatform: () => BRWOSER_PLATFORM;
27
25
  export declare const detectOSPlatform: () => OS_PLATFORM;
28
26
  /**
@@ -5,7 +5,6 @@ var BRWOSER_PLATFORM = /* @__PURE__ */ ((BRWOSER_PLATFORM2) => {
5
5
  BRWOSER_PLATFORM2["ALIPAY_MINIPROGRAM"] = "ALIPAY_MINIPROGRAM";
6
6
  BRWOSER_PLATFORM2["H5"] = "H5";
7
7
  BRWOSER_PLATFORM2["NODE_JS"] = "NODE_JS";
8
- BRWOSER_PLATFORM2["ENTERPRISE_WECHAT"] = "ENTERPRISE_WECHAT";
9
8
  return BRWOSER_PLATFORM2;
10
9
  })(BRWOSER_PLATFORM || {});
11
10
  var OS_PLATFORM = /* @__PURE__ */ ((OS_PLATFORM2) => {
@@ -35,16 +34,12 @@ const detectAlipayWallet = () => {
35
34
  return "TMN";
36
35
  return void 0;
37
36
  };
38
- let forcedBrowserPlatform = void 0;
39
- const injectForcedBrowserPlatform = (platform) => forcedBrowserPlatform = platform;
40
37
  const detectBrowserPlatform = () => {
41
38
  if (typeof navigator === "undefined")
42
39
  return "NODE_JS";
43
- if (forcedBrowserPlatform)
44
- return forcedBrowserPlatform;
45
40
  const useragent = navigator.userAgent.toLowerCase();
46
41
  if (useragent.includes("micromessenger")) {
47
- return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : useragent.includes("wxwork") ? "ENTERPRISE_WECHAT" : "WECHAT";
42
+ return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : "WECHAT";
48
43
  }
49
44
  if (useragent.includes("alipay") || detectAlipayWallet()) {
50
45
  return useragent.includes("miniprogram") ? "ALIPAY_MINIPROGRAM" : "ALIPAY";
@@ -97,6 +92,5 @@ export {
97
92
  detectBrowserPlatform,
98
93
  detectOSPlatform,
99
94
  detectTouchDevice,
100
- detectWebGL,
101
- injectForcedBrowserPlatform
95
+ detectWebGL
102
96
  };
@@ -1,4 +1,4 @@
1
- import type { CoordinateExternalRoute, CoordinatePlace, CoordinatePoint, CoordinateRecommendZonePlaces, CoordinateTrackPoint, CoordinateType, CoordinateZone, ProxyServiceError, RecommendType } from "../types/interface";
1
+ import type { CoordinatePlace, CoordinatePoint, CoordinateRecommendZonePlaces, CoordinateTrackPoint, CoordinateType, CoordinateZone, ProxyServiceError, RecommendType } from "../types/interface";
2
2
  export declare const createTypeError: (typeName: string, value: unknown, detail?: string) => Error;
3
3
  export declare function isCoordinateType(type: unknown): type is CoordinateType;
4
4
  export declare function isRecommendType(type: unknown): type is RecommendType;
@@ -41,12 +41,6 @@ interface MaybeCoordinateTrackPoint {
41
41
  timestamp?: number | string;
42
42
  }
43
43
  export declare const toCoordinateTrackPoint: (value?: MaybeCoordinateTrackPoint) => CoordinateTrackPoint;
44
- interface MaybeCoordinateExternalRoute {
45
- path?: MaybeCoordinatePoint[];
46
- duration?: number | string | null;
47
- distance?: number | string | null;
48
- }
49
- export declare const toCoordinateExternalRoute: (maybeCoordinateExternalRoute?: MaybeCoordinateExternalRoute) => CoordinateExternalRoute;
50
44
  export declare function isProxyServiceError(error: unknown): error is ProxyServiceError;
51
45
  export declare function toGeolocationPositionError(error: unknown, prefix?: string): GeolocationPositionError;
52
46
  /**