@heycar/heycars-map 2.0.0-switchMap1 → 2.0.0-switchMap10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -29
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/v2/App.js +5 -3
- package/dist/v2/Demo/DemoBusinessQuoting.js +3 -2
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -1
- package/dist/v2/api/cdn.d.ts +1 -0
- package/dist/v2/api/cdn.js +2 -0
- package/dist/v2/api/googleSnapRoad.js +7 -2
- package/dist/v2/api/pingConnection.d.ts +9 -0
- package/dist/v2/api/pingConnection.js +111 -0
- package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +5 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +4 -3
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +3 -3
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +22 -13
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +12 -5
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.5be4fdcf.js → BusinessRecomendPlaceMap.b4d45108.js} +30 -18
- package/dist/v2/chunks/{Loading.fc6e75d0.js → Loading.492acbc2.js} +30 -2
- package/dist/v2/components/Loading/Loading.css.d.ts +5 -0
- package/dist/v2/components/Loading/Loading.d.ts +6 -0
- package/dist/v2/components/Loading/Loading.js +4 -2
- package/dist/v2/components/Loading/index.js +3 -2
- package/dist/v2/components/MapProvider/MapProvider.d.ts +2 -2
- package/dist/v2/components/MapProvider/MapProvider.js +23 -13
- package/dist/v2/css/Loading-49e58ced.css +46 -0
- package/dist/v2/hooks/useDrivingRoute.js +4 -0
- package/dist/v2/hooks/useMapGCJ02.js +4 -37
- package/dist/v2/hooks/useMapGeometry.d.ts +1 -3
- package/dist/v2/hooks/useMapGeometry.js +4 -4
- package/dist/v2/hooks/useMapGraspRoad.js +1 -2
- package/dist/v2/hooks/useMapInChina.d.ts +3 -15
- package/dist/v2/hooks/useMapInChina.js +11 -16
- package/dist/v2/hooks/useMapLoader.d.ts +13 -7
- package/dist/v2/hooks/useMapLoader.js +144 -82
- package/dist/v2/hooks/useMapPlace.d.ts +1 -0
- package/dist/v2/hooks/useMapPlace.js +52 -44
- package/dist/v2/hooks/useMapRecomendPlace.d.ts +1 -0
- package/dist/v2/hooks/useMapRecomendPlace.js +75 -67
- package/dist/v2/hooks/useMapSupplier.d.ts +8 -0
- package/dist/v2/hooks/useMapSupplier.js +17 -0
- package/dist/v2/hooks/usePingConnection.d.ts +10 -0
- package/dist/v2/hooks/usePingConnection.js +26 -0
- package/dist/v2/hooks-business/useBusinessQuotingMap.d.ts +2 -0
- package/dist/v2/hooks-business/useBusinessQuotingMap.js +7 -2
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/types/global.d.ts +3 -0
- package/dist/v2/types/interface.d.ts +1 -1
- package/dist/v2/utils/ManualAbortError.d.ts +3 -0
- package/dist/v2/utils/ManualAbortError.js +14 -0
- package/dist/v2/utils/helper.d.ts +2 -0
- package/dist/v2/utils/helper.js +29 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v2/utils/patchGoogleMapLoader.d.ts +2 -0
- package/dist/v2/utils/patchGoogleMapLoader.js +64 -0
- package/dist/v3/App.js +5 -3
- package/dist/v3/Demo/DemoBusinessQuoting.js +4 -3
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -1
- package/dist/v3/api/cdn.d.ts +1 -0
- package/dist/v3/api/cdn.js +2 -0
- package/dist/v3/api/googleSnapRoad.js +7 -2
- package/dist/v3/api/pingConnection.d.ts +9 -0
- package/dist/v3/api/pingConnection.js +111 -0
- package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +5 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +4 -3
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +3 -3
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +22 -13
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +12 -5
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.39888296.js → BusinessRecomendPlaceMap.6ba5dbb1.js} +30 -18
- package/dist/v3/chunks/{Loading.a8e2f26a.js → Loading.21d8e759.js} +26 -2
- package/dist/v3/components/Loading/Loading.css.d.ts +5 -0
- package/dist/v3/components/Loading/Loading.d.ts +8 -0
- package/dist/v3/components/Loading/Loading.js +4 -2
- package/dist/v3/components/Loading/index.js +3 -2
- package/dist/v3/components/MapProvider/MapProvider.d.ts +6 -3
- package/dist/v3/components/MapProvider/MapProvider.js +21 -13
- package/dist/v3/css/Loading-49e58ced.css +46 -0
- package/dist/v3/hooks/useDrivingRoute.js +4 -0
- package/dist/v3/hooks/useMapGCJ02.js +4 -37
- package/dist/v3/hooks/useMapGeometry.d.ts +1 -3
- package/dist/v3/hooks/useMapGeometry.js +4 -4
- package/dist/v3/hooks/useMapGraspRoad.js +1 -2
- package/dist/v3/hooks/useMapInChina.d.ts +3 -15
- package/dist/v3/hooks/useMapInChina.js +11 -16
- package/dist/v3/hooks/useMapLoader.d.ts +13 -7
- package/dist/v3/hooks/useMapLoader.js +144 -82
- package/dist/v3/hooks/useMapPlace.d.ts +1 -0
- package/dist/v3/hooks/useMapPlace.js +52 -44
- package/dist/v3/hooks/useMapRecomendPlace.d.ts +1 -0
- package/dist/v3/hooks/useMapRecomendPlace.js +75 -67
- package/dist/v3/hooks/useMapSupplier.d.ts +8 -0
- package/dist/v3/hooks/useMapSupplier.js +17 -0
- package/dist/v3/hooks/usePingConnection.d.ts +10 -0
- package/dist/v3/hooks/usePingConnection.js +26 -0
- package/dist/v3/hooks-business/useBusinessQuotingMap.d.ts +2 -0
- package/dist/v3/hooks-business/useBusinessQuotingMap.js +7 -2
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v3/types/global.d.ts +3 -0
- package/dist/v3/types/interface.d.ts +1 -1
- package/dist/v3/utils/ManualAbortError.d.ts +3 -0
- package/dist/v3/utils/ManualAbortError.js +14 -0
- package/dist/v3/utils/helper.d.ts +2 -0
- package/dist/v3/utils/helper.js +29 -0
- package/dist/v3/utils/log.js +1 -1
- package/dist/v3/utils/patchGoogleMapLoader.d.ts +2 -0
- package/dist/v3/utils/patchGoogleMapLoader.js +64 -0
- package/package.json +2 -2
- package/dist/v2/api/googleConnection.d.ts +0 -5
- package/dist/v2/api/googleConnection.js +0 -51
- package/dist/v2/css/Loading-523061b9.css +0 -9
- package/dist/v2/hooks/useGoogleConnection.d.ts +0 -7
- package/dist/v2/hooks/useGoogleConnection.js +0 -15
- package/dist/v3/api/googleConnection.d.ts +0 -5
- package/dist/v3/api/googleConnection.js +0 -51
- package/dist/v3/css/Loading-523061b9.css +0 -9
- package/dist/v3/hooks/useGoogleConnection.d.ts +0 -7
- package/dist/v3/hooks/useGoogleConnection.js +0 -15
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { sleep } from "../utils/helper.js";
|
|
8
|
+
const PING_AMAP_URL = "https://webapi.amap.com/maps";
|
|
9
|
+
const PING_AMAP_TIMEOUT = 5e3;
|
|
10
|
+
const PING_AMAP_INTERVAL = 5e3;
|
|
11
|
+
const PING_GMAP_URL = "https://maps.googleapis.com/maps/api/mapsjs/gen_204";
|
|
12
|
+
const PING_GMAP_TIMEOUT = 5e3;
|
|
13
|
+
const PING_GMAP_INTERVAL = 5e3;
|
|
14
|
+
const noop = () => {
|
|
15
|
+
};
|
|
16
|
+
const toUncachableUrl = (url, label = "") => {
|
|
17
|
+
const parsedUrl = new URL(url);
|
|
18
|
+
const randomKey = `ping${Date.now()}`;
|
|
19
|
+
parsedUrl.searchParams.set(randomKey, label);
|
|
20
|
+
return parsedUrl.toString();
|
|
21
|
+
};
|
|
22
|
+
class PingConnection {
|
|
23
|
+
constructor({ timeout, url, fetchOption }) {
|
|
24
|
+
__publicField(this, "timeout");
|
|
25
|
+
__publicField(this, "url");
|
|
26
|
+
__publicField(this, "fetchOption");
|
|
27
|
+
__publicField(this, "status", "pending");
|
|
28
|
+
__publicField(this, "listeners", /* @__PURE__ */ new Set());
|
|
29
|
+
__publicField(this, "updatingPromise");
|
|
30
|
+
this.timeout = timeout;
|
|
31
|
+
this.url = url;
|
|
32
|
+
this.fetchOption = fetchOption;
|
|
33
|
+
}
|
|
34
|
+
// 只有订阅了 onChange 事件,listen 才会更新状态
|
|
35
|
+
async listen(interval) {
|
|
36
|
+
while (true) {
|
|
37
|
+
if (this.listeners.size > 0)
|
|
38
|
+
await this.updateStatus();
|
|
39
|
+
await sleep(interval);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async updateStatus() {
|
|
43
|
+
const { url, timeout, fetchOption } = this;
|
|
44
|
+
if (this.updatingPromise)
|
|
45
|
+
return this.updatingPromise;
|
|
46
|
+
return this.updatingPromise = this.check(url, timeout, fetchOption).then((status) => {
|
|
47
|
+
this.status = status;
|
|
48
|
+
this.updatingPromise = void 0;
|
|
49
|
+
for (const handler of this.listeners) {
|
|
50
|
+
try {
|
|
51
|
+
handler(status);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error(err);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return status;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
check(url, timeout, fetchOption) {
|
|
60
|
+
const controller = new AbortController();
|
|
61
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
62
|
+
return fetch(toUncachableUrl(url, timeout.toString()), {
|
|
63
|
+
signal: controller.signal,
|
|
64
|
+
...fetchOption
|
|
65
|
+
}).then(() => "connected").catch(() => "unconnected").finally(() => clearTimeout(timer));
|
|
66
|
+
}
|
|
67
|
+
onChange(handler) {
|
|
68
|
+
if (typeof handler !== "function")
|
|
69
|
+
return noop;
|
|
70
|
+
this.listeners.add(handler);
|
|
71
|
+
const clear = () => {
|
|
72
|
+
this.listeners.delete(handler);
|
|
73
|
+
};
|
|
74
|
+
return clear;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const pingAmapConnection = new PingConnection({
|
|
78
|
+
timeout: PING_AMAP_TIMEOUT,
|
|
79
|
+
url: PING_AMAP_URL,
|
|
80
|
+
fetchOption: {
|
|
81
|
+
method: "HEAD"
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const pingGmapConnection = new PingConnection({
|
|
85
|
+
timeout: PING_GMAP_TIMEOUT,
|
|
86
|
+
url: PING_GMAP_URL
|
|
87
|
+
});
|
|
88
|
+
pingAmapConnection.listen(PING_AMAP_INTERVAL);
|
|
89
|
+
pingGmapConnection.listen(PING_GMAP_INTERVAL);
|
|
90
|
+
const apiGetPingAmapStatus = () => {
|
|
91
|
+
return pingAmapConnection.status;
|
|
92
|
+
};
|
|
93
|
+
const apiGetPingGmapStatus = () => {
|
|
94
|
+
return pingGmapConnection.status;
|
|
95
|
+
};
|
|
96
|
+
const apiPingAmap = () => {
|
|
97
|
+
return pingAmapConnection.updateStatus();
|
|
98
|
+
};
|
|
99
|
+
const apiPingGmap = () => {
|
|
100
|
+
return pingGmapConnection.updateStatus();
|
|
101
|
+
};
|
|
102
|
+
const apiSubscribePingAmapChange = (handler) => pingAmapConnection.onChange(handler);
|
|
103
|
+
const apiSubscribePingGmapChange = (handler) => pingGmapConnection.onChange(handler);
|
|
104
|
+
export {
|
|
105
|
+
apiGetPingAmapStatus,
|
|
106
|
+
apiGetPingGmapStatus,
|
|
107
|
+
apiPingAmap,
|
|
108
|
+
apiPingGmap,
|
|
109
|
+
apiSubscribePingAmapChange,
|
|
110
|
+
apiSubscribePingGmapChange
|
|
111
|
+
};
|
|
@@ -4,7 +4,7 @@ import { createElement } from "../../demi-polyfill/demi-polyfill.js";
|
|
|
4
4
|
import { useHeycarMap } from "../../hooks/useHeycarMap.js";
|
|
5
5
|
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
6
6
|
import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
7
|
-
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
7
|
+
import { useMapSupplier, useMapAssertSupplier } from "../../hooks/useMapSupplier.js";
|
|
8
8
|
import { defineSetup, defineLagecySetup } from "../../types/helper.js";
|
|
9
9
|
import { generateCreateElementV2PropsOn } from "../../utils/compare.js";
|
|
10
10
|
import { place2point, pipeDefer } from "../../utils/transform.js";
|
|
@@ -25,6 +25,9 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
|
|
|
25
25
|
const {
|
|
26
26
|
language
|
|
27
27
|
} = useMapSupplier();
|
|
28
|
+
const {
|
|
29
|
+
assertSupplier
|
|
30
|
+
} = useMapAssertSupplier();
|
|
28
31
|
const {
|
|
29
32
|
mapRef,
|
|
30
33
|
setMap
|
|
@@ -40,7 +43,7 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
|
|
|
40
43
|
mapRef,
|
|
41
44
|
padding: BUSINESS_QUOTING_FITVIEW_PANDING
|
|
42
45
|
});
|
|
43
|
-
mapContext.setFitView = () => setFitView(false);
|
|
46
|
+
mapContext.setFitView = assertSupplier(() => setFitView(false));
|
|
44
47
|
const fittableRegistryOverlay = createFittableRegisterOverlay({
|
|
45
48
|
registerOverlay,
|
|
46
49
|
immediate: true
|
|
@@ -45,7 +45,7 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
45
45
|
onClickLocatorText?: AbsoluteAddressBoxProps["onClickText"];
|
|
46
46
|
onClickLocatorPhoto?: AbsoluteAddressBoxProps["onClickPhoto"];
|
|
47
47
|
}
|
|
48
|
-
export declare const BusinessRecomendPlaceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, 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<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "
|
|
48
|
+
export declare const BusinessRecomendPlaceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, 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<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "changePlace" | "loadGeoLocation" | "loadDefaultGeoLocation" | "changeByDrag" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", import("vue-demi").PublicProps, BusinessRecomendPlaceMapProps, BusinessRecomendPlaceMapProps, import("vue-demi").SlotsType<{
|
|
49
49
|
renderPlacePhoto?: ((place: CoordinatePlace) => string | undefined) | undefined;
|
|
50
50
|
renderPlaceTag?: PickupPointsProps["renderPlaceTag"];
|
|
51
51
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
@@ -54,7 +54,7 @@ export declare const BusinessRecomendPlaceMapInner: import("vue-demi").DefineCom
|
|
|
54
54
|
} & {
|
|
55
55
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
56
56
|
}>>;
|
|
57
|
-
export declare const BusinessRecomendPlaceMap: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, 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<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "
|
|
57
|
+
export declare const BusinessRecomendPlaceMap: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, 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<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "changePlace" | "loadGeoLocation" | "loadDefaultGeoLocation" | "changeByDrag" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", import("vue-demi").PublicProps, BusinessRecomendPlaceMapProps, BusinessRecomendPlaceMapProps, import("vue-demi").SlotsType<{
|
|
58
58
|
renderPlacePhoto?: ((place: CoordinatePlace) => string | undefined) | undefined;
|
|
59
59
|
renderPlaceTag?: PickupPointsProps["renderPlaceTag"];
|
|
60
60
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
@@ -14,6 +14,7 @@ import "../../hooks/useMapSupplier.js";
|
|
|
14
14
|
import "../../hooks/useMapZoom.js";
|
|
15
15
|
import "../../types/helper.js";
|
|
16
16
|
import "../../types/interface.js";
|
|
17
|
+
import "../../utils/ManualAbortError.js";
|
|
17
18
|
import "../../utils/compare.js";
|
|
18
19
|
import "../../utils/helper.js";
|
|
19
20
|
import "../../utils/platform.js";
|
|
@@ -25,15 +26,15 @@ import "../GreenZone/GreenZone.js";
|
|
|
25
26
|
import "../PassengerCircle/PassengerCircle.js";
|
|
26
27
|
import "../PickupPoints/PickupPoints.js";
|
|
27
28
|
import "./useCacheCenterPlace.js";
|
|
28
|
-
import { B, f, D, E,
|
|
29
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.6ba5dbb1.js";
|
|
29
30
|
export {
|
|
30
31
|
B as BusinessRecomendPlaceMap,
|
|
31
32
|
f as BusinessRecomendPlaceMapInner,
|
|
32
33
|
D as DEFAULT_ZOOM,
|
|
33
34
|
E as EMPTY_PLACE,
|
|
34
|
-
|
|
35
|
+
R as RECOMMEND_PLACE_DRAG_LIMIT,
|
|
35
36
|
c as RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
36
|
-
|
|
37
|
+
a as RECOMMEND_PLACE_LARGE_LIMIT,
|
|
37
38
|
e as RECOMMEND_PLACE_TEXT_ZOOM_MIN,
|
|
38
39
|
b as RECOMMEND_PLACE_ZONE_ICON_MIN,
|
|
39
40
|
d as RECOMMEND_PLACE_ZONE_TEXT_MIN,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { B, f, D, E,
|
|
1
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.6ba5dbb1.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BusinessRecomendPlaceMap,
|
|
4
4
|
f as BusinessRecomendPlaceMapInner,
|
|
5
5
|
D as DEFAULT_ZOOM,
|
|
6
6
|
E as EMPTY_PLACE,
|
|
7
|
-
|
|
7
|
+
R as RECOMMEND_PLACE_DRAG_LIMIT,
|
|
8
8
|
c as RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
9
|
-
|
|
9
|
+
a as RECOMMEND_PLACE_LARGE_LIMIT,
|
|
10
10
|
e as RECOMMEND_PLACE_TEXT_ZOOM_MIN,
|
|
11
11
|
b as RECOMMEND_PLACE_ZONE_ICON_MIN,
|
|
12
12
|
d as RECOMMEND_PLACE_ZONE_TEXT_MIN,
|
|
@@ -3,7 +3,7 @@ import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap"
|
|
|
3
3
|
export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "loading" | "fallback" | "log" | "getAvailable" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "renderPlacePhoto" | "renderPlaceTag" | "onChangeGeoLocation" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
|
|
4
4
|
defaultPlace?: CoordinatePlace;
|
|
5
5
|
}
|
|
6
|
-
export declare const BusinessReselectPlaceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, 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<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "
|
|
6
|
+
export declare const BusinessReselectPlaceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, 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<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", import("vue-demi").PublicProps, BusinessReselectPlaceMapProps, BusinessReselectPlaceMapProps, import("vue-demi").SlotsType<{
|
|
7
7
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
8
8
|
loading?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
9
9
|
renderPlaceTag?: ((place: Place) => string | undefined) | undefined;
|
|
@@ -11,7 +11,7 @@ export declare const BusinessReselectPlaceMapInner: import("vue-demi").DefineCom
|
|
|
11
11
|
} & {
|
|
12
12
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
13
13
|
}>>;
|
|
14
|
-
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, 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<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "
|
|
14
|
+
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, 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<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", import("vue-demi").PublicProps, BusinessReselectPlaceMapProps, BusinessReselectPlaceMapProps, import("vue-demi").SlotsType<{
|
|
15
15
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
16
16
|
loading?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
17
17
|
renderPlaceTag?: ((place: Place) => string | undefined) | undefined;
|
|
@@ -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
|
|
23
|
+
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_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.6ba5dbb1.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,
|
|
@@ -51,7 +53,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
51
53
|
coordinatifyGeoPosition
|
|
52
54
|
} = useMapCoordinatify();
|
|
53
55
|
const pipedGetAvailable = getAvailable && pipeOnlyLastEffect((p) => getAvailable(coordinatifyPlace(p)));
|
|
54
|
-
const pipedGetRecomendPlace = pipeOnlyLastEffect((p) => getRecomendPlace(coordinatifyPlace(p)).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r))));
|
|
56
|
+
const pipedGetRecomendPlace = pipeOnlyLastEffect((p, context) => getRecomendPlace(coordinatifyPlace(p), context).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r))));
|
|
55
57
|
const {
|
|
56
58
|
apiMapDistance
|
|
57
59
|
} = useMapGeometry();
|
|
@@ -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,
|
|
@@ -94,6 +99,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
94
99
|
place: inputPlace,
|
|
95
100
|
recommends: inputRecommends
|
|
96
101
|
}) => {
|
|
102
|
+
centerSource.source = "api";
|
|
97
103
|
const place = unCoordinatifyPlace(toCoordinatePlaceType(inputPlace));
|
|
98
104
|
const recommends = unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(inputRecommends));
|
|
99
105
|
const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
|
|
@@ -148,19 +154,19 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
148
154
|
emitGeoErrorOnce(error);
|
|
149
155
|
}
|
|
150
156
|
});
|
|
151
|
-
mapContext.apiMapDistance = (from, to) => {
|
|
157
|
+
mapContext.apiMapDistance = assertSupplier((from, to) => {
|
|
152
158
|
return apiMapDistance(unCoordinatifyPoint(toCoordinatePointType(from)), unCoordinatifyPoint(toCoordinatePointType(to)));
|
|
153
|
-
};
|
|
154
|
-
mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
|
|
155
|
-
mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
|
|
156
|
-
mapContext.panToGeoPositionByRecomend = () => {
|
|
159
|
+
});
|
|
160
|
+
mapContext.setCenterPlaceByUserSpecified = assertSupplier(setCenterPlaceByUserSpecified);
|
|
161
|
+
mapContext.setCenterPlaceByUserSpecifiedInZone = assertSupplier(setCenterPlaceByUserSpecifiedInZone);
|
|
162
|
+
mapContext.panToGeoPositionByRecomend = assertSupplier(() => {
|
|
157
163
|
if (geoError.value)
|
|
158
164
|
return false;
|
|
159
165
|
updateCenterPlaceByPoint(geoPosition.value, {
|
|
160
166
|
source: "geo"
|
|
161
167
|
});
|
|
162
168
|
return true;
|
|
163
|
-
};
|
|
169
|
+
});
|
|
164
170
|
const {
|
|
165
171
|
isDragging
|
|
166
172
|
} = useMapDrag({
|
|
@@ -183,6 +189,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
183
189
|
emptyPlaceName: emptyTitle,
|
|
184
190
|
queryingPlaceName: queryingTitle,
|
|
185
191
|
context: centerSource,
|
|
192
|
+
signal: abortController.signal,
|
|
186
193
|
getAvailable: pipedGetAvailable,
|
|
187
194
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
188
195
|
getLimit: (context) => {
|
|
@@ -195,14 +202,15 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
195
202
|
case "default":
|
|
196
203
|
return RECOMMEND_PLACE_LARGE_LIMIT;
|
|
197
204
|
default:
|
|
198
|
-
|
|
205
|
+
console.error(new Error(`MyError: should not call getLimit on source: ${source}`));
|
|
206
|
+
return RECOMMEND_PLACE_DRAG_LIMIT;
|
|
199
207
|
}
|
|
200
208
|
},
|
|
201
209
|
onQueryingPlace: (place) => equalAssign(centerPlace, {
|
|
202
210
|
...place
|
|
203
211
|
}),
|
|
204
212
|
onChangePlace: (place) => emit("changePlace", coordinatifyPlace(place)),
|
|
205
|
-
onChange:
|
|
213
|
+
onChange: ({
|
|
206
214
|
place,
|
|
207
215
|
inputPlace,
|
|
208
216
|
isInZone,
|
|
@@ -224,7 +232,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
224
232
|
}));
|
|
225
233
|
}
|
|
226
234
|
});
|
|
227
|
-
watchPostEffectOnce(() => updateRecommendPlaceOnlyInZone(defaultPlace));
|
|
235
|
+
watchPostEffectOnce(() => updateRecommendPlaceOnlyInZone(defaultPlace).catch(throwNoneManualAbortError));
|
|
228
236
|
watch(centerPlace, (place) => {
|
|
229
237
|
equalAssign(mapContext.centerPlace, coordinatifyPlace({
|
|
230
238
|
...place
|
|
@@ -236,6 +244,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
236
244
|
watchEffect(() => {
|
|
237
245
|
mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
|
|
238
246
|
});
|
|
247
|
+
onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
|
|
239
248
|
return () => {
|
|
240
249
|
var _a;
|
|
241
250
|
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 {
|
|
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,
|
package/dist/v3/chunks/{BusinessRecomendPlaceMap.39888296.js → BusinessRecomendPlaceMap.6ba5dbb1.js}
RENAMED
|
@@ -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,
|
|
@@ -296,7 +298,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
296
298
|
coordinatifyGeoPosition
|
|
297
299
|
} = useMapCoordinatify();
|
|
298
300
|
const pipedGetAvailable = getAvailable && pipeOnlyLastEffect((p) => getAvailable(coordinatifyPlace(p)));
|
|
299
|
-
const pipedGetRecomendPlace = pipeOnlyLastEffect((p) => getRecomendPlace(coordinatifyPlace(p)).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r))));
|
|
301
|
+
const pipedGetRecomendPlace = pipeOnlyLastEffect((p, context) => getRecomendPlace(coordinatifyPlace(p), context).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r))));
|
|
300
302
|
const {
|
|
301
303
|
apiMapDistance
|
|
302
304
|
} = useMapGeometry();
|
|
@@ -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,
|
|
@@ -327,7 +333,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
327
333
|
geoLoadingTitle
|
|
328
334
|
});
|
|
329
335
|
const centerSource = {
|
|
330
|
-
source: "
|
|
336
|
+
source: "default"
|
|
331
337
|
};
|
|
332
338
|
const updateCenterPlaceByPoint = (point, context) => {
|
|
333
339
|
var _a;
|
|
@@ -345,6 +351,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
345
351
|
place: inputPlace,
|
|
346
352
|
recommends: inputRecommends
|
|
347
353
|
}) => {
|
|
354
|
+
centerSource.source = "api";
|
|
348
355
|
const place = unCoordinatifyPlace(toCoordinatePlaceType(inputPlace));
|
|
349
356
|
const recommends = unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(inputRecommends));
|
|
350
357
|
const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
|
|
@@ -395,7 +402,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
395
402
|
if (!isFirstLoad)
|
|
396
403
|
return;
|
|
397
404
|
const [lng, lat] = value.position;
|
|
398
|
-
|
|
405
|
+
if (supplier === "amap")
|
|
406
|
+
await readyPromise;
|
|
399
407
|
centerSource.source = "geo";
|
|
400
408
|
centerPlace.lng = lng;
|
|
401
409
|
centerPlace.lat = lat;
|
|
@@ -405,7 +413,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
405
413
|
emit("loadDefaultGeoLocation", coordinatifyGeoPosition(value));
|
|
406
414
|
if (!isFirstLoad)
|
|
407
415
|
return;
|
|
408
|
-
|
|
416
|
+
if (supplier === "amap")
|
|
417
|
+
await readyPromise;
|
|
409
418
|
centerSource.source = "geo";
|
|
410
419
|
updatePlace(value.position);
|
|
411
420
|
},
|
|
@@ -418,19 +427,19 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
418
427
|
emitGeoErrorOnce(error);
|
|
419
428
|
}
|
|
420
429
|
});
|
|
421
|
-
mapContext.apiMapDistance = (from, to) => {
|
|
430
|
+
mapContext.apiMapDistance = assertSupplier((from, to) => {
|
|
422
431
|
return apiMapDistance(unCoordinatifyPoint(toCoordinatePointType(from)), unCoordinatifyPoint(toCoordinatePointType(to)));
|
|
423
|
-
};
|
|
424
|
-
mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
|
|
425
|
-
mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
|
|
426
|
-
mapContext.panToGeoPositionByRecomend = () => {
|
|
432
|
+
});
|
|
433
|
+
mapContext.setCenterPlaceByUserSpecified = assertSupplier(setCenterPlaceByUserSpecified);
|
|
434
|
+
mapContext.setCenterPlaceByUserSpecifiedInZone = assertSupplier(setCenterPlaceByUserSpecifiedInZone);
|
|
435
|
+
mapContext.panToGeoPositionByRecomend = assertSupplier(() => {
|
|
427
436
|
if (geoError.value)
|
|
428
437
|
return false;
|
|
429
438
|
updateCenterPlaceByPoint(geoPosition.value, {
|
|
430
439
|
source: "geo"
|
|
431
440
|
});
|
|
432
441
|
return true;
|
|
433
|
-
};
|
|
442
|
+
});
|
|
434
443
|
const {
|
|
435
444
|
isDragging
|
|
436
445
|
} = useMapDrag({
|
|
@@ -454,6 +463,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
454
463
|
emptyPlaceName: emptyTitle,
|
|
455
464
|
queryingPlaceName: queryingTitle,
|
|
456
465
|
context: centerSource,
|
|
466
|
+
signal: abortController.signal,
|
|
457
467
|
getAvailable: pipedGetAvailable,
|
|
458
468
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
459
469
|
getLimit: (context) => {
|
|
@@ -466,14 +476,15 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
466
476
|
case "default":
|
|
467
477
|
return RECOMMEND_PLACE_LARGE_LIMIT;
|
|
468
478
|
default:
|
|
469
|
-
|
|
479
|
+
console.error(new Error(`MyError: should not call getLimit on source: ${source}`));
|
|
480
|
+
return RECOMMEND_PLACE_DRAG_LIMIT;
|
|
470
481
|
}
|
|
471
482
|
},
|
|
472
483
|
onQueryingPlace: (place) => equalAssign(centerPlace, {
|
|
473
484
|
...place
|
|
474
485
|
}),
|
|
475
486
|
onChangePlace: (place) => emit("changePlace", coordinatifyPlace(place)),
|
|
476
|
-
onChange:
|
|
487
|
+
onChange: ({
|
|
477
488
|
place,
|
|
478
489
|
inputPlace,
|
|
479
490
|
isInZone,
|
|
@@ -498,7 +509,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
498
509
|
const centerPlaceStatusRef = computed(() => isFirstLoad && geoLoading.value ? CenterPlaceStatus.GEO_LOADING : isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK);
|
|
499
510
|
watchPostEffectOnce(() => {
|
|
500
511
|
if (!isFirstLoad)
|
|
501
|
-
updateRecommendPlaceOnlyInZone(defaultCenterPlace);
|
|
512
|
+
updateRecommendPlaceOnlyInZone(defaultCenterPlace).catch(throwNoneManualAbortError);
|
|
502
513
|
});
|
|
503
514
|
watch(centerPlace, (place) => {
|
|
504
515
|
if (centerPlaceStatusRef.value === CenterPlaceStatus.OK) {
|
|
@@ -516,6 +527,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
516
527
|
watchEffect(() => {
|
|
517
528
|
mapContext.centerPlaceStatusRef.value = centerPlaceStatusRef.value;
|
|
518
529
|
});
|
|
530
|
+
onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
|
|
519
531
|
return () => {
|
|
520
532
|
var _a;
|
|
521
533
|
const {
|
|
@@ -595,9 +607,9 @@ export {
|
|
|
595
607
|
BusinessRecomendPlaceMap as B,
|
|
596
608
|
DEFAULT_ZOOM as D,
|
|
597
609
|
EMPTY_PLACE as E,
|
|
598
|
-
|
|
610
|
+
RECOMMEND_PLACE_DRAG_LIMIT as R,
|
|
599
611
|
ZONE_ZOOM as Z,
|
|
600
|
-
|
|
612
|
+
RECOMMEND_PLACE_LARGE_LIMIT as a,
|
|
601
613
|
RECOMMEND_PLACE_ZONE_ICON_MIN as b,
|
|
602
614
|
RECOMMEND_PLACE_ICON_ZOOM_MIN as c,
|
|
603
615
|
RECOMMEND_PLACE_ZONE_TEXT_MIN as d,
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import "../css/Loading-
|
|
1
|
+
import "../css/Loading-49e58ced.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 contentLayout = "_17ify492";
|
|
9
|
+
var description = "_17ify496";
|
|
10
|
+
var iconLoadFailed = "_17ify493";
|
|
7
11
|
var loadingBg = "_17ify491";
|
|
8
12
|
var loadingLayout = "_17ify490";
|
|
13
|
+
var title = "_17ify495";
|
|
14
|
+
var verticalGap = "_17ify494";
|
|
9
15
|
const Loading = defineSetup("Loading", function() {
|
|
10
16
|
return () => createVNode("div", {
|
|
11
17
|
"class": loadingLayout
|
|
@@ -17,7 +23,25 @@ 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": contentLayout
|
|
34
|
+
}, [createVNode("img", {
|
|
35
|
+
"class": iconLoadFailed,
|
|
36
|
+
"src": ICON_LOAD_FAILED_URL
|
|
37
|
+
}, null), createVNode("span", {
|
|
38
|
+
"class": `${title} ${verticalGap}`
|
|
39
|
+
}, [props.title]), createVNode("span", {
|
|
40
|
+
"class": `${description} ${verticalGap}`
|
|
41
|
+
}, [props.description])])]);
|
|
42
|
+
});
|
|
20
43
|
export {
|
|
21
|
-
|
|
44
|
+
LoadFailed as L,
|
|
45
|
+
Loading as a,
|
|
22
46
|
imgGrid as i
|
|
23
47
|
};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const loadingLayout: string;
|
|
2
2
|
export declare const loadingBg: string;
|
|
3
|
+
export declare const contentLayout: string;
|
|
4
|
+
export declare const iconLoadFailed: string;
|
|
5
|
+
export declare const verticalGap: string;
|
|
6
|
+
export declare const title: string;
|
|
7
|
+
export declare const description: string;
|