@heycar/heycars-map 2.5.0 → 2.5.2
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 +3 -1
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +4 -2
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.d8f5b904.js → BusinessRecomendPlaceMap.824002ef.js} +1 -1
- package/dist/v2/hooks/useMapPlace.js +4 -3
- package/dist/v2/hooks/useMapRecomendPlace.js +5 -3
- package/dist/v2/hooks/useMapSupplier.js +0 -1
- package/dist/v2/hooks/useWalkingRoute.js +6 -0
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/utils/ManualAbortError.d.ts +3 -0
- package/dist/v2/utils/ManualAbortError.js +22 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +4 -2
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.4c38b1fb.js → BusinessRecomendPlaceMap.d14dbe4e.js} +1 -1
- package/dist/v3/hooks/useMapPlace.js +4 -3
- package/dist/v3/hooks/useMapRecomendPlace.js +5 -3
- package/dist/v3/hooks/useMapSupplier.js +0 -1
- package/dist/v3/hooks/useWalkingRoute.js +6 -0
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v3/utils/ManualAbortError.d.ts +3 -0
- package/dist/v3/utils/ManualAbortError.js +22 -0
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -236,7 +236,8 @@ export default defineComponent({
|
|
|
236
236
|
<BusinessRecomendPlaceMap
|
|
237
237
|
class={"demo"}
|
|
238
238
|
geoLoadingTitle={"正在获取您当前的位置"}
|
|
239
|
-
unavailableTitle={"
|
|
239
|
+
unavailableTitle={"当前区域暂未开通服务"}
|
|
240
|
+
forbiddenTitle={"当前区域不可叫车"}
|
|
240
241
|
emptyTitle={"当前位置"}
|
|
241
242
|
queryingTitle={"正在获取地址信息"}
|
|
242
243
|
recomendDescription={"您将在此处上车"}
|
|
@@ -358,6 +359,7 @@ export default defineComponent({
|
|
|
358
359
|
<BusinessReselectPlaceMap
|
|
359
360
|
class={"demo"}
|
|
360
361
|
unavailableTitle={"当前区域暂未开通服务"}
|
|
362
|
+
forbiddenTitle={"当前区域不可叫车"}
|
|
361
363
|
emptyTitle={"当前位置"}
|
|
362
364
|
queryingTitle={"正在获取地址信息"}
|
|
363
365
|
recomendDescription={"您将在此处上车"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.824002ef.js";
|
|
3
3
|
import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
|
|
4
4
|
import { defineSetup } from "../types/helper.js";
|
|
5
5
|
import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
|
|
@@ -27,7 +27,7 @@ import "../GreenZone/GreenZone.js";
|
|
|
27
27
|
import "../PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import "../PickupPoints/PickupPoints.js";
|
|
29
29
|
import "./useCacheCenterPlace.js";
|
|
30
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
30
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.824002ef.js";
|
|
31
31
|
export {
|
|
32
32
|
B as BusinessRecomendPlaceMap,
|
|
33
33
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
1
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.824002ef.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BusinessRecomendPlaceMap,
|
|
4
4
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -21,7 +21,7 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
|
|
|
21
21
|
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
|
|
22
22
|
import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
|
|
23
23
|
import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
24
|
-
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.
|
|
24
|
+
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.824002ef.js";
|
|
25
25
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
26
26
|
import { GreenZone } from "../GreenZone/GreenZone.js";
|
|
27
27
|
import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
|
|
@@ -227,6 +227,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
227
227
|
place,
|
|
228
228
|
inputPlace,
|
|
229
229
|
type,
|
|
230
|
+
zone,
|
|
230
231
|
isSameZone
|
|
231
232
|
}) => {
|
|
232
233
|
var _a;
|
|
@@ -236,12 +237,13 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
236
237
|
equalAssign(centerPlace, {
|
|
237
238
|
...place
|
|
238
239
|
});
|
|
239
|
-
if (type === "Restricted" && !isSameZone)
|
|
240
|
+
if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
|
|
240
241
|
setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path);
|
|
241
242
|
emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
|
|
242
243
|
place,
|
|
243
244
|
inputPlace,
|
|
244
245
|
type,
|
|
246
|
+
zone,
|
|
245
247
|
isSameZone
|
|
246
248
|
}));
|
|
247
249
|
}
|
package/dist/v2/chunks/{BusinessRecomendPlaceMap.d8f5b904.js → BusinessRecomendPlaceMap.824002ef.js}
RENAMED
|
@@ -511,7 +511,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
511
511
|
equalAssign(centerPlace, {
|
|
512
512
|
...place
|
|
513
513
|
});
|
|
514
|
-
if (type === "Restricted" && !isSameZone)
|
|
514
|
+
if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
|
|
515
515
|
setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path, place2point(place));
|
|
516
516
|
emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
|
|
517
517
|
place,
|
|
@@ -41,6 +41,7 @@ const useAmapPlace = (props) => {
|
|
|
41
41
|
const pipeTw = createPipeTw(language === "zh-TW");
|
|
42
42
|
const isChina = inChina([lng, lat]);
|
|
43
43
|
geocoder.getAddress(new AMap.LngLat(lng, lat), (status, result) => {
|
|
44
|
+
clearTimeout(timer);
|
|
44
45
|
switch (status) {
|
|
45
46
|
case "complete": {
|
|
46
47
|
const { formattedAddress, addressComponent } = result.regeocode;
|
|
@@ -59,7 +60,7 @@ const useAmapPlace = (props) => {
|
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
}, handleFailed);
|
|
62
|
-
setTimeout(() => {
|
|
63
|
+
const timer = setTimeout(() => {
|
|
63
64
|
console.warn("高德逆地理请求超时!");
|
|
64
65
|
handleFailed();
|
|
65
66
|
}, REGEO_TIMEOUT);
|
|
@@ -112,13 +113,13 @@ const useGmapPlace = (props) => {
|
|
|
112
113
|
readyPromise.then(() => {
|
|
113
114
|
const geocoder = new google.maps.Geocoder();
|
|
114
115
|
const pipeTw = createPipeTw(language === "zh-TW");
|
|
115
|
-
geocoder.geocode({ language, location: { lng, lat } }).then(({ results }) => {
|
|
116
|
+
geocoder.geocode({ language, location: { lng, lat } }).finally(() => clearTimeout(timer)).then(({ results }) => {
|
|
116
117
|
const name = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
|
|
117
118
|
const displayName = gmapPlaceName2DisplayName(name, results[0].address_components);
|
|
118
119
|
resolve({ lng, lat, name: pipeTw(name), displayName: pipeTw(displayName) });
|
|
119
120
|
}).catch(handleFailed);
|
|
120
121
|
}, handleFailed);
|
|
121
|
-
setTimeout(() => {
|
|
122
|
+
const timer = setTimeout(() => {
|
|
122
123
|
console.warn("谷歌逆地理请求超时!");
|
|
123
124
|
handleFailed();
|
|
124
125
|
}, REGEO_TIMEOUT);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, reactive } from "vue-demi";
|
|
2
2
|
import { GET_RECOMMEND_PLACE_TIMEOUT } from "../api/contants.js";
|
|
3
|
-
import { logNoneManualAbortError } from "../utils/ManualAbortError.js";
|
|
3
|
+
import { recoverablyIgnoreManualAbortReject, logNoneManualAbortError } from "../utils/ManualAbortError.js";
|
|
4
4
|
import { createAbortableOneConcurrent, AbortSignalAny, equalAssign, isPlacesInclude, createAbortable } from "../utils/helper.js";
|
|
5
5
|
import { isZoneEqual, place2point, isPlaceEqual, businessCandidatesToAdsorptionPlace } from "../utils/transform.js";
|
|
6
6
|
import { assertNoConflictTypeAndZone } from "../utils/typeChecking.js";
|
|
@@ -103,7 +103,9 @@ const useMapRecomendPlace = (props) => {
|
|
|
103
103
|
const [lng, lat] = point;
|
|
104
104
|
const { type, zone, available, candidates } = prevState;
|
|
105
105
|
if (!zone || !apiLocalIsPointInRing(point, zone.path)) {
|
|
106
|
-
const
|
|
106
|
+
const reGeoPlacePromiseIgnored = recoverablyIgnoreManualAbortReject(
|
|
107
|
+
getPlaceByRegeo(point, opt)
|
|
108
|
+
);
|
|
107
109
|
const {
|
|
108
110
|
place: closestPlace,
|
|
109
111
|
candidates: candidates2,
|
|
@@ -114,7 +116,7 @@ const useMapRecomendPlace = (props) => {
|
|
|
114
116
|
if (isPlacesInclude(candidates2, closestPlace)) {
|
|
115
117
|
return { place: { ...closestPlace }, zone: zone2, available: available2, candidates: candidates2, type: type2 };
|
|
116
118
|
}
|
|
117
|
-
const regeoPlace = await
|
|
119
|
+
const regeoPlace = await reGeoPlacePromiseIgnored.recover();
|
|
118
120
|
return { place: { ...regeoPlace }, zone: zone2, available: available2, candidates: candidates2, type: type2 };
|
|
119
121
|
}
|
|
120
122
|
if (type === "Forbidden") {
|
|
@@ -12,7 +12,6 @@ const useMapAssertSupplier = () => {
|
|
|
12
12
|
const instanceSupplier = payload.supplier;
|
|
13
13
|
function assertSupplier(fn) {
|
|
14
14
|
return function fnWithAssertSupplier(...args) {
|
|
15
|
-
console.log("instanceSupplier, payload.supplier = ", instanceSupplier, payload.supplier);
|
|
16
15
|
if (instanceSupplier === payload.supplier)
|
|
17
16
|
return fn(...args);
|
|
18
17
|
throw Error(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { shallowRef } from "vue-demi";
|
|
2
2
|
import { watchPostEffectForDeepOption } from "../utils/compare.js";
|
|
3
3
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
4
|
+
const isIgnoredAmapWalkingRouteError = (err) => err === "RETURN_TIMEOUT";
|
|
4
5
|
const useAWalkingRoute = (props) => {
|
|
5
6
|
const pathRef = shallowRef([]);
|
|
6
7
|
const amapWalking = new AMap.Walking({});
|
|
@@ -30,6 +31,11 @@ const useAWalkingRoute = (props) => {
|
|
|
30
31
|
pathRef.value = [];
|
|
31
32
|
return;
|
|
32
33
|
default:
|
|
34
|
+
if (isIgnoredAmapWalkingRouteError(result)) {
|
|
35
|
+
console.warn(result);
|
|
36
|
+
pathRef.value = [];
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
33
39
|
throw result;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { reactive, ref, readonly } from "vue-demi";
|
|
2
|
-
import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.824002ef.js";
|
|
3
3
|
import { CenterPlaceStatus } from "../types/interface.js";
|
|
4
4
|
import { proxyFunctionalProperty, assertAssingedBeforeUsed } from "../utils/helper.js";
|
|
5
5
|
const useBusinessRecomendPlaceMap = () => {
|
package/dist/v2/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { isCoordinatePointEqual } from "./api/geometry.js";
|
|
|
3
3
|
import { AbsoluteAddressBox } from "./business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
4
4
|
import { AddressBox } from "./business-components/AddressBox/AddressBox.js";
|
|
5
5
|
import { BusinessQuotingMap } from "./business-components/BusinessQuotingMap/BusinessQuotingMap.js";
|
|
6
|
-
import { B } from "./chunks/BusinessRecomendPlaceMap.
|
|
6
|
+
import { B } from "./chunks/BusinessRecomendPlaceMap.824002ef.js";
|
|
7
7
|
import { BusinessReselectPlaceMap } from "./business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js";
|
|
8
8
|
import { BusinessTaxiEndMap } from "./business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
|
|
9
9
|
import { BusinessTaxiServiceMap } from "./business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare const MANUAL_ABORT_MESSAGE = "MANUAL_ABORT_MESSAGE";
|
|
2
2
|
export declare const throwNoneManualAbortError: (e: unknown) => void;
|
|
3
3
|
export declare const logNoneManualAbortError: (e: unknown) => void;
|
|
4
|
+
export declare const recoverablyIgnoreManualAbortReject: <T>(promise: Promise<T>) => {
|
|
5
|
+
recover: () => Promise<T>;
|
|
6
|
+
};
|
|
@@ -7,8 +7,30 @@ const logNoneManualAbortError = (e) => {
|
|
|
7
7
|
if (e !== MANUAL_ABORT_MESSAGE)
|
|
8
8
|
console.error(e);
|
|
9
9
|
};
|
|
10
|
+
function recoverablyIgnoreReject(promise, ignoreFilter) {
|
|
11
|
+
let isValid = true;
|
|
12
|
+
let error;
|
|
13
|
+
const ignoredPromise = promise.catch((err) => {
|
|
14
|
+
if (!isValid || !ignoreFilter(err))
|
|
15
|
+
throw err;
|
|
16
|
+
isValid = false;
|
|
17
|
+
error = err;
|
|
18
|
+
return void 0;
|
|
19
|
+
});
|
|
20
|
+
const recover = () => {
|
|
21
|
+
if (!isValid)
|
|
22
|
+
return Promise.reject(error);
|
|
23
|
+
isValid = false;
|
|
24
|
+
return ignoredPromise;
|
|
25
|
+
};
|
|
26
|
+
return { recover };
|
|
27
|
+
}
|
|
28
|
+
const recoverablyIgnoreManualAbortReject = (promise) => {
|
|
29
|
+
return recoverablyIgnoreReject(promise, (e) => e === MANUAL_ABORT_MESSAGE);
|
|
30
|
+
};
|
|
10
31
|
export {
|
|
11
32
|
MANUAL_ABORT_MESSAGE,
|
|
12
33
|
logNoneManualAbortError,
|
|
34
|
+
recoverablyIgnoreManualAbortReject,
|
|
13
35
|
throwNoneManualAbortError
|
|
14
36
|
};
|
package/dist/v2/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.5.
|
|
3
|
+
const pkgVersion = "2.5.2";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createVNode } from "vue";
|
|
2
|
-
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
|
|
3
3
|
import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
|
|
4
4
|
import { defineSetup } from "../types/helper.js";
|
|
5
5
|
import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
|
|
@@ -27,7 +27,7 @@ import "../GreenZone/GreenZone.js";
|
|
|
27
27
|
import "../PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import "../PickupPoints/PickupPoints.js";
|
|
29
29
|
import "./useCacheCenterPlace.js";
|
|
30
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
30
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
|
|
31
31
|
export {
|
|
32
32
|
B as BusinessRecomendPlaceMap,
|
|
33
33
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
1
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BusinessRecomendPlaceMap,
|
|
4
4
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -21,7 +21,7 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
|
|
|
21
21
|
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
|
|
22
22
|
import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
|
|
23
23
|
import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
24
|
-
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.
|
|
24
|
+
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
|
|
25
25
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
26
26
|
import { GreenZone } from "../GreenZone/GreenZone.js";
|
|
27
27
|
import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
|
|
@@ -227,6 +227,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
227
227
|
place,
|
|
228
228
|
inputPlace,
|
|
229
229
|
type,
|
|
230
|
+
zone,
|
|
230
231
|
isSameZone
|
|
231
232
|
}) => {
|
|
232
233
|
var _a;
|
|
@@ -236,12 +237,13 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
236
237
|
equalAssign(centerPlace, {
|
|
237
238
|
...place
|
|
238
239
|
});
|
|
239
|
-
if (type === "Restricted" && !isSameZone)
|
|
240
|
+
if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
|
|
240
241
|
setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path);
|
|
241
242
|
emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
|
|
242
243
|
place,
|
|
243
244
|
inputPlace,
|
|
244
245
|
type,
|
|
246
|
+
zone,
|
|
245
247
|
isSameZone
|
|
246
248
|
}));
|
|
247
249
|
}
|
package/dist/v3/chunks/{BusinessRecomendPlaceMap.4c38b1fb.js → BusinessRecomendPlaceMap.d14dbe4e.js}
RENAMED
|
@@ -511,7 +511,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
511
511
|
equalAssign(centerPlace, {
|
|
512
512
|
...place
|
|
513
513
|
});
|
|
514
|
-
if (type === "Restricted" && !isSameZone)
|
|
514
|
+
if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
|
|
515
515
|
setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path, place2point(place));
|
|
516
516
|
emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
|
|
517
517
|
place,
|
|
@@ -41,6 +41,7 @@ const useAmapPlace = (props) => {
|
|
|
41
41
|
const pipeTw = createPipeTw(language === "zh-TW");
|
|
42
42
|
const isChina = inChina([lng, lat]);
|
|
43
43
|
geocoder.getAddress(new AMap.LngLat(lng, lat), (status, result) => {
|
|
44
|
+
clearTimeout(timer);
|
|
44
45
|
switch (status) {
|
|
45
46
|
case "complete": {
|
|
46
47
|
const { formattedAddress, addressComponent } = result.regeocode;
|
|
@@ -59,7 +60,7 @@ const useAmapPlace = (props) => {
|
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
}, handleFailed);
|
|
62
|
-
setTimeout(() => {
|
|
63
|
+
const timer = setTimeout(() => {
|
|
63
64
|
console.warn("高德逆地理请求超时!");
|
|
64
65
|
handleFailed();
|
|
65
66
|
}, REGEO_TIMEOUT);
|
|
@@ -112,13 +113,13 @@ const useGmapPlace = (props) => {
|
|
|
112
113
|
readyPromise.then(() => {
|
|
113
114
|
const geocoder = new google.maps.Geocoder();
|
|
114
115
|
const pipeTw = createPipeTw(language === "zh-TW");
|
|
115
|
-
geocoder.geocode({ language, location: { lng, lat } }).then(({ results }) => {
|
|
116
|
+
geocoder.geocode({ language, location: { lng, lat } }).finally(() => clearTimeout(timer)).then(({ results }) => {
|
|
116
117
|
const name = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
|
|
117
118
|
const displayName = gmapPlaceName2DisplayName(name, results[0].address_components);
|
|
118
119
|
resolve({ lng, lat, name: pipeTw(name), displayName: pipeTw(displayName) });
|
|
119
120
|
}).catch(handleFailed);
|
|
120
121
|
}, handleFailed);
|
|
121
|
-
setTimeout(() => {
|
|
122
|
+
const timer = setTimeout(() => {
|
|
122
123
|
console.warn("谷歌逆地理请求超时!");
|
|
123
124
|
handleFailed();
|
|
124
125
|
}, REGEO_TIMEOUT);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, reactive } from "vue-demi";
|
|
2
2
|
import { GET_RECOMMEND_PLACE_TIMEOUT } from "../api/contants.js";
|
|
3
|
-
import { logNoneManualAbortError } from "../utils/ManualAbortError.js";
|
|
3
|
+
import { recoverablyIgnoreManualAbortReject, logNoneManualAbortError } from "../utils/ManualAbortError.js";
|
|
4
4
|
import { createAbortableOneConcurrent, AbortSignalAny, equalAssign, isPlacesInclude, createAbortable } from "../utils/helper.js";
|
|
5
5
|
import { isZoneEqual, place2point, isPlaceEqual, businessCandidatesToAdsorptionPlace } from "../utils/transform.js";
|
|
6
6
|
import { assertNoConflictTypeAndZone } from "../utils/typeChecking.js";
|
|
@@ -103,7 +103,9 @@ const useMapRecomendPlace = (props) => {
|
|
|
103
103
|
const [lng, lat] = point;
|
|
104
104
|
const { type, zone, available, candidates } = prevState;
|
|
105
105
|
if (!zone || !apiLocalIsPointInRing(point, zone.path)) {
|
|
106
|
-
const
|
|
106
|
+
const reGeoPlacePromiseIgnored = recoverablyIgnoreManualAbortReject(
|
|
107
|
+
getPlaceByRegeo(point, opt)
|
|
108
|
+
);
|
|
107
109
|
const {
|
|
108
110
|
place: closestPlace,
|
|
109
111
|
candidates: candidates2,
|
|
@@ -114,7 +116,7 @@ const useMapRecomendPlace = (props) => {
|
|
|
114
116
|
if (isPlacesInclude(candidates2, closestPlace)) {
|
|
115
117
|
return { place: { ...closestPlace }, zone: zone2, available: available2, candidates: candidates2, type: type2 };
|
|
116
118
|
}
|
|
117
|
-
const regeoPlace = await
|
|
119
|
+
const regeoPlace = await reGeoPlacePromiseIgnored.recover();
|
|
118
120
|
return { place: { ...regeoPlace }, zone: zone2, available: available2, candidates: candidates2, type: type2 };
|
|
119
121
|
}
|
|
120
122
|
if (type === "Forbidden") {
|
|
@@ -12,7 +12,6 @@ const useMapAssertSupplier = () => {
|
|
|
12
12
|
const instanceSupplier = payload.supplier;
|
|
13
13
|
function assertSupplier(fn) {
|
|
14
14
|
return function fnWithAssertSupplier(...args) {
|
|
15
|
-
console.log("instanceSupplier, payload.supplier = ", instanceSupplier, payload.supplier);
|
|
16
15
|
if (instanceSupplier === payload.supplier)
|
|
17
16
|
return fn(...args);
|
|
18
17
|
throw Error(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { shallowRef } from "vue-demi";
|
|
2
2
|
import { watchPostEffectForDeepOption } from "../utils/compare.js";
|
|
3
3
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
4
|
+
const isIgnoredAmapWalkingRouteError = (err) => err === "RETURN_TIMEOUT";
|
|
4
5
|
const useAWalkingRoute = (props) => {
|
|
5
6
|
const pathRef = shallowRef([]);
|
|
6
7
|
const amapWalking = new AMap.Walking({});
|
|
@@ -30,6 +31,11 @@ const useAWalkingRoute = (props) => {
|
|
|
30
31
|
pathRef.value = [];
|
|
31
32
|
return;
|
|
32
33
|
default:
|
|
34
|
+
if (isIgnoredAmapWalkingRouteError(result)) {
|
|
35
|
+
console.warn(result);
|
|
36
|
+
pathRef.value = [];
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
33
39
|
throw result;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { reactive, ref, readonly } from "vue-demi";
|
|
2
|
-
import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
|
|
3
3
|
import { CenterPlaceStatus } from "../types/interface.js";
|
|
4
4
|
import { proxyFunctionalProperty, assertAssingedBeforeUsed } from "../utils/helper.js";
|
|
5
5
|
const useBusinessRecomendPlaceMap = () => {
|
package/dist/v3/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { isCoordinatePointEqual } from "./api/geometry.js";
|
|
|
3
3
|
import { AbsoluteAddressBox } from "./business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
4
4
|
import { AddressBox } from "./business-components/AddressBox/AddressBox.js";
|
|
5
5
|
import { BusinessQuotingMap } from "./business-components/BusinessQuotingMap/BusinessQuotingMap.js";
|
|
6
|
-
import { B } from "./chunks/BusinessRecomendPlaceMap.
|
|
6
|
+
import { B } from "./chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
|
|
7
7
|
import { BusinessReselectPlaceMap } from "./business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js";
|
|
8
8
|
import { BusinessTaxiEndMap } from "./business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
|
|
9
9
|
import { BusinessTaxiServiceMap } from "./business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare const MANUAL_ABORT_MESSAGE = "MANUAL_ABORT_MESSAGE";
|
|
2
2
|
export declare const throwNoneManualAbortError: (e: unknown) => void;
|
|
3
3
|
export declare const logNoneManualAbortError: (e: unknown) => void;
|
|
4
|
+
export declare const recoverablyIgnoreManualAbortReject: <T>(promise: Promise<T>) => {
|
|
5
|
+
recover: () => Promise<T>;
|
|
6
|
+
};
|
|
@@ -7,8 +7,30 @@ const logNoneManualAbortError = (e) => {
|
|
|
7
7
|
if (e !== MANUAL_ABORT_MESSAGE)
|
|
8
8
|
console.error(e);
|
|
9
9
|
};
|
|
10
|
+
function recoverablyIgnoreReject(promise, ignoreFilter) {
|
|
11
|
+
let isValid = true;
|
|
12
|
+
let error;
|
|
13
|
+
const ignoredPromise = promise.catch((err) => {
|
|
14
|
+
if (!isValid || !ignoreFilter(err))
|
|
15
|
+
throw err;
|
|
16
|
+
isValid = false;
|
|
17
|
+
error = err;
|
|
18
|
+
return void 0;
|
|
19
|
+
});
|
|
20
|
+
const recover = () => {
|
|
21
|
+
if (!isValid)
|
|
22
|
+
return Promise.reject(error);
|
|
23
|
+
isValid = false;
|
|
24
|
+
return ignoredPromise;
|
|
25
|
+
};
|
|
26
|
+
return { recover };
|
|
27
|
+
}
|
|
28
|
+
const recoverablyIgnoreManualAbortReject = (promise) => {
|
|
29
|
+
return recoverablyIgnoreReject(promise, (e) => e === MANUAL_ABORT_MESSAGE);
|
|
30
|
+
};
|
|
10
31
|
export {
|
|
11
32
|
MANUAL_ABORT_MESSAGE,
|
|
12
33
|
logNoneManualAbortError,
|
|
34
|
+
recoverablyIgnoreManualAbortReject,
|
|
13
35
|
throwNoneManualAbortError
|
|
14
36
|
};
|
package/dist/v3/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.5.
|
|
3
|
+
const pkgVersion = "2.5.2";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|