@heycar/heycars-map 2.0.0-switchMap1 → 2.0.0-switchMap3

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 (96) hide show
  1. package/README.md +43 -29
  2. package/dist/v2/App.js +5 -3
  3. package/dist/v2/Demo/DemoBusinessQuoting.js +3 -2
  4. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -1
  5. package/dist/v2/api/cdn.d.ts +1 -0
  6. package/dist/v2/api/cdn.js +2 -0
  7. package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +5 -2
  8. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  9. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  10. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  11. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
  12. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +18 -11
  13. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +12 -5
  14. package/dist/v2/chunks/{BusinessRecomendPlaceMap.5be4fdcf.js → BusinessRecomendPlaceMap.f589ebf7.js} +17 -10
  15. package/dist/v2/chunks/{Loading.fc6e75d0.js → Loading.da68a2a6.js} +31 -1
  16. package/dist/v2/chunks/throttle.8bdd8d3b.js +20 -0
  17. package/dist/v2/components/Loading/Loading.css.d.ts +5 -0
  18. package/dist/v2/components/Loading/Loading.d.ts +6 -0
  19. package/dist/v2/components/Loading/Loading.js +3 -1
  20. package/dist/v2/components/Loading/index.js +2 -1
  21. package/dist/v2/components/MapProvider/MapProvider.d.ts +2 -2
  22. package/dist/v2/components/MapProvider/MapProvider.js +16 -9
  23. package/dist/v2/css/Loading-0e058b68.css +51 -0
  24. package/dist/v2/hooks/useDeviceOrientation.js +1 -17
  25. package/dist/v2/hooks/useMapGCJ02.js +1 -3
  26. package/dist/v2/hooks/useMapGraspRoad.js +1 -2
  27. package/dist/v2/hooks/useMapInChina.d.ts +3 -15
  28. package/dist/v2/hooks/useMapInChina.js +11 -16
  29. package/dist/v2/hooks/useMapLoader.d.ts +10 -6
  30. package/dist/v2/hooks/useMapLoader.js +88 -59
  31. package/dist/v2/hooks/useMapPlace.d.ts +1 -0
  32. package/dist/v2/hooks/useMapPlace.js +10 -9
  33. package/dist/v2/hooks/useMapRecomendPlace.d.ts +1 -0
  34. package/dist/v2/hooks/useMapRecomendPlace.js +72 -64
  35. package/dist/v2/hooks/useMapSupplier.d.ts +6 -0
  36. package/dist/v2/hooks/useMapSupplier.js +17 -0
  37. package/dist/v2/hooks-business/useBusinessQuotingMap.d.ts +2 -0
  38. package/dist/v2/hooks-business/useBusinessQuotingMap.js +7 -2
  39. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  40. package/dist/v2/index.js +1 -1
  41. package/dist/v2/utils/ManualAbortError.d.ts +3 -0
  42. package/dist/v2/utils/ManualAbortError.js +14 -0
  43. package/dist/v2/utils/helper.d.ts +1 -0
  44. package/dist/v2/utils/helper.js +17 -0
  45. package/dist/v2/utils/log.js +1 -1
  46. package/dist/v2/utils/patchGoogleMapLoader.d.ts +2 -0
  47. package/dist/v2/utils/patchGoogleMapLoader.js +64 -0
  48. package/dist/v3/App.js +5 -3
  49. package/dist/v3/Demo/DemoBusinessQuoting.js +4 -3
  50. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -1
  51. package/dist/v3/api/cdn.d.ts +1 -0
  52. package/dist/v3/api/cdn.js +2 -0
  53. package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +5 -2
  54. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  55. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  56. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  57. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
  58. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +18 -11
  59. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +12 -5
  60. package/dist/v3/chunks/{BusinessRecomendPlaceMap.39888296.js → BusinessRecomendPlaceMap.86e9c287.js} +17 -10
  61. package/dist/v3/chunks/{Loading.a8e2f26a.js → Loading.98d687c0.js} +27 -1
  62. package/dist/v3/chunks/throttle.8bdd8d3b.js +20 -0
  63. package/dist/v3/components/Loading/Loading.css.d.ts +5 -0
  64. package/dist/v3/components/Loading/Loading.d.ts +8 -0
  65. package/dist/v3/components/Loading/Loading.js +3 -1
  66. package/dist/v3/components/Loading/index.js +2 -1
  67. package/dist/v3/components/MapProvider/MapProvider.d.ts +6 -3
  68. package/dist/v3/components/MapProvider/MapProvider.js +14 -9
  69. package/dist/v3/css/Loading-0e058b68.css +51 -0
  70. package/dist/v3/hooks/useDeviceOrientation.js +1 -17
  71. package/dist/v3/hooks/useMapGCJ02.js +1 -3
  72. package/dist/v3/hooks/useMapGraspRoad.js +1 -2
  73. package/dist/v3/hooks/useMapInChina.d.ts +3 -15
  74. package/dist/v3/hooks/useMapInChina.js +11 -16
  75. package/dist/v3/hooks/useMapLoader.d.ts +10 -6
  76. package/dist/v3/hooks/useMapLoader.js +88 -59
  77. package/dist/v3/hooks/useMapPlace.d.ts +1 -0
  78. package/dist/v3/hooks/useMapPlace.js +10 -9
  79. package/dist/v3/hooks/useMapRecomendPlace.d.ts +1 -0
  80. package/dist/v3/hooks/useMapRecomendPlace.js +72 -64
  81. package/dist/v3/hooks/useMapSupplier.d.ts +6 -0
  82. package/dist/v3/hooks/useMapSupplier.js +17 -0
  83. package/dist/v3/hooks-business/useBusinessQuotingMap.d.ts +2 -0
  84. package/dist/v3/hooks-business/useBusinessQuotingMap.js +7 -2
  85. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  86. package/dist/v3/index.js +1 -1
  87. package/dist/v3/utils/ManualAbortError.d.ts +3 -0
  88. package/dist/v3/utils/ManualAbortError.js +14 -0
  89. package/dist/v3/utils/helper.d.ts +1 -0
  90. package/dist/v3/utils/helper.js +17 -0
  91. package/dist/v3/utils/log.js +1 -1
  92. package/dist/v3/utils/patchGoogleMapLoader.d.ts +2 -0
  93. package/dist/v3/utils/patchGoogleMapLoader.js +64 -0
  94. package/package.json +2 -2
  95. package/dist/v2/css/Loading-523061b9.css +0 -9
  96. package/dist/v3/css/Loading-523061b9.css +0 -9
@@ -1,5 +1,5 @@
1
1
  import { createVNode } from "vue";
2
- import { reactive, watch, watchEffect } from "vue-demi";
2
+ import { reactive, watch, watchEffect, onUnmounted } from "vue-demi";
3
3
  import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
4
4
  import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
5
5
  import { createElement } from "../../demi-polyfill/demi-polyfill.js";
@@ -9,17 +9,18 @@ import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
9
9
  import { useMapDrag } from "../../hooks/useMapDrag.js";
10
10
  import { useMapGeometry } from "../../hooks/useMapGeometry.js";
11
11
  import { useMapRecomendPlace } from "../../hooks/useMapRecomendPlace.js";
12
- import { useMapSupplier } from "../../hooks/useMapSupplier.js";
12
+ import { useMapAssertSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
13
13
  import { useMapZoom } from "../../hooks/useMapZoom.js";
14
14
  import { defineSetup, defineLagecySetup } from "../../types/helper.js";
15
15
  import { CenterPlaceStatus } from "../../types/interface.js";
16
+ import { throwNoneManualAbortError, MANUAL_ABORT_MESSAGE } from "../../utils/ManualAbortError.js";
16
17
  import { watchPostEffectOnce, generateCreateElementV2PropsOn } from "../../utils/compare.js";
17
18
  import { equalAssign, isPlacesInclude } from "../../utils/helper.js";
18
19
  import { detectBrowserPlatform } from "../../utils/platform.js";
19
20
  import { place2point, isPlaceEqual, pipeOnlyLastEffect, isZoneEqual, geoPositionError2businessTimeout } from "../../utils/transform.js";
20
21
  import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
21
22
  import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
22
- import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_LARGE_LIMIT, a as RECOMMEND_PLACE_DRAG_LIMIT, Z as ZONE_ZOOM, 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 } from "../../chunks/BusinessRecomendPlaceMap.39888296.js";
23
+ import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_LARGE_LIMIT, a as RECOMMEND_PLACE_DRAG_LIMIT, Z as ZONE_ZOOM, 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 } from "../../chunks/BusinessRecomendPlaceMap.86e9c287.js";
23
24
  import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
24
25
  import { GreenZone } from "../GreenZone/GreenZone.js";
25
26
  import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
@@ -41,6 +42,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
41
42
  ...EMPTY_PLACE
42
43
  }
43
44
  } = props;
45
+ const abortController = new AbortController();
44
46
  const {
45
47
  coordinatifyPoint,
46
48
  unCoordinatifyPoint,
@@ -68,6 +70,9 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
68
70
  mapRef,
69
71
  defaultValue: DEFAULT_ZOOM
70
72
  });
73
+ const {
74
+ assertSupplier
75
+ } = useMapAssertSupplier();
71
76
  const defaultPlace = unCoordinatifyPlace(toCoordinatePlaceType(inputDefaultPlace));
72
77
  const centerPlace = reactive({
73
78
  lng: defaultPlace.lng,
@@ -148,19 +153,19 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
148
153
  emitGeoErrorOnce(error);
149
154
  }
150
155
  });
151
- mapContext.apiMapDistance = (from, to) => {
156
+ mapContext.apiMapDistance = assertSupplier((from, to) => {
152
157
  return apiMapDistance(unCoordinatifyPoint(toCoordinatePointType(from)), unCoordinatifyPoint(toCoordinatePointType(to)));
153
- };
154
- mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
155
- mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
156
- mapContext.panToGeoPositionByRecomend = () => {
158
+ });
159
+ mapContext.setCenterPlaceByUserSpecified = assertSupplier(setCenterPlaceByUserSpecified);
160
+ mapContext.setCenterPlaceByUserSpecifiedInZone = assertSupplier(setCenterPlaceByUserSpecifiedInZone);
161
+ mapContext.panToGeoPositionByRecomend = assertSupplier(() => {
157
162
  if (geoError.value)
158
163
  return false;
159
164
  updateCenterPlaceByPoint(geoPosition.value, {
160
165
  source: "geo"
161
166
  });
162
167
  return true;
163
- };
168
+ });
164
169
  const {
165
170
  isDragging
166
171
  } = useMapDrag({
@@ -183,6 +188,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
183
188
  emptyPlaceName: emptyTitle,
184
189
  queryingPlaceName: queryingTitle,
185
190
  context: centerSource,
191
+ signal: abortController.signal,
186
192
  getAvailable: pipedGetAvailable,
187
193
  getRecomendPlace: pipedGetRecomendPlace,
188
194
  getLimit: (context) => {
@@ -202,7 +208,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
202
208
  ...place
203
209
  }),
204
210
  onChangePlace: (place) => emit("changePlace", coordinatifyPlace(place)),
205
- onChange: async ({
211
+ onChange: ({
206
212
  place,
207
213
  inputPlace,
208
214
  isInZone,
@@ -224,7 +230,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
224
230
  }));
225
231
  }
226
232
  });
227
- watchPostEffectOnce(() => updateRecommendPlaceOnlyInZone(defaultPlace));
233
+ watchPostEffectOnce(() => updateRecommendPlaceOnlyInZone(defaultPlace).catch(throwNoneManualAbortError));
228
234
  watch(centerPlace, (place) => {
229
235
  equalAssign(mapContext.centerPlace, coordinatifyPlace({
230
236
  ...place
@@ -236,6 +242,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
236
242
  watchEffect(() => {
237
243
  mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
238
244
  });
245
+ onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
239
246
  return () => {
240
247
  var _a;
241
248
  const {
@@ -1,5 +1,5 @@
1
1
  import { createVNode } from "vue";
2
- import { ref, watch } from "vue-demi";
2
+ import { ref, watch, onUnmounted } from "vue-demi";
3
3
  import { apiGetAuxiliaryGrapStatus } from "../../api/browser.js";
4
4
  import { setGlobalGoogleSnapRoadProxyUrl } from "../../api/googleSnapRoad.js";
5
5
  import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
@@ -8,9 +8,10 @@ import { useGeoLocation } from "../../hooks/useGeoLocation.js";
8
8
  import { useHeycarMap } from "../../hooks/useHeycarMap.js";
9
9
  import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
10
10
  import { useMapFitView } from "../../hooks/useMapFitView.js";
11
- import { useMapSupplier } from "../../hooks/useMapSupplier.js";
11
+ import { useMapAssertSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
12
12
  import { defineSetup, defineLagecySetup } from "../../types/helper.js";
13
- import { assertNotEmptyArray } from "../../utils/helper.js";
13
+ import { MANUAL_ABORT_MESSAGE } from "../../utils/ManualAbortError.js";
14
+ import { createAbortable, assertNotEmptyArray } from "../../utils/helper.js";
14
15
  import { place2point, pipeDefer, lnglat2point } from "../../utils/transform.js";
15
16
  import { toCoordinatePlaceType, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
16
17
  import { AuxiliaryGraspRoad } from "../AuxiliaryGraspRoad/AuxiliaryGraspRoad.js";
@@ -26,7 +27,6 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
26
27
  interval,
27
28
  disablePassenger,
28
29
  mapContext,
29
- getDriverPositionTrack,
30
30
  renderStartSerivceTitle,
31
31
  renderInServiceTitle
32
32
  } = props;
@@ -36,6 +36,12 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
36
36
  setMap,
37
37
  mapElementRef
38
38
  } = useHeycarMap();
39
+ const {
40
+ assertSupplier
41
+ } = useMapAssertSupplier();
42
+ const abortController = new AbortController();
43
+ const abortable = createAbortable(abortController.signal);
44
+ const getDriverPositionTrack = abortable(props.getDriverPositionTrack);
39
45
  const {
40
46
  unCoordinatifyPlace,
41
47
  unCoordinatifyTrackPoint
@@ -47,7 +53,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
47
53
  mapRef,
48
54
  padding: BUSINESS_TAXI_SERVICE_FITVIEW_PANDING
49
55
  });
50
- mapContext.setFitView = () => setFitView(false);
56
+ mapContext.setFitView = assertSupplier(() => setFitView(false));
51
57
  const deferedSetFitView = pipeDefer(() => registerOverlay.setFitView(true));
52
58
  const {
53
59
  geoLoading,
@@ -79,6 +85,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
79
85
  }, {
80
86
  immediate: true
81
87
  });
88
+ onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
82
89
  return () => {
83
90
  const {
84
91
  driverStatus,
@@ -1,5 +1,5 @@
1
1
  import { createVNode } from "vue";
2
- import { computed, watch, watchEffect } from "vue-demi";
2
+ import { computed, watch, watchEffect, onUnmounted } from "vue-demi";
3
3
  import { apiSaveCenterPlaceToCache } from "../api/browser.js";
4
4
  import { apiMemoryShouldSkipByKey } from "../api/memory.js";
5
5
  import { HeycarMap } from "../components/MapProvider/MapProvider.js";
@@ -10,10 +10,11 @@ import { useMapCoordinatify } from "../hooks/useMapCoordinatify.js";
10
10
  import { useMapDrag } from "../hooks/useMapDrag.js";
11
11
  import { useMapGeometry } from "../hooks/useMapGeometry.js";
12
12
  import { useMapRecomendPlace } from "../hooks/useMapRecomendPlace.js";
13
- import { useMapSupplier } from "../hooks/useMapSupplier.js";
13
+ import { useMapSupplier, useMapAssertSupplier } from "../hooks/useMapSupplier.js";
14
14
  import { useMapZoom } from "../hooks/useMapZoom.js";
15
15
  import { defineSetup, defineLagecySetup } from "../types/helper.js";
16
16
  import { CenterPlaceStatus } from "../types/interface.js";
17
+ import { throwNoneManualAbortError, MANUAL_ABORT_MESSAGE } from "../utils/ManualAbortError.js";
17
18
  import { watchPostEffectOnce, generateCreateElementV2PropsOn } from "../utils/compare.js";
18
19
  import { equalAssign, isPlacesInclude } from "../utils/helper.js";
19
20
  import { detectBrowserPlatform } from "../utils/platform.js";
@@ -286,6 +287,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
286
287
  getRecomendPlace,
287
288
  mapContext
288
289
  } = props;
290
+ const abortController = new AbortController();
289
291
  const {
290
292
  coordinatifyPoint,
291
293
  unCoordinatifyPoint,
@@ -316,6 +318,9 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
316
318
  const {
317
319
  readyPromise
318
320
  } = useMapSupplier();
321
+ const {
322
+ assertSupplier
323
+ } = useMapAssertSupplier();
319
324
  const {
320
325
  centerPlace,
321
326
  isFirstLoad,
@@ -418,19 +423,19 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
418
423
  emitGeoErrorOnce(error);
419
424
  }
420
425
  });
421
- mapContext.apiMapDistance = (from, to) => {
426
+ mapContext.apiMapDistance = assertSupplier((from, to) => {
422
427
  return apiMapDistance(unCoordinatifyPoint(toCoordinatePointType(from)), unCoordinatifyPoint(toCoordinatePointType(to)));
423
- };
424
- mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
425
- mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
426
- mapContext.panToGeoPositionByRecomend = () => {
428
+ });
429
+ mapContext.setCenterPlaceByUserSpecified = assertSupplier(setCenterPlaceByUserSpecified);
430
+ mapContext.setCenterPlaceByUserSpecifiedInZone = assertSupplier(setCenterPlaceByUserSpecifiedInZone);
431
+ mapContext.panToGeoPositionByRecomend = assertSupplier(() => {
427
432
  if (geoError.value)
428
433
  return false;
429
434
  updateCenterPlaceByPoint(geoPosition.value, {
430
435
  source: "geo"
431
436
  });
432
437
  return true;
433
- };
438
+ });
434
439
  const {
435
440
  isDragging
436
441
  } = useMapDrag({
@@ -454,6 +459,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
454
459
  emptyPlaceName: emptyTitle,
455
460
  queryingPlaceName: queryingTitle,
456
461
  context: centerSource,
462
+ signal: abortController.signal,
457
463
  getAvailable: pipedGetAvailable,
458
464
  getRecomendPlace: pipedGetRecomendPlace,
459
465
  getLimit: (context) => {
@@ -473,7 +479,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
473
479
  ...place
474
480
  }),
475
481
  onChangePlace: (place) => emit("changePlace", coordinatifyPlace(place)),
476
- onChange: async ({
482
+ onChange: ({
477
483
  place,
478
484
  inputPlace,
479
485
  isInZone,
@@ -498,7 +504,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
498
504
  const centerPlaceStatusRef = computed(() => isFirstLoad && geoLoading.value ? CenterPlaceStatus.GEO_LOADING : isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK);
499
505
  watchPostEffectOnce(() => {
500
506
  if (!isFirstLoad)
501
- updateRecommendPlaceOnlyInZone(defaultCenterPlace);
507
+ updateRecommendPlaceOnlyInZone(defaultCenterPlace).catch(throwNoneManualAbortError);
502
508
  });
503
509
  watch(centerPlace, (place) => {
504
510
  if (centerPlaceStatusRef.value === CenterPlaceStatus.OK) {
@@ -516,6 +522,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
516
522
  watchEffect(() => {
517
523
  mapContext.centerPlaceStatusRef.value = centerPlaceStatusRef.value;
518
524
  });
525
+ onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
519
526
  return () => {
520
527
  var _a;
521
528
  const {
@@ -1,11 +1,17 @@
1
- import "../css/Loading-523061b9.css";
1
+ import "../css/Loading-0e058b68.css";
2
2
  import { createVNode } from "vue";
3
+ import { ICON_LOAD_FAILED_URL } from "../api/cdn.js";
3
4
  import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
4
5
  import { defineSetup } from "../types/helper.js";
5
6
  const imgGrid = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzg1IiBoZWlnaHQ9IjgxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2U9IiNEOERCRTIiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWRhc2hhcnJheT0iMSI+PHBhdGggZD0iTS41IDgxN1YwTTI0LjUgODE3VjBNNDguNSA4MTdWME03Mi41IDgxN1YwTTk2LjUgODE3VjBNMTIwLjUgODE3VjBNMTQ0LjUgODE3VjBNMTY4LjUgODE3VjBNMTkyLjUgODE3VjBNMjE2LjUgODE3VjBNMjQwLjUgODE3VjBNMjY0LjUgODE3VjBNMjg4LjUgODE3VjBNMzEyLjUgODE3VjBNMzM2LjUgODE3VjBNMzYwLjUgODE3VjBNMzg0LjUgODE3VjBNMCAuNWgzODVNMCAyNC41aDM4NU0wIDQ4LjVoMzg1TTAgNzIuNWgzODVNMCA5Ni41aDM4NU0wIDEyMC41aDM4NU0wIDE0NC41aDM4NU0wIDE2OC41aDM4NU0wIDE5Mi41aDM4NU0wIDIxNi41aDM4NU0wIDI0MC41aDM4NU0wIDI2NC41aDM4NU0wIDI4OC41aDM4NU0wIDMxMi41aDM4NU0wIDMzNi41aDM4NU0wIDM2MC41aDM4NU0wIDM4NC41aDM4NU0wIDQwOC41aDM4NU0wIDQzMi41aDM4NU0wIDQ1Ni41aDM4NU0wIDQ4MC41aDM4NU0wIDUwNC41aDM4NU0wIDUyOC41aDM4NU0wIDU1Mi41aDM4NU0wIDU3Ni41aDM4NU0wIDYwMC41aDM4NU0wIDYyNC41aDM4NU0wIDY0OC41aDM4NU0wIDY3Mi41aDM4NU0wIDY5Ni41aDM4NU0wIDcyMC41aDM4NU0wIDc0NC41aDM4NU0wIDc2OC41aDM4NU0wIDc5Mi41aDM4NU0wIDgxNi41aDM4NSIvPjwvZz48L3N2Zz4=";
6
7
  const Loading_css_ts_vanilla = "";
8
+ var description = "_17ify496";
9
+ var iconLayout = "_17ify492";
10
+ var iconLoadFailed = "_17ify493";
7
11
  var loadingBg = "_17ify491";
8
12
  var loadingLayout = "_17ify490";
13
+ var textLayout = "_17ify494";
14
+ var title = "_17ify495";
9
15
  const Loading = defineSetup("Loading", function() {
10
16
  return () => createVNode("div", {
11
17
  "class": loadingLayout
@@ -17,7 +23,27 @@ const Loading = defineSetup("Loading", function() {
17
23
  "title": ""
18
24
  }, null)]);
19
25
  });
26
+ const LoadFailed = defineSetup("LoadFailed", function(props) {
27
+ return () => createVNode("div", {
28
+ "class": loadingLayout
29
+ }, [createVNode("img", {
30
+ "class": loadingBg,
31
+ "src": imgGrid
32
+ }, null), createVNode("div", {
33
+ "class": iconLayout
34
+ }, [createVNode("img", {
35
+ "class": iconLoadFailed,
36
+ "src": ICON_LOAD_FAILED_URL
37
+ }, null), createVNode("div", {
38
+ "class": textLayout
39
+ }, [createVNode("span", {
40
+ "class": title
41
+ }, [props.title]), createVNode("span", {
42
+ "class": description
43
+ }, [props.description])])])]);
44
+ });
20
45
  export {
21
46
  Loading as L,
47
+ LoadFailed as a,
22
48
  imgGrid as i
23
49
  };
@@ -0,0 +1,20 @@
1
+ import { i as isObject, d as debounce } from "./debounce.5afe7867.js";
2
+ var FUNC_ERROR_TEXT = "Expected a function";
3
+ function throttle(func, wait, options) {
4
+ var leading = true, trailing = true;
5
+ if (typeof func != "function") {
6
+ throw new TypeError(FUNC_ERROR_TEXT);
7
+ }
8
+ if (isObject(options)) {
9
+ leading = "leading" in options ? !!options.leading : leading;
10
+ trailing = "trailing" in options ? !!options.trailing : trailing;
11
+ }
12
+ return debounce(func, wait, {
13
+ "leading": leading,
14
+ "maxWait": wait,
15
+ "trailing": trailing
16
+ });
17
+ }
18
+ export {
19
+ throttle as t
20
+ };
@@ -1,2 +1,7 @@
1
1
  export declare const loadingLayout: string;
2
2
  export declare const loadingBg: string;
3
+ export declare const iconLayout: string;
4
+ export declare const iconLoadFailed: string;
5
+ export declare const textLayout: string;
6
+ export declare const title: string;
7
+ export declare const description: string;
@@ -1,3 +1,11 @@
1
1
  export declare const Loading: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<unknown>, 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<unknown, Required<unknown>>, never, import("vue").PublicProps, unknown, unknown, import("vue").SlotsType<{} & {
2
2
  default?: import("../../demi-polyfill").Slot | undefined;
3
3
  }>>;
4
+ interface LoadFailedProps {
5
+ title?: string;
6
+ description?: string;
7
+ }
8
+ export declare const LoadFailed: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<LoadFailedProps>, 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<LoadFailedProps, Required<LoadFailedProps>>, never, import("vue").PublicProps, LoadFailedProps, LoadFailedProps, import("vue").SlotsType<{} & {
9
+ default?: import("../../demi-polyfill").Slot | undefined;
10
+ }>>;
11
+ export {};
@@ -1,7 +1,9 @@
1
1
  import "vue";
2
- import { L } from "../../chunks/Loading.a8e2f26a.js";
2
+ import "../../api/cdn.js";
3
+ import { a, L } from "../../chunks/Loading.98d687c0.js";
3
4
  import "../../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
4
5
  import "../../types/helper.js";
5
6
  export {
7
+ a as LoadFailed,
6
8
  L as Loading
7
9
  };
@@ -1,4 +1,5 @@
1
- import { L } from "../../chunks/Loading.a8e2f26a.js";
1
+ import { a, L } from "../../chunks/Loading.98d687c0.js";
2
2
  export {
3
+ a as LoadFailed,
3
4
  L as Loading
4
5
  };
@@ -1,12 +1,15 @@
1
1
  /// <reference types="google.maps" />
2
2
  import type { VueNode } from "../../demi-polyfill";
3
3
  import type { SetMap } from "../../hooks/useHeycarMap";
4
- import { type GmapLoaderProps, type UseMapLoaderProps } from "../../hooks/useMapLoader";
4
+ import { Status, type GmapLoaderProps, type UseMapLoaderProps } from "../../hooks/useMapLoader";
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">;
9
- export declare const MapProvider: import("vue").DefineComponent<import("vue").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>>, "change", import("vue").PublicProps, MapProviderProps, MapProviderProps, import("vue").SlotsType<{} & {
8
+ export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
9
+ export declare const MapProvider: import("vue").DefineComponent<import("vue").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", import("vue").PublicProps, MapProviderProps, MapProviderProps, import("vue").SlotsType<{
10
+ renderLoadFailedTitle?: ((status: Status) => string | undefined) | undefined;
11
+ renderLoadFailedDescription?: ((status: Status) => string | undefined) | undefined;
12
+ } & {
10
13
  default?: import("../../demi-polyfill").Slot | undefined;
11
14
  }>>;
12
15
  export interface HeycarMapProps extends Pick<GmapLoaderProps, "fallback" | "loading">, Pick<AmapProps, "center" | "zoom"> {
@@ -1,6 +1,6 @@
1
1
  import "../../css/MapProvider-156bfd53.css";
2
2
  import { createVNode, isVNode } from "vue";
3
- import { L as Loading, i as imgGrid } from "../../chunks/Loading.a8e2f26a.js";
3
+ import { L as Loading, a as LoadFailed, i as imgGrid } from "../../chunks/Loading.98d687c0.js";
4
4
  import { useMapLoader, Status } from "../../hooks/useMapLoader.js";
5
5
  import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
6
6
  import { defineLagecySetup } from "../../types/helper.js";
@@ -39,7 +39,7 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
39
39
  var _a;
40
40
  return createVNode("div", null, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
41
41
  };
42
- }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language"]);
42
+ }).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
43
43
  const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
44
44
  slots,
45
45
  emit,
@@ -67,7 +67,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
67
67
  const handleResize = () => emit("resize");
68
68
  loadTraditionalChineseConvertOnce(payload.language === "zh-TW");
69
69
  return () => {
70
- var _a, _b, _c, _d, _e, _f;
70
+ var _a, _b, _c, _d, _e, _f, _g, _h;
71
71
  const {
72
72
  supplier,
73
73
  gmapId,
@@ -86,12 +86,17 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
86
86
  const node = (_a = slots.loading) == null ? void 0 : _a.call(slots);
87
87
  return node ? createVNode("div", null, [node]) : createVNode(Loading, null, null);
88
88
  }
89
- if (status === Status.FAILURE) {
89
+ if (status === Status.FAILURE || status === Status.TIMEOUT) {
90
90
  const node = (_b = slots.fallback) == null ? void 0 : _b.call(slots);
91
- return node ? createVNode("div", null, [node]) : createVNode(Loading, null, null);
91
+ const title = (_c = payload.renderLoadFailedTitle) == null ? void 0 : _c.call(payload, status);
92
+ const description = (_d = payload.renderLoadFailedDescription) == null ? void 0 : _d.call(payload, status);
93
+ return node ? createVNode("div", null, [node]) : createVNode(LoadFailed, {
94
+ "title": title,
95
+ "description": description
96
+ }, null);
92
97
  }
93
- const children = (_c = slots.default) == null ? void 0 : _c.call(slots);
94
- const outArea = (_d = slots.outerArea) == null ? void 0 : _d.call(slots);
98
+ const children = (_e = slots.default) == null ? void 0 : _e.call(slots);
99
+ const outArea = (_f = slots.outerArea) == null ? void 0 : _f.call(slots);
95
100
  const mapId = patchGmapIdForAlipayCompatible({
96
101
  gmapId,
97
102
  gmapRasterId,
@@ -101,7 +106,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
101
106
  switch (supplier) {
102
107
  case "gmap":
103
108
  return createVNode("div", {
104
- "class": `${heycarMap} ${(_e = attrs.class) != null ? _e : ""}`,
109
+ "class": `${heycarMap} ${(_g = attrs.class) != null ? _g : ""}`,
105
110
  "lang": language,
106
111
  "style": attrs.style
107
112
  }, [createVNode(Gmap, {
@@ -126,7 +131,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
126
131
  }, null), outArea]);
127
132
  default:
128
133
  return createVNode("div", {
129
- "class": `${heycarMap} ${(_f = attrs.class) != null ? _f : ""}`,
134
+ "class": `${heycarMap} ${(_h = attrs.class) != null ? _h : ""}`,
130
135
  "lang": language,
131
136
  "style": attrs.style
132
137
  }, [createVNode(Amap, {
@@ -0,0 +1,51 @@
1
+ ._17ify490 {
2
+ position: relative;
3
+ background-color: #EDF1F5;
4
+ }
5
+ ._17ify491 {
6
+ width: 100%;
7
+ height: 100%;
8
+ object-fit: cover;
9
+ }
10
+ ._17ify492 {
11
+ position: absolute;
12
+ margin: auto;
13
+ top: 0;
14
+ left: 0;
15
+ right: 0;
16
+ bottom: 0;
17
+ width: fit-content;
18
+ height: fit-content;
19
+ }
20
+ ._17ify493 {
21
+ width: 40.8vw;
22
+ height: 24.53vw;
23
+ }
24
+ ._17ify494 {
25
+ position: absolute;
26
+ top: 100%;
27
+ display: flex;
28
+ flex-direction: column;
29
+ align-items: center;
30
+ width: max-content;
31
+ left: 50%;
32
+ transform: translate(-50%, 0);
33
+ }
34
+ ._17ify495 {
35
+ margin-top: 1.6vw;
36
+ font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
37
+ font-weight: 500;
38
+ font-size: 4vw;
39
+ color: #1E1E1E;
40
+ line-height: 6.4vw;
41
+ }
42
+ ._17ify496 {
43
+ margin-top: 1.6vw;
44
+ font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
45
+ font-weight: 400;
46
+ font-size: 3.73vw;
47
+ color: #999BA1;
48
+ line-height: 6.4vw;
49
+ white-space: pre-line;
50
+ text-align: center;
51
+ }
@@ -1,23 +1,7 @@
1
1
  import { reactive, watch } from "vue-demi";
2
2
  import { MINI_PROGRAM_WEB_VIEW_CLOSE_EVENT } from "../utils/patchMiniprogram.js";
3
3
  import { OS_PLATFORM, detectOSPlatform } from "../utils/platform.js";
4
- import { i as isObject, d as debounce } from "../chunks/debounce.5afe7867.js";
5
- var FUNC_ERROR_TEXT = "Expected a function";
6
- function throttle(func, wait, options) {
7
- var leading = true, trailing = true;
8
- if (typeof func != "function") {
9
- throw new TypeError(FUNC_ERROR_TEXT);
10
- }
11
- if (isObject(options)) {
12
- leading = "leading" in options ? !!options.leading : leading;
13
- trailing = "trailing" in options ? !!options.trailing : trailing;
14
- }
15
- return debounce(func, wait, {
16
- "leading": leading,
17
- "maxWait": wait,
18
- "trailing": trailing
19
- });
20
- }
4
+ import { t as throttle } from "../chunks/throttle.8bdd8d3b.js";
21
5
  const DEVICE_ORIENTATION_INTERVAL = 200;
22
6
  const CSS_DEVICE_ORIENTATION_VAR_PREFIX = "--CSS_DEVICE_ORIENTATION_VAR_ROTATION_DEGREE_";
23
7
  const useDeviceOrientation = (props) => {
@@ -1,6 +1,6 @@
1
1
  import { AMAP_TO_GCJ02_TIMEOUT } from "../api/contants.js";
2
2
  import { lnglat2point } from "../utils/transform.js";
3
- import { useMapInChina } from "./useMapInChina.js";
3
+ import { inChina, inHongkong, inMacau } from "./useMapInChina.js";
4
4
  import { useMapSupplier } from "./useMapSupplier.js";
5
5
  /**
6
6
  * @preserve
@@ -515,7 +515,6 @@ const exported = Object.assign(Object.assign({}, CRSTypes), {
515
515
  });
516
516
  const useAmapGCJ02 = () => {
517
517
  const { readyPromise } = useMapSupplier();
518
- const { inChina } = useMapInChina();
519
518
  const toCoordinateType = (p) => {
520
519
  return inChina(p) ? "gcj02" : "wgs84";
521
520
  };
@@ -567,7 +566,6 @@ const useAmapGCJ02 = () => {
567
566
  };
568
567
  const useGmapGCJ02 = () => {
569
568
  const { readyPromise } = useMapSupplier();
570
- const { inChina, inHongkong, inMacau } = useMapInChina();
571
569
  const toCoordinateType = (p) => {
572
570
  return inChina(p) && !inHongkong(p) && !inMacau(p) ? "gcj02" : "wgs84";
573
571
  };
@@ -3,7 +3,7 @@ import { apiGoogleSnapRoad } from "../api/googleSnapRoad.js";
3
3
  import { watchEffectForDeepOption } from "../utils/compare.js";
4
4
  import { lnglat2point, trackPoints2amapGraspRoadPoints } from "../utils/transform.js";
5
5
  import { useMapAngle } from "./useMapAngle.js";
6
- import { useMapInChina } from "./useMapInChina.js";
6
+ import { inChina } from "./useMapInChina.js";
7
7
  import { useMapSupplier } from "./useMapSupplier.js";
8
8
  const GRASP_ROAD_INPUT_MIN_AMOUNT = 2;
9
9
  const GRASP_ROAD_INPUT_MAX_AMOUNT = 500;
@@ -12,7 +12,6 @@ const useAmapGraspRoad = (props) => {
12
12
  const pathRef = ref([]);
13
13
  const angleRef = ref(0);
14
14
  const { apiMapComputeHeading } = useMapAngle();
15
- const { inChina } = useMapInChina();
16
15
  const apiMapToGraspRoadPath = (tracks) => {
17
16
  return new Promise((resolve) => {
18
17
  var _a, _b, _c;
@@ -1,16 +1,4 @@
1
1
  import { type Point } from "../types/interface";
2
- export declare const useMapInChina: () => {
3
- inChina: (point: Point) => boolean;
4
- inHongkong: (point: Point) => boolean;
5
- inMacau: (point: Point) => boolean;
6
- };
7
- export declare const useAmapInChina: () => {
8
- inChina: (point: Point) => boolean;
9
- inHongkong: (point: Point) => boolean;
10
- inMacau: (point: Point) => boolean;
11
- };
12
- export declare const useGmapInChina: () => {
13
- inChina: (point: Point) => boolean;
14
- inHongkong: (point: Point) => boolean;
15
- inMacau: (point: Point) => boolean;
16
- };
2
+ export declare const inChina: (point: Point) => boolean;
3
+ export declare const inHongkong: (point: Point) => boolean;
4
+ export declare const inMacau: (point: Point) => boolean;
@@ -2593,22 +2593,17 @@ const macauBounds = [
2593
2593
  22.19885
2594
2594
  ]
2595
2595
  ];
2596
- const useMapInChina = () => {
2597
- const inChina = (point) => {
2598
- return pointInPolygon(point, chinaBounds) >= 0;
2599
- };
2600
- const inHongkong = (point) => {
2601
- return pointInPolygon(point, hongkongBounds) >= 0;
2602
- };
2603
- const inMacau = (point) => {
2604
- return pointInPolygon(point, macauBounds) >= 0;
2605
- };
2606
- return { inChina, inHongkong, inMacau };
2596
+ const inChina = (point) => {
2597
+ return pointInPolygon(point, chinaBounds) >= 0;
2598
+ };
2599
+ const inHongkong = (point) => {
2600
+ return pointInPolygon(point, hongkongBounds) >= 0;
2601
+ };
2602
+ const inMacau = (point) => {
2603
+ return pointInPolygon(point, macauBounds) >= 0;
2607
2604
  };
2608
- const useAmapInChina = useMapInChina;
2609
- const useGmapInChina = useMapInChina;
2610
2605
  export {
2611
- useAmapInChina,
2612
- useGmapInChina,
2613
- useMapInChina
2606
+ inChina,
2607
+ inHongkong,
2608
+ inMacau
2614
2609
  };