@heycar/heycars-map 2.15.0-domestic2 → 2.15.0-sgn1

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 (84) hide show
  1. package/README.md +15 -47
  2. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -2
  3. package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
  4. package/dist/v2/Demo/DemoBusinessTaxiEnd.js +2 -9
  5. package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -4
  6. package/dist/v2/Demo/DemoBusinessTaxiService.js +1 -19
  7. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  8. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
  9. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +2 -2
  10. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
  11. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
  12. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
  13. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
  14. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
  15. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
  16. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
  17. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
  18. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -80
  19. package/dist/v2/chunks/{BusinessRecomendPlaceMap.eebd0822.js → BusinessRecomendPlaceMap.ed4b75d5.js} +30 -11
  20. package/dist/{v3/chunks/Loading.4b53c31f.js → v2/chunks/Loading.70dfc720.js} +30 -34
  21. package/dist/v2/components/Loading/Loading.js +1 -1
  22. package/dist/v2/components/Loading/index.js +1 -1
  23. package/dist/v2/components/MapProvider/MapProvider.js +10 -21
  24. package/dist/v2/hooks/useMapCoordinatify.d.ts +1 -2
  25. package/dist/v2/hooks/useMapCoordinatify.js +1 -6
  26. package/dist/v2/hooks/useMapFitZoom.d.ts +6 -0
  27. package/dist/v2/hooks/useMapFitZoom.js +22 -2
  28. package/dist/v2/hooks/useMapLoader.js +3 -3
  29. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  30. package/dist/v2/index.js +1 -1
  31. package/dist/v2/types/interface.d.ts +0 -12
  32. package/dist/v2/utils/geometryPolygon.d.ts +0 -9
  33. package/dist/v2/utils/geometryPolygon.js +0 -19
  34. package/dist/v2/utils/log.js +1 -1
  35. package/dist/v2/utils/platform.d.ts +1 -2
  36. package/dist/v2/utils/platform.js +1 -2
  37. package/dist/v2/utils/typeChecking.d.ts +1 -7
  38. package/dist/v2/utils/typeChecking.js +0 -18
  39. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -2
  40. package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
  41. package/dist/v3/Demo/DemoBusinessTaxiEnd.js +2 -9
  42. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -4
  43. package/dist/v3/Demo/DemoBusinessTaxiService.js +1 -19
  44. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  45. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
  46. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +2 -2
  47. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
  48. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
  49. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
  50. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
  51. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
  52. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
  53. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
  54. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
  55. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -62
  56. package/dist/v3/chunks/{BusinessRecomendPlaceMap.71c439c6.js → BusinessRecomendPlaceMap.4ec9353a.js} +30 -9
  57. package/dist/{v2/chunks/Loading.8aa3aad3.js → v3/chunks/Loading.4c949ec9.js} +27 -47
  58. package/dist/v3/components/Loading/Loading.js +1 -1
  59. package/dist/v3/components/Loading/index.js +1 -1
  60. package/dist/v3/components/MapProvider/MapProvider.js +10 -21
  61. package/dist/v3/hooks/useMapCoordinatify.d.ts +1 -2
  62. package/dist/v3/hooks/useMapCoordinatify.js +1 -6
  63. package/dist/v3/hooks/useMapFitZoom.d.ts +6 -0
  64. package/dist/v3/hooks/useMapFitZoom.js +22 -2
  65. package/dist/v3/hooks/useMapLoader.js +3 -3
  66. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  67. package/dist/v3/index.js +1 -1
  68. package/dist/v3/types/interface.d.ts +0 -12
  69. package/dist/v3/utils/geometryPolygon.d.ts +0 -9
  70. package/dist/v3/utils/geometryPolygon.js +0 -19
  71. package/dist/v3/utils/log.js +1 -1
  72. package/dist/v3/utils/platform.d.ts +1 -2
  73. package/dist/v3/utils/platform.js +1 -2
  74. package/dist/v3/utils/typeChecking.d.ts +1 -7
  75. package/dist/v3/utils/typeChecking.js +0 -18
  76. package/package.json +1 -1
  77. package/dist/v2/Demo/demo.data.mock.d.ts +0 -4
  78. package/dist/v2/Demo/demo.data.mock.js +0 -1194
  79. package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +0 -6
  80. package/dist/v2/business-components/TaxiCar/RandomCars.js +0 -47
  81. package/dist/v3/Demo/demo.data.mock.d.ts +0 -4
  82. package/dist/v3/Demo/demo.data.mock.js +0 -1194
  83. package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +0 -8
  84. package/dist/v3/business-components/TaxiCar/RandomCars.js +0 -45
@@ -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.eebd0822.js";
2
+ import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
3
3
  import { CenterPlaceStatus } from "../types/interface.js";
4
4
  import { proxyFunctionalProperty, assertAssingedBeforeUsed } from "../utils/helper.js";
5
5
  const useBusinessRecomendPlaceMap = () => {
package/dist/v2/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.eebd0822.js";
5
+ import { B } from "./chunks/BusinessRecomendPlaceMap.ed4b75d5.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-domestic2";
3
+ const pkgVersion = "2.15.0-sgn1";
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",
@@ -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) => {
@@ -40,7 +39,7 @@ const detectBrowserPlatform = () => {
40
39
  return "NODE_JS";
41
40
  const useragent = navigator.userAgent.toLowerCase();
42
41
  if (useragent.includes("micromessenger")) {
43
- return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : useragent.includes("wxwork") ? "ENTERPRISE_WECHAT" : "WECHAT";
42
+ return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : "WECHAT";
44
43
  }
45
44
  if (useragent.includes("alipay") || detectAlipayWallet()) {
46
45
  return useragent.includes("miniprogram") ? "ALIPAY_MINIPROGRAM" : "ALIPAY";
@@ -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
  /**
@@ -107,23 +107,6 @@ const toCoordinateTrackPoint = (value) => {
107
107
  }
108
108
  return { lng, lat, type, angle, speed, timestamp };
109
109
  };
110
- const toCoordinateExternalRoute = (maybeCoordinateExternalRoute) => {
111
- var _a;
112
- try {
113
- if (!maybeCoordinateExternalRoute)
114
- throw Error();
115
- const duration = Number(maybeCoordinateExternalRoute.duration);
116
- const distance = Number(maybeCoordinateExternalRoute.distance);
117
- if (isNaN(duration) || isNaN(distance))
118
- throw Error();
119
- if (!Array.isArray(maybeCoordinateExternalRoute.path))
120
- throw Error();
121
- const path = (_a = maybeCoordinateExternalRoute.path) == null ? void 0 : _a.map(toCoordinatePointType);
122
- return { path, duration, distance };
123
- } catch (err) {
124
- throw createTypeError("CoordinateExternalRoute", maybeCoordinateExternalRoute, err == null ? void 0 : err.message);
125
- }
126
- };
127
110
  function isProxyServiceError(error) {
128
111
  return !!error && typeof error === "object" && "msg" in error && "code" in error;
129
112
  }
@@ -189,7 +172,6 @@ export {
189
172
  isCoordinateType,
190
173
  isProxyServiceError,
191
174
  isRecommendType,
192
- toCoordinateExternalRoute,
193
175
  toCoordinatePlaceType,
194
176
  toCoordinatePointType,
195
177
  toCoordinateRecommendZonePlacesType,
@@ -1,5 +1,5 @@
1
1
  import { createVNode } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.71c439c6.js";
2
+ import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.4ec9353a.js";
3
3
  import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
4
4
  import { defineSetup } from "../types/helper.js";
5
5
  import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
@@ -123,7 +123,6 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
123
123
  name: "default place name",
124
124
  displayName: "default place displayName"
125
125
  },
126
- "enableNearbyCars": true,
127
126
  "getAvailable": () => Promise.resolve(true),
128
127
  "getRecomendPlace": getRecomendPlace,
129
128
  "renderPlacePhoto": (place) => {
@@ -1,7 +1,6 @@
1
- import { type CoordinatePlace, type CoordinatePoint } from "../types/interface";
1
+ import { type CoordinatePlace } from "../types/interface";
2
2
  export declare const DemoBusinessTaxiEnd: import("vue-demi").DefineComponent<{}, {}, {
3
3
  from: CoordinatePlace;
4
4
  to: CoordinatePlace;
5
- path: CoordinatePoint[];
6
5
  contentHeight: number;
7
6
  }, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}, {}>;
@@ -2,7 +2,6 @@ import { createVNode, createTextVNode } from "vue";
2
2
  import { defineComponent } from "vue-demi";
3
3
  import { BusinessTaxiEndMap } from "../business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
4
4
  import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
5
- import { mockPath } from "./demo.data.mock.js";
6
5
  const DemoBusinessTaxiEnd = /* @__PURE__ */ defineComponent({
7
6
  name: "DemoBusinessTaxiEnd",
8
7
  data() {
@@ -21,7 +20,6 @@ const DemoBusinessTaxiEnd = /* @__PURE__ */ defineComponent({
21
20
  displayName: "",
22
21
  type: "wgs84"
23
22
  },
24
- path: [],
25
23
  contentHeight: 200
26
24
  };
27
25
  },
@@ -45,24 +43,19 @@ const DemoBusinessTaxiEnd = /* @__PURE__ */ defineComponent({
45
43
  setTimeout(() => {
46
44
  this.contentHeight = 600;
47
45
  }, 2500);
48
- setTimeout(() => {
49
- this.path = [...mockPath];
50
- }, 3500);
51
46
  },
52
47
  render() {
53
48
  const {
54
49
  from,
55
50
  to,
56
- contentHeight,
57
- path
51
+ contentHeight
58
52
  } = this;
59
53
  return createVNode("div", {
60
54
  "class": layout
61
55
  }, [createVNode("div", null, [JSON.stringify(from), createTextVNode(" | "), JSON.stringify(to)]), createVNode(BusinessTaxiEndMap, {
62
56
  "class": adjustedDemo,
63
57
  "from": from,
64
- "to": to,
65
- "path": path
58
+ "to": to
66
59
  }, null), createVNode("div", {
67
60
  "style": {
68
61
  height: `${contentHeight}px`
@@ -1,4 +1,4 @@
1
- import { type CoordinatePlace, type CoordinatePoint, type CoordinateTrackPoint, type DriverStatus, type GetDriverRouteOrTrackOutput } from "../types/interface";
1
+ import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus } from "../types/interface";
2
2
  export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent<{}, {
3
3
  mapContext: import("../hooks-business/useBusinessTaxiServiceMap").BusinessTaxiServiceContext;
4
4
  }, {
@@ -7,9 +7,6 @@ export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent
7
7
  relayTo: Partial<CoordinatePlace>;
8
8
  status: DriverStatus;
9
9
  contentHeight: number;
10
- confirmedPath: CoordinatePoint[];
11
- endServicePath: CoordinatePoint[];
12
10
  }, {}, {
13
11
  getDriverPositionTrack(): Promise<CoordinateTrackPoint[]>;
14
- getDriverRouteOrTrack(): Promise<GetDriverRouteOrTrackOutput>;
15
12
  }, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}, {}>;
@@ -4,9 +4,7 @@ import { BusinessTaxiServiceMap } from "../business-components/BusinessTaxiServi
4
4
  import { useBusinessTaxiServiceMap } from "../hooks-business/useBusinessTaxiServiceMap.js";
5
5
  import { isCoordinatePoint } from "../utils/typeChecking.js";
6
6
  import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
7
- import { mockConfirmedPath, mockExternalRoute } from "./demo.data.mock.js";
8
7
  const allDriverStatus = ["dispatching", "book-dispatching", "dispatched", "driverStartRelayService", "driverStartService", "book-driverStartService", "book-dispatched", "driverArrived", "inService", "canceled", "endService", "completed", "canceling", "banlanceRefund", "waitBanlanceRefund", "rechargePayed", "waitRechargePay", "payed", "waitpay", "refund", "confirmed", "assign"];
9
- const mockDriverRoute = mockExternalRoute;
10
8
  const mockDriverTrackPoints = [{
11
9
  lng: 121.4036983,
12
10
  lat: 31.216324,
@@ -42,9 +40,7 @@ const DemoBusinessTaxiService = /* @__PURE__ */ defineComponent({
42
40
  to: {},
43
41
  relayTo: {},
44
42
  status: "driverStartRelayService",
45
- contentHeight: 200,
46
- confirmedPath: [],
47
- endServicePath: []
43
+ contentHeight: 200
48
44
  };
49
45
  },
50
46
  created() {
@@ -89,24 +85,10 @@ const DemoBusinessTaxiService = /* @__PURE__ */ defineComponent({
89
85
  type
90
86
  });
91
87
  };
92
- window.updateDriverRoute = () => {
93
- mockDriverRoute.path = mockDriverRoute.path.slice(5);
94
- };
95
- window.updateConfirmedPath = () => {
96
- this.confirmedPath = [...mockConfirmedPath];
97
- };
98
- window.updateEndServicePath = () => {
99
- this.endServicePath = [...mockConfirmedPath];
100
- };
101
88
  },
102
89
  methods: {
103
90
  getDriverPositionTrack() {
104
91
  return Promise.resolve(mockDriverTrackPoints);
105
- },
106
- getDriverRouteOrTrack() {
107
- return Promise.resolve({
108
- routes: mockDriverRoute
109
- });
110
92
  }
111
93
  },
112
94
  render() {
@@ -5,7 +5,7 @@ import { type UseMapDragProps } from "../../hooks/useMapDrag";
5
5
  import type { UseMapPlaceProps } from "../../hooks/useMapPlace";
6
6
  import { type UseMapRecomendPlaceProps } from "../../hooks/useMapRecomendPlace";
7
7
  import type { Coordinatify, CoordinatifyProps } from "../../types/coordinatify";
8
- import { type BusinessGeolocationPositionError, type CoordinatePlace } from "../../types/interface";
8
+ import { type BusinessGeolocationPositionError, type CoordinatePlace, type CoordinatePoint } from "../../types/interface";
9
9
  import { type AbsoluteAddressBoxProps } from "../AbsoluteAddressBox";
10
10
  import { type PickupPointsProps } from "../PickupPoints";
11
11
  export declare const RECOMMEND_PLACE_DRAG_LIMIT = 10;
@@ -28,12 +28,12 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
28
28
  emptyTitle: string;
29
29
  queryingTitle: string;
30
30
  recomendDescription: string;
31
- enableNearbyCars?: boolean;
32
31
  disableLocator?: boolean;
33
32
  disableLocatorPhoto?: boolean;
34
33
  geoErrorOnceNotificationKey?: string;
35
34
  mapContext: CoordinatifyProps<BusinessRecomendPlaceContext>;
36
35
  defaultCenterPlace?: CoordinatePlace | ((place?: CoordinatePlace) => CoordinatePlace | undefined);
36
+ skipWaitGeo?: boolean | CoordinatePlace | CoordinatePoint;
37
37
  renderPlacePhoto?: (place: CoordinatePlace) => undefined | {
38
38
  src: string;
39
39
  title?: string;
@@ -2,6 +2,7 @@ import "vue";
2
2
  import "vue-demi";
3
3
  import "../../api/browser.js";
4
4
  import "../../api/memory.js";
5
+ import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.4ec9353a.js";
5
6
  import "../../components/MapProvider/MapProvider.js";
6
7
  import "../../demi-polyfill/demi-polyfill.js";
7
8
  import "../../hooks/useGeoLocation.js";
@@ -26,12 +27,10 @@ import "../DeviceOrientation/DeviceOrientation.js";
26
27
  import "../GreenZone/GreenZone.js";
27
28
  import "../PassengerCircle/PassengerCircle.js";
28
29
  import "../PickupPoints/PickupPoints.js";
29
- import "../TaxiCar/RandomCars.js";
30
30
  import "./useCacheCenterPlace.js";
31
- import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.71c439c6.js";
32
31
  export {
33
32
  B as BusinessRecomendPlaceMap,
34
- f as BusinessRecomendPlaceMapInner,
33
+ g as BusinessRecomendPlaceMapInner,
35
34
  D as DEFAULT_ZOOM,
36
35
  E as EMPTY_PLACE,
37
36
  R as RECOMMEND_PLACE_DRAG_LIMIT,
@@ -1,7 +1,7 @@
1
- import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.71c439c6.js";
1
+ import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.4ec9353a.js";
2
2
  export {
3
3
  B as BusinessRecomendPlaceMap,
4
- f as BusinessRecomendPlaceMapInner,
4
+ g as BusinessRecomendPlaceMapInner,
5
5
  D as DEFAULT_ZOOM,
6
6
  E as EMPTY_PLACE,
7
7
  R as RECOMMEND_PLACE_DRAG_LIMIT,
@@ -1,7 +1,8 @@
1
- import type { CoordinatePlace, Point } from "../../types/interface";
1
+ import type { CoordinatePlace, CoordinatePoint, Point } from "../../types/interface";
2
2
  interface UseDefaultCenterPlaceProps {
3
3
  emptyTitle: string;
4
4
  geoLoadingTitle: string;
5
+ skipWaitGeo?: boolean | CoordinatePlace | CoordinatePoint;
5
6
  defaultCenterPlace?: CoordinatePlace | ((place?: CoordinatePlace) => CoordinatePlace | undefined);
6
7
  }
7
8
  export declare const useCacheCenterPlace: (props: UseDefaultCenterPlaceProps) => {
@@ -3,13 +3,21 @@ import { apiGetCenterPlaceFromCache } from "../../api/browser.js";
3
3
  import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
4
4
  import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
5
5
  import { maybeFunctionToFunction, lnglat2point } from "../../utils/transform.js";
6
+ import { t as throttle } from "../../chunks/throttle.8bdd8d3b.js";
6
7
  const IS_FIRST_LOAD_KEY = "IS_FIRST_LOAD_KEY";
8
+ const THROTTLE_TIME = 3e3;
9
+ const throttledApiMemoryShouldSkipByKey = throttle(apiMemoryShouldSkipByKey, THROTTLE_TIME, {
10
+ trailing: false
11
+ });
7
12
  const useCacheCenterPlace = (props) => {
8
- const { geoLoadingTitle, emptyTitle } = props;
9
- const isFirstLoad = !apiMemoryShouldSkipByKey(IS_FIRST_LOAD_KEY);
13
+ var _a;
14
+ const { geoLoadingTitle, emptyTitle, skipWaitGeo } = props;
15
+ const isAppFirstLoad = !throttledApiMemoryShouldSkipByKey(IS_FIRST_LOAD_KEY);
16
+ const isFirstLoadWithGps = isAppFirstLoad && !skipWaitGeo;
10
17
  const getDefaultCenterPlace = maybeFunctionToFunction(props.defaultCenterPlace);
11
18
  const { unCoordinatifyPlace } = useMapCoordinatify();
12
- const inputDefaultCenterPlace = getDefaultCenterPlace == null ? void 0 : getDefaultCenterPlace(apiGetCenterPlaceFromCache());
19
+ const inputSkipGeoPlace = typeof skipWaitGeo === "object" ? skipWaitGeo : void 0;
20
+ const inputDefaultCenterPlace = (_a = isAppFirstLoad ? inputSkipGeoPlace : void 0) != null ? _a : getDefaultCenterPlace == null ? void 0 : getDefaultCenterPlace(apiGetCenterPlaceFromCache());
13
21
  const defaultCenterPlace = {
14
22
  lng: 0,
15
23
  lat: 0,
@@ -21,10 +29,10 @@ const useCacheCenterPlace = (props) => {
21
29
  const centerPlace = reactive({
22
30
  lng: defaultCenterPlace.lng,
23
31
  lat: defaultCenterPlace.lat,
24
- name: isFirstLoad ? geoLoadingTitle : defaultCenterPlace.name,
25
- displayName: isFirstLoad ? geoLoadingTitle : defaultCenterPlace.displayName
32
+ name: isFirstLoadWithGps ? geoLoadingTitle : defaultCenterPlace.name,
33
+ displayName: isFirstLoadWithGps ? geoLoadingTitle : defaultCenterPlace.displayName
26
34
  });
27
- return { isFirstLoad, centerPlace, geoDefaultPosition, defaultCenterPlace };
35
+ return { isFirstLoad: isFirstLoadWithGps, centerPlace, geoDefaultPosition, defaultCenterPlace };
28
36
  };
29
37
  export {
30
38
  useCacheCenterPlace
@@ -1,6 +1,7 @@
1
1
  import { createVNode } from "vue";
2
2
  import { reactive, watch, watchEffect, onUnmounted } from "vue-demi";
3
3
  import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
4
+ import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING, f as airportSgnBounds } from "../../chunks/BusinessRecomendPlaceMap.4ec9353a.js";
4
5
  import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
5
6
  import { createElement } from "../../demi-polyfill/demi-polyfill.js";
6
7
  import { useGeoLocation } from "../../hooks/useGeoLocation.js";
@@ -21,7 +22,6 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
21
22
  import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
22
23
  import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
23
24
  import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
24
- import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.71c439c6.js";
25
25
  import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
26
26
  import { GreenZone } from "../GreenZone/GreenZone.js";
27
27
  import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
@@ -74,7 +74,11 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
74
74
  setFitZoom
75
75
  } = useMapFitZoom({
76
76
  mapRef,
77
- padding: ZONE_FITVIEW_PANDING
77
+ padding: ZONE_FITVIEW_PANDING,
78
+ certainZoomAreas: [{
79
+ zoom: DEFAULT_ZOOM,
80
+ points: airportSgnBounds
81
+ }]
78
82
  });
79
83
  const {
80
84
  assertSupplier
@@ -1,8 +1,7 @@
1
- import type { CoordinatePlace, CoordinatePoint } from "../../types/interface";
1
+ import type { Place } from "../../types/interface";
2
2
  export interface BusinessTaxiEndMapProps {
3
- from: Partial<CoordinatePlace>;
4
- to: Partial<CoordinatePlace>;
5
- path?: CoordinatePoint[];
3
+ from: Partial<Place>;
4
+ to: Partial<Place>;
6
5
  }
7
6
  export declare const BusinessTaxiEndMapInner: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessTaxiEndMapProps>, 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<BusinessTaxiEndMapProps, Required<BusinessTaxiEndMapProps>>, never, import("@vue/runtime-core").PublicProps, BusinessTaxiEndMapProps, BusinessTaxiEndMapProps, import("@vue/runtime-core").SlotsType<{} & {
8
7
  default?: import("../../demi-polyfill").Slot | undefined;
@@ -8,7 +8,7 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
8
8
  import { useMapSupplier } from "../../hooks/useMapSupplier.js";
9
9
  import { defineSetup } from "../../types/helper.js";
10
10
  import { place2point, pipeDefer } from "../../utils/transform.js";
11
- import { isCoordinatePoint, toCoordinatePlaceType, toCoordinatePointType } from "../../utils/typeChecking.js";
11
+ import { isCoordinatePoint, toCoordinatePlaceType } from "../../utils/typeChecking.js";
12
12
  import { SectionEndService } from "../BusinessTaxiServiceMap/BusinessTaxiServiceSection.js";
13
13
  const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(props, {
14
14
  attrs
@@ -18,7 +18,6 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
18
18
  setMap
19
19
  } = useHeycarMap();
20
20
  const {
21
- unCoordinatifyPoint,
22
21
  unCoordinatifyPlace
23
22
  } = useMapCoordinatify();
24
23
  const {
@@ -32,13 +31,11 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
32
31
  return () => {
33
32
  const {
34
33
  from: inputFrom,
35
- to: inputTo,
36
- path: inputPath
34
+ to: inputTo
37
35
  } = props;
38
36
  const isReady = isCoordinatePoint(inputFrom) && isCoordinatePoint(inputTo);
39
37
  const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
40
38
  const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
41
- const path = inputPath == null ? void 0 : inputPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
42
39
  const center = isReady ? place2point(from) : [...BEIJIN_POINT];
43
40
  return createVNode(HeycarMap, {
44
41
  "class": attrs.class,
@@ -52,7 +49,6 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
52
49
  default: () => [isReady && createVNode(SectionEndService, {
53
50
  "from": from,
54
51
  "to": to,
55
- "routePath": path,
56
52
  "registerOverlay": registerFitVeiw
57
53
  }, null)]
58
54
  });
@@ -1,7 +1,7 @@
1
1
  import { type HeycarMapProps } from "../../components/MapProvider";
2
2
  import type { BusinessTaxiServiceContext } from "../../hooks-business/useBusinessTaxiServiceMap";
3
3
  import type { CoordinatifyProps } from "../../types/coordinatify";
4
- import type { CoordinatePlace, CoordinatePoint, CoordinateTrackPoint, DriverStatus, GetDriverRouteOrTrackOutput } from "../../types/interface";
4
+ import type { CoordinatePlace, CoordinateTrackPoint, DriverStatus } from "../../types/interface";
5
5
  export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps, "center" | "zoom" | "mapRef">> & {
6
6
  from: CoordinatePlace;
7
7
  to: CoordinatePlace;
@@ -15,8 +15,6 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
15
15
  driverStatus: DriverStatus;
16
16
  interval: number;
17
17
  disablePassenger?: boolean;
18
- confirmedPath?: CoordinatePoint[];
19
- endServicePath?: CoordinatePoint[];
20
18
  mapContext: CoordinatifyProps<BusinessTaxiServiceContext>;
21
19
  renderStartSerivceTitle: (titleProps: {
22
20
  distance: number;
@@ -27,7 +25,6 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
27
25
  duration: number;
28
26
  }) => string;
29
27
  getDriverPositionTrack?: () => Promise<CoordinateTrackPoint[]>;
30
- getDriverRouteOrTrack?: () => Promise<GetDriverRouteOrTrackOutput>;
31
28
  };
32
29
  export declare const BusinessTaxiServiceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessTaxiServiceMapProps>, 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<BusinessTaxiServiceMapProps, Required<BusinessTaxiServiceMapProps>>, "resize" | "dragEnd" | "zoomEnd", import("vue-demi").PublicProps, BusinessTaxiServiceMapProps, BusinessTaxiServiceMapProps, import("vue-demi").SlotsType<{
33
30
  fallback?: (() => import("vue-demi").VNodeChild) | undefined;