@heycar/heycars-map 2.0.0-switchMap2 → 2.0.0-switchMap4

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 (67) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -1
  4. package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +5 -2
  5. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  6. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  7. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +18 -11
  8. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +12 -5
  9. package/dist/v2/chunks/{BusinessRecomendPlaceMap.5be4fdcf.js → BusinessRecomendPlaceMap.4b641c71.js} +23 -13
  10. package/dist/v2/chunks/{Loading.da68a2a6.js → Loading.f2515cd7.js} +8 -10
  11. package/dist/v2/components/Loading/Loading.css.d.ts +2 -2
  12. package/dist/v2/components/Loading/Loading.js +1 -1
  13. package/dist/v2/components/Loading/index.js +1 -1
  14. package/dist/v2/components/MapProvider/MapProvider.js +1 -1
  15. package/dist/{v3/css/Loading-0e058b68.css → v2/css/Loading-49e58ced.css} +6 -11
  16. package/dist/v2/hooks/useMapGCJ02.js +0 -3
  17. package/dist/v2/hooks/useMapGeometry.d.ts +1 -3
  18. package/dist/v2/hooks/useMapGeometry.js +4 -4
  19. package/dist/v2/hooks/useMapLoader.js +3 -0
  20. package/dist/v2/hooks/useMapPlace.d.ts +1 -0
  21. package/dist/v2/hooks/useMapPlace.js +51 -42
  22. package/dist/v2/hooks/useMapRecomendPlace.d.ts +1 -0
  23. package/dist/v2/hooks/useMapRecomendPlace.js +75 -67
  24. package/dist/v2/hooks/useMapSupplier.d.ts +4 -0
  25. package/dist/v2/hooks/useMapSupplier.js +17 -0
  26. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  27. package/dist/v2/index.js +1 -1
  28. package/dist/v2/utils/ManualAbortError.d.ts +3 -0
  29. package/dist/v2/utils/ManualAbortError.js +14 -0
  30. package/dist/v2/utils/helper.d.ts +1 -0
  31. package/dist/v2/utils/helper.js +17 -0
  32. package/dist/v2/utils/log.js +1 -1
  33. package/dist/v2/utils/patchGoogleMapLoader.d.ts +2 -0
  34. package/dist/v2/utils/patchGoogleMapLoader.js +64 -0
  35. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -1
  36. package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +5 -2
  37. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  38. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  39. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +18 -11
  40. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +12 -5
  41. package/dist/v3/chunks/{BusinessRecomendPlaceMap.39888296.js → BusinessRecomendPlaceMap.4befb6c7.js} +23 -13
  42. package/dist/v3/chunks/{Loading.98d687c0.js → Loading.32ae3c98.js} +8 -10
  43. package/dist/v3/components/Loading/Loading.css.d.ts +2 -2
  44. package/dist/v3/components/Loading/Loading.js +1 -1
  45. package/dist/v3/components/Loading/index.js +1 -1
  46. package/dist/v3/components/MapProvider/MapProvider.js +1 -1
  47. package/dist/{v2/css/Loading-0e058b68.css → v3/css/Loading-49e58ced.css} +6 -11
  48. package/dist/v3/hooks/useMapGCJ02.js +0 -3
  49. package/dist/v3/hooks/useMapGeometry.d.ts +1 -3
  50. package/dist/v3/hooks/useMapGeometry.js +4 -4
  51. package/dist/v3/hooks/useMapLoader.js +3 -0
  52. package/dist/v3/hooks/useMapPlace.d.ts +1 -0
  53. package/dist/v3/hooks/useMapPlace.js +51 -42
  54. package/dist/v3/hooks/useMapRecomendPlace.d.ts +1 -0
  55. package/dist/v3/hooks/useMapRecomendPlace.js +75 -67
  56. package/dist/v3/hooks/useMapSupplier.d.ts +4 -0
  57. package/dist/v3/hooks/useMapSupplier.js +17 -0
  58. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  59. package/dist/v3/index.js +1 -1
  60. package/dist/v3/utils/ManualAbortError.d.ts +3 -0
  61. package/dist/v3/utils/ManualAbortError.js +14 -0
  62. package/dist/v3/utils/helper.d.ts +1 -0
  63. package/dist/v3/utils/helper.js +17 -0
  64. package/dist/v3/utils/log.js +1 -1
  65. package/dist/v3/utils/patchGoogleMapLoader.d.ts +2 -0
  66. package/dist/v3/utils/patchGoogleMapLoader.js +64 -0
  67. package/package.json +2 -2
@@ -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.4befb6c7.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,
@@ -314,8 +316,12 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
314
316
  defaultValue: DEFAULT_ZOOM
315
317
  });
316
318
  const {
317
- readyPromise
319
+ readyPromise,
320
+ supplier
318
321
  } = useMapSupplier();
322
+ const {
323
+ assertSupplier
324
+ } = useMapAssertSupplier();
319
325
  const {
320
326
  centerPlace,
321
327
  isFirstLoad,
@@ -395,7 +401,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
395
401
  if (!isFirstLoad)
396
402
  return;
397
403
  const [lng, lat] = value.position;
398
- await readyPromise;
404
+ if (supplier === "amap")
405
+ await readyPromise;
399
406
  centerSource.source = "geo";
400
407
  centerPlace.lng = lng;
401
408
  centerPlace.lat = lat;
@@ -405,7 +412,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
405
412
  emit("loadDefaultGeoLocation", coordinatifyGeoPosition(value));
406
413
  if (!isFirstLoad)
407
414
  return;
408
- await readyPromise;
415
+ if (supplier === "amap")
416
+ await readyPromise;
409
417
  centerSource.source = "geo";
410
418
  updatePlace(value.position);
411
419
  },
@@ -418,19 +426,19 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
418
426
  emitGeoErrorOnce(error);
419
427
  }
420
428
  });
421
- mapContext.apiMapDistance = (from, to) => {
429
+ mapContext.apiMapDistance = assertSupplier((from, to) => {
422
430
  return apiMapDistance(unCoordinatifyPoint(toCoordinatePointType(from)), unCoordinatifyPoint(toCoordinatePointType(to)));
423
- };
424
- mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
425
- mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
426
- mapContext.panToGeoPositionByRecomend = () => {
431
+ });
432
+ mapContext.setCenterPlaceByUserSpecified = assertSupplier(setCenterPlaceByUserSpecified);
433
+ mapContext.setCenterPlaceByUserSpecifiedInZone = assertSupplier(setCenterPlaceByUserSpecifiedInZone);
434
+ mapContext.panToGeoPositionByRecomend = assertSupplier(() => {
427
435
  if (geoError.value)
428
436
  return false;
429
437
  updateCenterPlaceByPoint(geoPosition.value, {
430
438
  source: "geo"
431
439
  });
432
440
  return true;
433
- };
441
+ });
434
442
  const {
435
443
  isDragging
436
444
  } = useMapDrag({
@@ -454,6 +462,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
454
462
  emptyPlaceName: emptyTitle,
455
463
  queryingPlaceName: queryingTitle,
456
464
  context: centerSource,
465
+ signal: abortController.signal,
457
466
  getAvailable: pipedGetAvailable,
458
467
  getRecomendPlace: pipedGetRecomendPlace,
459
468
  getLimit: (context) => {
@@ -473,7 +482,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
473
482
  ...place
474
483
  }),
475
484
  onChangePlace: (place) => emit("changePlace", coordinatifyPlace(place)),
476
- onChange: async ({
485
+ onChange: ({
477
486
  place,
478
487
  inputPlace,
479
488
  isInZone,
@@ -498,7 +507,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
498
507
  const centerPlaceStatusRef = computed(() => isFirstLoad && geoLoading.value ? CenterPlaceStatus.GEO_LOADING : isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK);
499
508
  watchPostEffectOnce(() => {
500
509
  if (!isFirstLoad)
501
- updateRecommendPlaceOnlyInZone(defaultCenterPlace);
510
+ updateRecommendPlaceOnlyInZone(defaultCenterPlace).catch(throwNoneManualAbortError);
502
511
  });
503
512
  watch(centerPlace, (place) => {
504
513
  if (centerPlaceStatusRef.value === CenterPlaceStatus.OK) {
@@ -516,6 +525,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
516
525
  watchEffect(() => {
517
526
  mapContext.centerPlaceStatusRef.value = centerPlaceStatusRef.value;
518
527
  });
528
+ onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
519
529
  return () => {
520
530
  var _a;
521
531
  const {
@@ -1,17 +1,17 @@
1
- import "../css/Loading-0e058b68.css";
1
+ import "../css/Loading-49e58ced.css";
2
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 { defineSetup } from "../types/helper.js";
6
6
  const imgGrid = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzg1IiBoZWlnaHQ9IjgxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2U9IiNEOERCRTIiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWRhc2hhcnJheT0iMSI+PHBhdGggZD0iTS41IDgxN1YwTTI0LjUgODE3VjBNNDguNSA4MTdWME03Mi41IDgxN1YwTTk2LjUgODE3VjBNMTIwLjUgODE3VjBNMTQ0LjUgODE3VjBNMTY4LjUgODE3VjBNMTkyLjUgODE3VjBNMjE2LjUgODE3VjBNMjQwLjUgODE3VjBNMjY0LjUgODE3VjBNMjg4LjUgODE3VjBNMzEyLjUgODE3VjBNMzM2LjUgODE3VjBNMzYwLjUgODE3VjBNMzg0LjUgODE3VjBNMCAuNWgzODVNMCAyNC41aDM4NU0wIDQ4LjVoMzg1TTAgNzIuNWgzODVNMCA5Ni41aDM4NU0wIDEyMC41aDM4NU0wIDE0NC41aDM4NU0wIDE2OC41aDM4NU0wIDE5Mi41aDM4NU0wIDIxNi41aDM4NU0wIDI0MC41aDM4NU0wIDI2NC41aDM4NU0wIDI4OC41aDM4NU0wIDMxMi41aDM4NU0wIDMzNi41aDM4NU0wIDM2MC41aDM4NU0wIDM4NC41aDM4NU0wIDQwOC41aDM4NU0wIDQzMi41aDM4NU0wIDQ1Ni41aDM4NU0wIDQ4MC41aDM4NU0wIDUwNC41aDM4NU0wIDUyOC41aDM4NU0wIDU1Mi41aDM4NU0wIDU3Ni41aDM4NU0wIDYwMC41aDM4NU0wIDYyNC41aDM4NU0wIDY0OC41aDM4NU0wIDY3Mi41aDM4NU0wIDY5Ni41aDM4NU0wIDcyMC41aDM4NU0wIDc0NC41aDM4NU0wIDc2OC41aDM4NU0wIDc5Mi41aDM4NU0wIDgxNi41aDM4NSIvPjwvZz48L3N2Zz4=";
7
7
  const Loading_css_ts_vanilla = "";
8
+ var contentLayout = "_17ify492";
8
9
  var description = "_17ify496";
9
- var iconLayout = "_17ify492";
10
10
  var iconLoadFailed = "_17ify493";
11
11
  var loadingBg = "_17ify491";
12
12
  var loadingLayout = "_17ify490";
13
- var textLayout = "_17ify494";
14
13
  var title = "_17ify495";
14
+ var verticalGap = "_17ify494";
15
15
  const Loading = defineSetup("Loading", function() {
16
16
  return () => createVNode("div", {
17
17
  "class": loadingLayout
@@ -30,17 +30,15 @@ const LoadFailed = defineSetup("LoadFailed", function(props) {
30
30
  "class": loadingBg,
31
31
  "src": imgGrid
32
32
  }, null), createVNode("div", {
33
- "class": iconLayout
33
+ "class": contentLayout
34
34
  }, [createVNode("img", {
35
35
  "class": iconLoadFailed,
36
36
  "src": ICON_LOAD_FAILED_URL
37
- }, null), createVNode("div", {
38
- "class": textLayout
39
- }, [createVNode("span", {
40
- "class": title
37
+ }, null), createVNode("span", {
38
+ "class": `${title} ${verticalGap}`
41
39
  }, [props.title]), createVNode("span", {
42
- "class": description
43
- }, [props.description])])])]);
40
+ "class": `${description} ${verticalGap}`
41
+ }, [props.description])])]);
44
42
  });
45
43
  export {
46
44
  Loading as L,
@@ -1,7 +1,7 @@
1
1
  export declare const loadingLayout: string;
2
2
  export declare const loadingBg: string;
3
- export declare const iconLayout: string;
3
+ export declare const contentLayout: string;
4
4
  export declare const iconLoadFailed: string;
5
- export declare const textLayout: string;
5
+ export declare const verticalGap: string;
6
6
  export declare const title: string;
7
7
  export declare const description: string;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
2
  import "../../api/cdn.js";
3
- import { a, L } from "../../chunks/Loading.98d687c0.js";
3
+ import { a, L } from "../../chunks/Loading.32ae3c98.js";
4
4
  import "../../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
5
5
  import "../../types/helper.js";
6
6
  export {
@@ -1,4 +1,4 @@
1
- import { a, L } from "../../chunks/Loading.98d687c0.js";
1
+ import { a, L } from "../../chunks/Loading.32ae3c98.js";
2
2
  export {
3
3
  a as LoadFailed,
4
4
  L as Loading
@@ -1,6 +1,6 @@
1
1
  import "../../css/MapProvider-156bfd53.css";
2
2
  import { createVNode, isVNode } from "vue";
3
- import { L as Loading, a as LoadFailed, i as imgGrid } from "../../chunks/Loading.98d687c0.js";
3
+ import { L as Loading, a as LoadFailed, i as imgGrid } from "../../chunks/Loading.32ae3c98.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";
@@ -3,6 +3,7 @@
3
3
  background-color: #EDF1F5;
4
4
  }
5
5
  ._17ify491 {
6
+ position: absolute;
6
7
  width: 100%;
7
8
  height: 100%;
8
9
  object-fit: cover;
@@ -10,29 +11,24 @@
10
11
  ._17ify492 {
11
12
  position: absolute;
12
13
  margin: auto;
13
- top: 0;
14
+ top: -5vh;
14
15
  left: 0;
15
16
  right: 0;
16
17
  bottom: 0;
17
18
  width: fit-content;
18
19
  height: fit-content;
20
+ display: flex;
21
+ flex-direction: column;
22
+ align-items: center;
19
23
  }
20
24
  ._17ify493 {
21
25
  width: 40.8vw;
22
26
  height: 24.53vw;
23
27
  }
24
28
  ._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);
29
+ margin-top: 1.6vw;
33
30
  }
34
31
  ._17ify495 {
35
- margin-top: 1.6vw;
36
32
  font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
37
33
  font-weight: 500;
38
34
  font-size: 4vw;
@@ -40,7 +36,6 @@
40
36
  line-height: 6.4vw;
41
37
  }
42
38
  ._17ify496 {
43
- margin-top: 1.6vw;
44
39
  font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
45
40
  font-weight: 400;
46
41
  font-size: 3.73vw;
@@ -565,7 +565,6 @@ const useAmapGCJ02 = () => {
565
565
  return { toCoordinateType, toGcj02, toGcj02Points, toLocalGcj02, toLocalGcj02Points };
566
566
  };
567
567
  const useGmapGCJ02 = () => {
568
- const { readyPromise } = useMapSupplier();
569
568
  const toCoordinateType = (p) => {
570
569
  return inChina(p) && !inHongkong(p) && !inMacau(p) ? "gcj02" : "wgs84";
571
570
  };
@@ -583,11 +582,9 @@ const useGmapGCJ02 = () => {
583
582
  };
584
583
  const toLocalGcj02Points = (points) => points.map(toLocalGcj02);
585
584
  const toGcj02 = async (point) => {
586
- await readyPromise;
587
585
  return toLocalGcj02Points([point])[0];
588
586
  };
589
587
  const toGcj02Points = async (points) => {
590
- await readyPromise;
591
588
  return toLocalGcj02Points(points);
592
589
  };
593
590
  return { toCoordinateType, toGcj02, toGcj02Points, toLocalGcj02, toLocalGcj02Points };
@@ -1,19 +1,17 @@
1
1
  import type { Point } from "../types/interface";
2
+ export declare const apiLocalIsPointInRing: (point: Point, path: Point[]) => boolean;
2
3
  export declare const useAmapGeometry: () => {
3
4
  apiMapDistance: (from: Point, to: Point) => number | undefined;
4
5
  apiMapDistanceToLine: (from: Point, line: Point[]) => number | undefined;
5
- apiMapIsPointInRing: (point: Point, path: Point[]) => boolean;
6
6
  apiMapDistanceOfLine: (line: Point[]) => number | undefined;
7
7
  };
8
8
  export declare const useGmapGeometry: () => {
9
9
  apiMapDistance: (from: Point, to: Point) => number | undefined;
10
10
  apiMapDistanceToLine: (from: Point, line: Point[]) => 0 | undefined;
11
- apiMapIsPointInRing: (point: Point, path: Point[]) => boolean;
12
11
  apiMapDistanceOfLine: (line: Point[]) => number | undefined;
13
12
  };
14
13
  export declare const useMapGeometry: () => {
15
14
  apiMapDistance: (from: Point, to: Point) => number | undefined;
16
15
  apiMapDistanceToLine: (from: Point, line: Point[]) => number | undefined;
17
- apiMapIsPointInRing: (point: Point, path: Point[]) => boolean;
18
16
  apiMapDistanceOfLine: (line: Point[]) => number | undefined;
19
17
  };
@@ -2,6 +2,7 @@ import { pointInPolygon } from "../utils/geometryPolygon.js";
2
2
  import { vec2lnglat } from "../utils/transform.js";
3
3
  import { Status } from "./useMapLoader.js";
4
4
  import { useMapSupplier } from "./useMapSupplier.js";
5
+ const apiLocalIsPointInRing = (point, path) => pointInPolygon(point, path) >= 0;
5
6
  const useAmapGeometry = () => {
6
7
  const payload = useMapSupplier();
7
8
  const apiMapDistance = (from, to) => {
@@ -19,8 +20,7 @@ const useAmapGeometry = () => {
19
20
  return void 0;
20
21
  return AMap.GeometryUtil.distanceOfLine(line);
21
22
  };
22
- const apiMapIsPointInRing = (point, path) => pointInPolygon(point, path) >= 0;
23
- return { apiMapDistance, apiMapDistanceToLine, apiMapIsPointInRing, apiMapDistanceOfLine };
23
+ return { apiMapDistance, apiMapDistanceToLine, apiMapDistanceOfLine };
24
24
  };
25
25
  const useGmapGeometry = () => {
26
26
  const payload = useMapSupplier();
@@ -39,14 +39,14 @@ const useGmapGeometry = () => {
39
39
  return void 0;
40
40
  return google.maps.geometry.spherical.computeLength(line.map(vec2lnglat));
41
41
  };
42
- const apiMapIsPointInRing = (point, path) => pointInPolygon(point, path) >= 0;
43
- return { apiMapDistance, apiMapDistanceToLine, apiMapIsPointInRing, apiMapDistanceOfLine };
42
+ return { apiMapDistance, apiMapDistanceToLine, apiMapDistanceOfLine };
44
43
  };
45
44
  const useMapGeometry = () => {
46
45
  const { supplier } = useMapSupplier();
47
46
  return supplier === "gmap" ? useGmapGeometry() : useAmapGeometry();
48
47
  };
49
48
  export {
49
+ apiLocalIsPointInRing,
50
50
  useAmapGeometry,
51
51
  useGmapGeometry,
52
52
  useMapGeometry
@@ -1,6 +1,7 @@
1
1
  import { shallowRef, computed, ref } from "vue-demi";
2
2
  import { watchPostEffectForDeepOption } from "../utils/compare.js";
3
3
  import { createRunOnce } from "../utils/helper.js";
4
+ import { patchGoogleMapLoader } from "../utils/patchGoogleMapLoader.js";
4
5
  import { t as throttle } from "../chunks/throttle.8bdd8d3b.js";
5
6
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
6
7
  var distExports = {};
@@ -639,11 +640,13 @@ const useGmapLoader = (props) => {
639
640
  if (statusRef.value === "SUCCESS")
640
641
  return;
641
642
  const loader = new Loader(options);
643
+ patchGoogleMapLoader(loader);
642
644
  clearTimeout(timerRef.value);
643
645
  timerRef.value = window.setTimeout(() => {
644
646
  statusRef.value = "TIMEOUT";
645
647
  }, GMAP_LOAD_TIMEOUT);
646
648
  if (loader.status !== LoaderStatus.INITIALIZED) {
649
+ window.google = void 0;
647
650
  loader.reset();
648
651
  }
649
652
  statusRef.value = "LOADING";
@@ -3,6 +3,7 @@ import type { Place, Point } from "../types/interface";
3
3
  export interface UseMapPlaceProps {
4
4
  pointRef: Ref<Point>;
5
5
  emptyPlaceName: string;
6
+ signal?: AbortSignal;
6
7
  onChange?: (value: Place) => any;
7
8
  }
8
9
  export declare const useAmapPlace: (props: UseMapPlaceProps) => {