@heycar/heycars-map 2.13.0-relay1 → 2.14.0-walkOptimize1
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 +35 -0
- package/dist/v2/api/cdn.d.ts +1 -2
- package/dist/v2/api/cdn.js +1 -3
- package/dist/v2/api/contants.d.ts +3 -0
- package/dist/v2/api/contants.js +6 -0
- package/dist/v2/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +7 -1
- package/dist/v2/business-components/AuxiliaryPassanger/AuxiliaryPassanger.d.ts +6 -0
- package/dist/v2/business-components/AuxiliaryPassanger/AuxiliaryPassanger.js +50 -0
- package/dist/v2/business-components/AuxiliaryPassanger/index.d.ts +1 -0
- package/dist/v2/business-components/AuxiliaryPassanger/index.js +4 -0
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +6 -0
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +1 -3
- package/dist/v2/business-components/StartEndPoint/StartEndPoint.d.ts +4 -1
- package/dist/v2/business-components/StartEndPoint/StartEndPoint.js +20 -5
- package/dist/v2/business-components/TaxiCar/TaxiCar.d.ts +1 -0
- package/dist/v2/business-components/TaxiCar/TaxiCar.js +16 -5
- package/dist/v2/chunks/{Loading.96f573fe.js → Loading.70dfc720.js} +7 -1
- package/dist/v2/components/Loading/Loading.d.ts +1 -0
- package/dist/v2/components/Loading/Loading.js +2 -1
- package/dist/v2/components/Loading/index.js +1 -1
- package/dist/v2/components/MapProvider/MapProvider.js +1 -1
- package/dist/v2/hooks/useMapGeometry.d.ts +3 -3
- package/dist/v2/hooks/useMapGeometry.js +3 -3
- package/dist/v2/hooks/useWalkingRoute.js +46 -4
- package/dist/v2/types/interface.d.ts +7 -0
- package/dist/v2/utils/geometry.d.ts +1 -0
- package/dist/v2/utils/geometry.js +4 -2
- package/dist/v2/utils/geometryPolygon.d.ts +5 -0
- package/dist/v2/utils/geometryPolygon.js +27 -0
- package/dist/v2/utils/log.js +11 -3
- package/dist/v2/utils/ttlCache.d.ts +34 -0
- package/dist/v2/utils/ttlCache.js +64 -0
- package/dist/v3/api/cdn.d.ts +1 -2
- package/dist/v3/api/cdn.js +1 -3
- package/dist/v3/api/contants.d.ts +3 -0
- package/dist/v3/api/contants.js +6 -0
- package/dist/v3/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +7 -1
- package/dist/v3/business-components/AuxiliaryPassanger/AuxiliaryPassanger.d.ts +8 -0
- package/dist/v3/business-components/AuxiliaryPassanger/AuxiliaryPassanger.js +46 -0
- package/dist/v3/business-components/AuxiliaryPassanger/index.d.ts +1 -0
- package/dist/v3/business-components/AuxiliaryPassanger/index.js +4 -0
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +4 -0
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +1 -3
- package/dist/v3/business-components/StartEndPoint/StartEndPoint.d.ts +4 -1
- package/dist/v3/business-components/StartEndPoint/StartEndPoint.js +20 -5
- package/dist/v3/business-components/TaxiCar/TaxiCar.d.ts +1 -0
- package/dist/v3/business-components/TaxiCar/TaxiCar.js +16 -5
- package/dist/v3/chunks/{Loading.8c26ab6c.js → Loading.4c949ec9.js} +7 -1
- package/dist/v3/components/Loading/Loading.d.ts +1 -0
- package/dist/v3/components/Loading/Loading.js +2 -1
- package/dist/v3/components/Loading/index.js +1 -1
- package/dist/v3/components/MapProvider/MapProvider.js +1 -1
- package/dist/v3/hooks/useMapGeometry.d.ts +3 -3
- package/dist/v3/hooks/useMapGeometry.js +3 -3
- package/dist/v3/hooks/useWalkingRoute.js +46 -4
- package/dist/v3/types/interface.d.ts +7 -0
- package/dist/v3/utils/geometry.d.ts +1 -0
- package/dist/v3/utils/geometry.js +4 -2
- package/dist/v3/utils/geometryPolygon.d.ts +5 -0
- package/dist/v3/utils/geometryPolygon.js +27 -0
- package/dist/v3/utils/log.js +11 -3
- package/dist/v3/utils/ttlCache.d.ts +34 -0
- package/dist/v3/utils/ttlCache.js +64 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ body {
|
|
|
50
50
|
--HEYCAR_MAP_SVG_VAR_end-point_linearGradient_stop_2_color: #ff4040;
|
|
51
51
|
--HEYCAR_MAP_SVG_VAR_end-point_linearGradient_stop_3_color: #ff4040;
|
|
52
52
|
--HEYCAR_MAP_SVG_VAR_end-point_path_fill: rgba(0, 0, 0, 0.5);
|
|
53
|
+
--HEYCAR_MAP_SVG_VAR_waypoint_path_fill: #ff4040;
|
|
53
54
|
--HEYCAR_MAP_SVG_VAR_passenger-circle_circle_fill: #1e1e1e;
|
|
54
55
|
--HEYCAR_MAP_SVG_VAR_passenger-circle_outerCircle_fill: #4471ff;
|
|
55
56
|
--HEYCAR_MAP_SVG_VAR_passenger-circle_outerCircle_stroke: #003dff;
|
|
@@ -151,6 +152,31 @@ export interface BusinessGeolocationPositionError extends GeolocationPositionErr
|
|
|
151
152
|
|
|
152
153
|
// Restricted(绿区)Forbidden(红区)Recommend(推荐点)
|
|
153
154
|
export type RecommendType = "Restricted" | "Forbidden" | "Recommend";
|
|
155
|
+
|
|
156
|
+
export type DriverStatus =
|
|
157
|
+
| "dispatching"
|
|
158
|
+
| "book-dispatching"
|
|
159
|
+
| "dispatched"
|
|
160
|
+
| "driverStartService"
|
|
161
|
+
| "driverStartRelayService"
|
|
162
|
+
| "book-driverStartService"
|
|
163
|
+
| "book-dispatched"
|
|
164
|
+
| "driverArrived"
|
|
165
|
+
| "inService"
|
|
166
|
+
| "canceled"
|
|
167
|
+
| "endService"
|
|
168
|
+
| "completed"
|
|
169
|
+
| "canceling"
|
|
170
|
+
| "banlanceRefund"
|
|
171
|
+
| "waitBanlanceRefund"
|
|
172
|
+
| "rechargePayed"
|
|
173
|
+
| "waitRechargePay"
|
|
174
|
+
| "payed"
|
|
175
|
+
| "waitpay"
|
|
176
|
+
| "refund"
|
|
177
|
+
| "confirmed"
|
|
178
|
+
| "assign"
|
|
179
|
+
| "orderReassigned";
|
|
154
180
|
```
|
|
155
181
|
|
|
156
182
|
#### 在 入口文件添加 `MapProvider`
|
|
@@ -200,6 +226,15 @@ export type RecommendType = "Restricted" | "Forbidden" | "Recommend";
|
|
|
200
226
|
// ZONE_RESTRICTED_BORDER_COLOR: "#1E1E1E",
|
|
201
227
|
// ZONE_FORBIDDEN_BACKGROUND_COLOR: "#F27878",
|
|
202
228
|
// ZONE_FORBIDDEN_BORDER_COLOR: "#F41717",
|
|
229
|
+
//
|
|
230
|
+
// 支付宝迁移主题-图标
|
|
231
|
+
// ICON_START_POINT_EN_URL: "https://<支付宝oss域名>/heycar-map/svg/0.12/start-point-en.svg";
|
|
232
|
+
// ICON_END_POINT_EN_URL: "https://<支付宝oss域名>/heycar-map/svg/0.12/end-point-en.svg";
|
|
233
|
+
// ICON_END_POINT_ZH_TW_URL: "https://<支付宝oss域名>/heycar-map/svg/0.12/end-point-zh-TW.svg";
|
|
234
|
+
// ICON_TAXI_CAR_URL: "https://<支付宝oss域名>/heycar-map/svg/taxi-car.svg";
|
|
235
|
+
// ICON_DOT_LOADING_URL: "https://<支付宝oss域名>/heycar-map/gif/dot-loading.gif";
|
|
236
|
+
// ICON_LOAD_FAILED_URL: "https://<支付宝oss域名>/heycar-map/svg/load-failed.svg";
|
|
237
|
+
// ICON_WAYPOINT_URL: "https://<支付宝oss域名>/heycar-map/svg/0.12/waypoint.svg";
|
|
203
238
|
}
|
|
204
239
|
}
|
|
205
240
|
// 地图加载失败时显示的标题
|
package/dist/v2/api/cdn.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare const AMAP_DEFAULT_MARKER_ICON_URL = "https://webapi.amap.com/theme/v1.3/markers/b/mark_bs.png";
|
|
2
|
-
export declare const ICON_FULL_SCREEN_URL = "https://overseas-oss.heycars.cn/heycar-map/png/fullscreen.png";
|
|
3
2
|
export declare const ICON_START_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/start-point-en.svg";
|
|
4
3
|
export declare const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/end-point-en.svg";
|
|
5
4
|
export declare const ICON_END_POINT_ZH_TW_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/end-point-zh-TW.svg";
|
|
6
5
|
export declare const ICON_TAXI_CAR_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/taxi-car.svg";
|
|
7
6
|
export declare const ICON_DOT_LOADING_URL = "https://overseas-oss.heycars.cn/heycar-map/gif/dot-loading.gif";
|
|
8
7
|
export declare const ICON_LOAD_FAILED_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/load-failed.svg";
|
|
9
|
-
export declare const ICON_WAYPOINT_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/waypoint.svg";
|
|
8
|
+
export declare const ICON_WAYPOINT_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/waypoint.svg";
|
package/dist/v2/api/cdn.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
const AMAP_DEFAULT_MARKER_ICON_URL = "https://webapi.amap.com/theme/v1.3/markers/b/mark_bs.png";
|
|
2
|
-
const ICON_FULL_SCREEN_URL = "https://overseas-oss.heycars.cn/heycar-map/png/fullscreen.png";
|
|
3
2
|
const ICON_START_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/start-point-en.svg";
|
|
4
3
|
const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/end-point-en.svg";
|
|
5
4
|
const ICON_END_POINT_ZH_TW_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/end-point-zh-TW.svg";
|
|
6
5
|
const ICON_TAXI_CAR_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/taxi-car.svg";
|
|
7
6
|
const ICON_DOT_LOADING_URL = "https://overseas-oss.heycars.cn/heycar-map/gif/dot-loading.gif";
|
|
8
7
|
const ICON_LOAD_FAILED_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/load-failed.svg";
|
|
9
|
-
const ICON_WAYPOINT_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/waypoint.svg";
|
|
8
|
+
const ICON_WAYPOINT_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/0.12/waypoint.svg";
|
|
10
9
|
export {
|
|
11
10
|
AMAP_DEFAULT_MARKER_ICON_URL,
|
|
12
11
|
ICON_DOT_LOADING_URL,
|
|
13
12
|
ICON_END_POINT_EN_URL,
|
|
14
13
|
ICON_END_POINT_ZH_TW_URL,
|
|
15
|
-
ICON_FULL_SCREEN_URL,
|
|
16
14
|
ICON_LOAD_FAILED_URL,
|
|
17
15
|
ICON_START_POINT_EN_URL,
|
|
18
16
|
ICON_TAXI_CAR_URL,
|
|
@@ -5,7 +5,10 @@ export declare const ANIMATION_DURATION_FOR_100VW = 100;
|
|
|
5
5
|
export declare const ANIMATION_DURATION_PER_ZOOM = 200;
|
|
6
6
|
export declare const BEIJIN_POINT: Point;
|
|
7
7
|
export declare const MAX_DEVIATION_DISTANCE = 30;
|
|
8
|
+
export declare const MAX_DEVIATION_DISTANCE_WALKING = 5;
|
|
8
9
|
export declare const CAR_DISTANCE_MIN = 20;
|
|
10
|
+
export declare const PASSENGER_DISTANCE_MAX = 2000;
|
|
11
|
+
export declare const PASSENGER_DISTANCE_MIN = 20;
|
|
9
12
|
export declare const ZINDEX_BUBBLE_LAYER = 50;
|
|
10
13
|
export declare const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
11
14
|
export declare const ZINDEX_PLACE_LAYER = 30;
|
package/dist/v2/api/contants.js
CHANGED
|
@@ -4,7 +4,10 @@ const ANIMATION_DURATION_FOR_100VW = 100;
|
|
|
4
4
|
const ANIMATION_DURATION_PER_ZOOM = 200;
|
|
5
5
|
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
6
6
|
const MAX_DEVIATION_DISTANCE = 30;
|
|
7
|
+
const MAX_DEVIATION_DISTANCE_WALKING = 5;
|
|
7
8
|
const CAR_DISTANCE_MIN = 20;
|
|
9
|
+
const PASSENGER_DISTANCE_MAX = 2e3;
|
|
10
|
+
const PASSENGER_DISTANCE_MIN = 20;
|
|
8
11
|
const ZINDEX_BUBBLE_LAYER = 50;
|
|
9
12
|
const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
10
13
|
const ZINDEX_PLACE_LAYER = 30;
|
|
@@ -30,7 +33,10 @@ export {
|
|
|
30
33
|
GET_RECOMMEND_PLACE_TIMEOUT,
|
|
31
34
|
MAX_ANIMATION_DISTANCE_VW,
|
|
32
35
|
MAX_DEVIATION_DISTANCE,
|
|
36
|
+
MAX_DEVIATION_DISTANCE_WALKING,
|
|
33
37
|
MIN_ANIMATION_DURATION,
|
|
38
|
+
PASSENGER_DISTANCE_MAX,
|
|
39
|
+
PASSENGER_DISTANCE_MIN,
|
|
34
40
|
REGEO_TIMEOUT,
|
|
35
41
|
TRACKS_MATCH_MAX_LENGTH,
|
|
36
42
|
ZINDEX_AUXILIARY_GRASP,
|
|
@@ -5,6 +5,7 @@ import { ICON_DOT_LOADING_URL } from "../../api/cdn.js";
|
|
|
5
5
|
import { i as imgAddressLocator } from "../../chunks/address-locator.4acf83cd.js";
|
|
6
6
|
import { i as imgArrowRight } from "../../chunks/arrow-right.2c34874e.js";
|
|
7
7
|
import { SvgInlineWebComponentTag } from "../../components/SvgInline/SvgInline.web-component.js";
|
|
8
|
+
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
8
9
|
import { defineSetup } from "../../types/helper.js";
|
|
9
10
|
import { c as createRuntimeFn } from "../../chunks/vanilla-extract-recipes-createRuntimeFn.esm.bd6fc290.js";
|
|
10
11
|
const imgBubbleRightArc = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiIHZpZXdCb3g9IjAgMCAxOCAzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDIuMTMxYTEwIDEwIDAgMDE5LjY5NiA3LjU1MkwxOCAzMkguMDQyTDAgMHoiIGZpbGw9InZhcigtLUhFWUNBUl9NQVBfQ1NTX1ZBUl9BYnNvbHV0ZUFkZHJlc3NCb3hfYm94SGVhZGVyX2JhY2tncm91bmQsICMyNTNFN0EpIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=";
|
|
@@ -42,8 +43,13 @@ const MultilineTitle = defineSetup("MultilineTitle", function(props, {
|
|
|
42
43
|
const AbsoluteAddressBox = defineSetup("AbsoluteAddressBox", function(props, {
|
|
43
44
|
emit
|
|
44
45
|
}) {
|
|
46
|
+
var _a;
|
|
45
47
|
const handleClickText = () => emit("clickText");
|
|
46
48
|
const handleClickPhoto = () => emit("clickPhoto");
|
|
49
|
+
const {
|
|
50
|
+
themeVariables
|
|
51
|
+
} = useMapSupplier();
|
|
52
|
+
const iconLoading = (_a = themeVariables == null ? void 0 : themeVariables.ICON_DOT_LOADING_URL) != null ? _a : ICON_DOT_LOADING_URL;
|
|
47
53
|
return () => {
|
|
48
54
|
const {
|
|
49
55
|
type,
|
|
@@ -72,7 +78,7 @@ const AbsoluteAddressBox = defineSetup("AbsoluteAddressBox", function(props, {
|
|
|
72
78
|
}, [h("img", {
|
|
73
79
|
"class": imgDotLoading,
|
|
74
80
|
"attrs": {
|
|
75
|
-
"src":
|
|
81
|
+
"src": iconLoading
|
|
76
82
|
}
|
|
77
83
|
})]), h("i", {
|
|
78
84
|
"class": straightLine
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DriverStatus, Point } from "../../types/interface";
|
|
2
|
+
export interface AuxiliaryPassangerProps {
|
|
3
|
+
status: DriverStatus;
|
|
4
|
+
passengerPosition?: Point;
|
|
5
|
+
}
|
|
6
|
+
export declare const AuxiliaryPassanger: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<AuxiliaryPassangerProps>, 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<AuxiliaryPassangerProps, Required<AuxiliaryPassangerProps>>, never, AuxiliaryPassangerProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { h } from "vue";
|
|
2
|
+
import { ref } from "vue-demi";
|
|
3
|
+
import { MAX_DEVIATION_DISTANCE_WALKING } from "../../api/contants.js";
|
|
4
|
+
import { defineSetup } from "../../types/helper.js";
|
|
5
|
+
import { watchEffectForDeepOption } from "../../utils/compare.js";
|
|
6
|
+
import { AuxiliaryCircle } from "../AuxiliaryCircle/AuxiliaryCircle.js";
|
|
7
|
+
import { AuxiliaryLine } from "../AuxiliaryLine/AuxiliaryLine.js";
|
|
8
|
+
const usePositionHistory = (source, capacity) => {
|
|
9
|
+
const history = ref([]);
|
|
10
|
+
watchEffectForDeepOption(source, (point) => {
|
|
11
|
+
if (!point)
|
|
12
|
+
return;
|
|
13
|
+
history.value.push([...point]);
|
|
14
|
+
if (history.value.length > capacity) {
|
|
15
|
+
history.value.shift();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return history;
|
|
19
|
+
};
|
|
20
|
+
const AuxiliaryPassanger = defineSetup("AuxiliaryPassanger", function(props) {
|
|
21
|
+
const passengerPositionHistory = usePositionHistory(() => props.passengerPosition, 20);
|
|
22
|
+
return () => {
|
|
23
|
+
const {
|
|
24
|
+
status,
|
|
25
|
+
passengerPosition
|
|
26
|
+
} = props;
|
|
27
|
+
console.log("passengerPositionHistory = ", passengerPositionHistory.value);
|
|
28
|
+
const prevPositions = passengerPositionHistory.value.slice(0, -1);
|
|
29
|
+
if (status !== "assign" && status !== "confirmed" && status !== "driverStartRelayService" && status !== "dispatched" && status !== "driverStartService" && status !== "book-driverStartService" && status !== "book-dispatched" && status !== "driverArrived")
|
|
30
|
+
return;
|
|
31
|
+
return h("div", [!!passengerPosition && h(AuxiliaryCircle, {
|
|
32
|
+
"attrs": {
|
|
33
|
+
"center": passengerPosition,
|
|
34
|
+
"radius": MAX_DEVIATION_DISTANCE_WALKING,
|
|
35
|
+
"opacity": 0.2
|
|
36
|
+
}
|
|
37
|
+
}), prevPositions.length > 0 && h(AuxiliaryLine, {
|
|
38
|
+
"attrs": {
|
|
39
|
+
"path": prevPositions,
|
|
40
|
+
"type": "circle",
|
|
41
|
+
"color": "purple",
|
|
42
|
+
"scale": MAX_DEVIATION_DISTANCE_WALKING,
|
|
43
|
+
"opacity": 0.2
|
|
44
|
+
}
|
|
45
|
+
})]);
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
AuxiliaryPassanger
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AuxiliaryPassanger";
|
|
@@ -14,6 +14,7 @@ import { createAbortable, assertNotEmptyArray } from "../../utils/helper.js";
|
|
|
14
14
|
import { place2point, pipeDefer, lnglat2point } from "../../utils/transform.js";
|
|
15
15
|
import { toCoordinatePlaceType, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
|
|
16
16
|
import { AuxiliaryGraspRoad } from "../AuxiliaryGraspRoad/AuxiliaryGraspRoad.js";
|
|
17
|
+
import { AuxiliaryPassanger } from "../AuxiliaryPassanger/AuxiliaryPassanger.js";
|
|
17
18
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
18
19
|
import { SectionDispatching, SectionConfirmed, SectionDriverStartRelayService, SectionDriverStartService, SectionBookDispatched, SectionInService, SectionDriverArrived, SectionCanceled, SectionEndService } from "./BusinessTaxiServiceSection.js";
|
|
19
20
|
const STATUS_NEED_CAR_POSITION = ["book-driverStartService", "dispatched", "driverStartService", "driverStartRelayService", "inService", "driverArrived"];
|
|
@@ -247,6 +248,11 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
247
248
|
"from": from,
|
|
248
249
|
"to": to
|
|
249
250
|
}
|
|
251
|
+
}), IS_ENABLE_AUXILIARY_GRASP_ROAD && h(AuxiliaryPassanger, {
|
|
252
|
+
"attrs": {
|
|
253
|
+
"status": driverStatus,
|
|
254
|
+
"passengerPosition": passengerPosition
|
|
255
|
+
}
|
|
250
256
|
})]);
|
|
251
257
|
};
|
|
252
258
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
2
|
import { apiGetAuxiliaryGrapStatus } from "../../api/browser.js";
|
|
3
|
-
import { MAX_DEVIATION_DISTANCE, CAR_DISTANCE_MIN } from "../../api/contants.js";
|
|
3
|
+
import { PASSENGER_DISTANCE_MAX, MAX_DEVIATION_DISTANCE, PASSENGER_DISTANCE_MIN, CAR_DISTANCE_MIN } from "../../api/contants.js";
|
|
4
4
|
import { useMapGeometry } from "../../hooks/useMapGeometry.js";
|
|
5
5
|
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
6
6
|
import { defineSetup } from "../../types/helper.js";
|
|
@@ -19,8 +19,6 @@ import { WalkingLine } from "../WalkingLine/WalkingLine.js";
|
|
|
19
19
|
import { WalkingRoute } from "../WalkingRoute/WalkingRoute.js";
|
|
20
20
|
import { WaveCircle } from "../WaveCircle/WaveCircle.js";
|
|
21
21
|
const IS_ENABLE_AUXILIARY_GRASP_ROAD = apiGetAuxiliaryGrapStatus();
|
|
22
|
-
const PASSENGER_DISTANCE_MAX = 2e3;
|
|
23
|
-
const PASSENGER_DISTANCE_MIN = 20;
|
|
24
22
|
const AUTO_FIT_VIEW_INTERVAL = IS_ENABLE_AUXILIARY_GRASP_ROAD ? 24 * 3600 * 1e3 : 15e3;
|
|
25
23
|
const carDurationWithinMinDistance = (distance) => Math.floor(distance / 5);
|
|
26
24
|
const SectionDispatching = defineSetup("SectionDispatching", function(props) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
2
|
-
import type { Language, Point } from "../../types/interface";
|
|
2
|
+
import type { Language, MapThemeVariables, Point } from "../../types/interface";
|
|
3
|
+
type StartEndPointIcons = Pick<MapThemeVariables, "ICON_START_POINT_EN_URL" | "ICON_END_POINT_EN_URL" | "ICON_END_POINT_ZH_TW_URL" | "ICON_WAYPOINT_URL">;
|
|
3
4
|
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
|
|
4
5
|
language: Language;
|
|
5
6
|
type: "start" | "end" | "waypoint";
|
|
@@ -7,6 +8,7 @@ export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
|
|
|
7
8
|
title?: string;
|
|
8
9
|
description?: string;
|
|
9
10
|
withArrow?: boolean;
|
|
11
|
+
icons?: StartEndPointIcons;
|
|
10
12
|
onClick?: (value: Point) => void;
|
|
11
13
|
}
|
|
12
14
|
export declare const AStartEndPoint: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<StartEndPointProps<{
|
|
@@ -18916,3 +18918,4 @@ export declare const StartEndPoint: import("vue-demi").DefineComponent<import("v
|
|
|
18916
18918
|
emit(type: AMap.EventType, data?: any): any;
|
|
18917
18919
|
getEvents(): Record<string, any[]>;
|
|
18918
18920
|
}) & GmapOverlay>>;
|
|
18921
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
2
|
import { computed } from "vue-demi";
|
|
3
|
-
import {
|
|
3
|
+
import { ICON_START_POINT_EN_URL, ICON_END_POINT_EN_URL, ICON_END_POINT_ZH_TW_URL, ICON_WAYPOINT_URL } from "../../api/cdn.js";
|
|
4
4
|
import { ZINDEX_START_END_LOGO_LAYER } from "../../api/contants.js";
|
|
5
5
|
import { i as imgArrowRight } from "../../chunks/arrow-right.2c34874e.js";
|
|
6
6
|
import { AmapMarker } from "../../components/AmapMarker/AmapMarker.js";
|
|
@@ -10,10 +10,16 @@ import { createElement } from "../../demi-polyfill/demi-polyfill.js";
|
|
|
10
10
|
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
11
11
|
import { defineSetup } from "../../types/helper.js";
|
|
12
12
|
import { createDom } from "../../utils/dom.js";
|
|
13
|
-
import { decodeAsterisk, vec2lnglat } from "../../utils/transform.js";
|
|
13
|
+
import { mergeDefaultProps, decodeAsterisk, vec2lnglat } from "../../utils/transform.js";
|
|
14
14
|
import { p as pointInfoBoxEmphasize, a as pointIcon, b as pointLayout, c as pointSingleInfoBox, d as pointInfoBoxTitle, t as textLayout, e as arrowRight, f as pointInfoBox, g as pointInfoBoxDescription } from "../../chunks/StartEndPoint.css.4d9c0791.js";
|
|
15
15
|
const imgEndPoint = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiIHZpZXdCb3g9IjAgMCAyNCAzMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgeDE9IjcyLjMzOSUiIHkxPSI1MCUiIHgyPSIwJSIgeTI9IjUwJSIgaWQ9ImVuZC1wb2ludF9wcmVmaXhfX2EiPjxzdG9wIHN0b3AtY29sb3I9InZhcigtLUhFWUNBUl9NQVBfU1ZHX1ZBUl9lbmQtcG9pbnRfbGluZWFyR3JhZGllbnRfc3RvcF8xX2NvbG9yLCAjRkY4NDQ3KSIgb2Zmc2V0PSIwJSIvPjxzdG9wIHN0b3AtY29sb3I9InZhcigtLUhFWUNBUl9NQVBfU1ZHX1ZBUl9lbmQtcG9pbnRfbGluZWFyR3JhZGllbnRfc3RvcF8yX2NvbG9yLCAjRkY4QjRBKSIgb2Zmc2V0PSI1MC41OTYlIi8+PHN0b3Agc3RvcC1jb2xvcj0idmFyKC0tSEVZQ0FSX01BUF9TVkdfVkFSX2VuZC1wb2ludF9saW5lYXJHcmFkaWVudF9zdG9wXzNfY29sb3IsICNGRkE5NUEpIiBvZmZzZXQ9IjEwMCUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiAzMC4yMTVjMi4xMzQgMCAzLjg2My0uODkzIDMuODYzLTEuOTk1IDAtMS4xLTEuNzMtMS45OTQtMy44NjMtMS45OTQtMi4xMzQgMC0zLjg2My44OTMtMy44NjMgMS45OTQgMCAxLjEwMiAxLjczIDEuOTk1IDMuODYzIDEuOTk1eiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0idmFyKC0tSEVZQ0FSX01BUF9TVkdfVkFSX2VuZC1wb2ludF9wYXRoX2ZpbGwsICM0MzQ4NUEpIi8+PHBhdGggZD0iTTExIDI3LjAwNmMyLjEyOCAwLS45LTMuNzQzIDUuNjIxLTYuNjQzQzE5Ljg0MiAxOC40NTMgMjIgMTQuOTUzIDIyIDEwLjk1IDIyIDQuOTAyIDE3LjA3NSAwIDExIDBTMCA0LjkwMiAwIDEwLjk1YzAgMy45MTggMi4wNjggNy4zNTYgNS4xNzcgOS4yOUMxMS43NSAyMy4yODQgOS4wNiAyNy4wMDcgMTEgMjcuMDA3eiIgc3Ryb2tlPSIjRkZGIiBmaWxsPSJ1cmwoI2VuZC1wb2ludF9wcmVmaXhfX2EpIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSIvPjx0ZXh0IGZvbnQtZmFtaWx5PSJQaW5nRmFuZ1NDLVNlbWlib2xkLCBQaW5nRmFuZyBTQyIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9IjUwMCIgZmlsbD0iI0ZGRiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxLjIxNSkiPjx0c3BhbiB4PSI1IiB5PSIxNS40NDkiPue7iDwvdHNwYW4+PC90ZXh0PjwvZz48L3N2Zz4=";
|
|
16
16
|
const imgStartPoint = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiIHZpZXdCb3g9IjAgMCAyNCAzMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgeDE9IjAlIiB5MT0iNTAlIiB4Mj0iMTI5LjU5OSUiIHkyPSI1MCUiIGlkPSJzdGFydC1wb2ludF9wcmVmaXhfX2EiPjxzdG9wIHN0b3AtY29sb3I9InZhcigtLUhFWUNBUl9NQVBfU1ZHX1ZBUl9zdGFydC1wb2ludF9saW5lYXJHcmFkaWVudF9zdG9wXzFfY29sb3IsICMzNkE4RkYpIiBvZmZzZXQ9IjAlIi8+PHN0b3Agc3RvcC1jb2xvcj0idmFyKC0tSEVZQ0FSX01BUF9TVkdfVkFSX3N0YXJ0LXBvaW50X2xpbmVhckdyYWRpZW50X3N0b3BfMl9jb2xvciwgIzQ4NzFGMSkiIG9mZnNldD0iMTAwJSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTEyIDMwLjIxNWMxLjk1IDAgMy41MzItLjgxNiAzLjUzMi0xLjgyMyAwLTEuMDA3LTEuNTgxLTEuODIzLTMuNTMyLTEuODIzLTEuOTUgMC0zLjUzMi44MTYtMy41MzIgMS44MjMgMCAxLjAwNyAxLjU4MSAxLjgyMyAzLjUzMiAxLjgyM3oiIGZpbGwtb3BhY2l0eT0iLjUiIGZpbGw9InZhcigtLUhFWUNBUl9NQVBfU1ZHX1ZBUl9zdGFydC1wb2ludF9wYXRoX2ZpbGwsICM0MzQ4NUEpIi8+PHBhdGggZD0iTTExIDI3YzIuMTI4IDAtLjktMy43NDIgNS42MjEtNi42NDEgMy4yMjEtMS45MSA1LjM3OS01LjQxIDUuMzc5LTkuNDEyQzIyIDQuOTAxIDE3LjA3NSAwIDExIDBTMCA0LjkwMSAwIDEwLjk0N2MwIDMuOTE4IDIuMDY4IDcuMzU1IDUuMTc3IDkuMjlDMTEuNzUgMjMuMjc3IDkuMDYgMjcgMTEgMjd6IiBzdHJva2U9IiNGRkYiIGZpbGw9InVybCgjc3RhcnQtcG9pbnRfcHJlZml4X19hKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxLjIxNSkiLz48dGV4dCBmb250LWZhbWlseT0iUGluZ0ZhbmdTQy1TZW1pYm9sZCwgUGluZ0ZhbmcgU0MiIGZvbnQtc2l6ZT0iMTIiIGZvbnQtd2VpZ2h0PSI1MDAiIGZpbGw9IiNGRkYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMS4yMTUpIj48dHNwYW4geD0iNSIgeT0iMTUuNjI0Ij7otbc8L3RzcGFuPjwvdGV4dD48L2c+PC9zdmc+";
|
|
17
|
+
const defaultIcons = {
|
|
18
|
+
ICON_START_POINT_EN_URL,
|
|
19
|
+
ICON_END_POINT_EN_URL,
|
|
20
|
+
ICON_END_POINT_ZH_TW_URL,
|
|
21
|
+
ICON_WAYPOINT_URL
|
|
22
|
+
};
|
|
17
23
|
const AStartEndPoint = defineSetup("AStartEndPoint", function(props, {
|
|
18
24
|
emit
|
|
19
25
|
}) {
|
|
@@ -25,7 +31,8 @@ const AStartEndPoint = defineSetup("AStartEndPoint", function(props, {
|
|
|
25
31
|
type,
|
|
26
32
|
language
|
|
27
33
|
} = props;
|
|
28
|
-
const
|
|
34
|
+
const icons = mergeDefaultProps(defaultIcons, props.icons);
|
|
35
|
+
const icon = type === "waypoint" ? icons.ICON_WAYPOINT_URL : type === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : icons.ICON_START_POINT_EN_URL : language === "zh" ? imgEndPoint : language === "zh-TW" ? icons.ICON_END_POINT_ZH_TW_URL : icons.ICON_END_POINT_EN_URL;
|
|
29
36
|
const titleRow = !title ? "" : decodeAsterisk(title).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize}">${item.value}</span>`).join("");
|
|
30
37
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize}">${item.value}</span>`).join("");
|
|
31
38
|
if (!description && !title)
|
|
@@ -94,7 +101,8 @@ const GStartEndPoint = defineSetup("GStartEndPoint", function(props, {
|
|
|
94
101
|
type,
|
|
95
102
|
language = "zh"
|
|
96
103
|
} = props;
|
|
97
|
-
const
|
|
104
|
+
const icons = mergeDefaultProps(defaultIcons, props.icons);
|
|
105
|
+
const icon = type === "waypoint" ? icons.ICON_WAYPOINT_URL : type === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : icons.ICON_START_POINT_EN_URL : language === "zh" || language === "zh-TW" ? imgEndPoint : icons.ICON_END_POINT_EN_URL;
|
|
98
106
|
const titleRow = !title ? "" : decodeAsterisk(title).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize}">${item.value}</span>`).join("");
|
|
99
107
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize}">${item.value}</span>`).join("");
|
|
100
108
|
if (!description && !title)
|
|
@@ -161,8 +169,15 @@ const StartEndPoint = defineSetup("StartEndPoint", function(props, {
|
|
|
161
169
|
}) {
|
|
162
170
|
const payload = useMapSupplier();
|
|
163
171
|
return () => {
|
|
172
|
+
const icons = {
|
|
173
|
+
...payload.themeVariables,
|
|
174
|
+
...props.icons
|
|
175
|
+
};
|
|
164
176
|
return createElement(payload.supplier === "gmap" ? GStartEndPoint : AStartEndPoint, {
|
|
165
|
-
attrs:
|
|
177
|
+
attrs: {
|
|
178
|
+
...props,
|
|
179
|
+
icons
|
|
180
|
+
},
|
|
166
181
|
on: {
|
|
167
182
|
click: (value) => emit("click", value)
|
|
168
183
|
}
|
|
@@ -4,6 +4,7 @@ export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T> {
|
|
|
4
4
|
angle?: number;
|
|
5
5
|
title?: string;
|
|
6
6
|
opacity?: number;
|
|
7
|
+
icon?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const ATaxiCar: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<TaxiCarProps<{
|
|
9
10
|
_needUpdate: boolean;
|
|
@@ -19,11 +19,14 @@ var taxiCarTitle = "_65j3sr4";
|
|
|
19
19
|
const ATaxiCar = defineSetup("ATaxiCar", function(props) {
|
|
20
20
|
const contentRef = computed(() => {
|
|
21
21
|
var _a, _b;
|
|
22
|
+
const {
|
|
23
|
+
icon = ICON_TAXI_CAR_URL
|
|
24
|
+
} = props;
|
|
22
25
|
const titleRow = !props.title ? "" : decodeAsterisk(props.title).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize}">${item.value}</span>`).join("");
|
|
23
26
|
const carStyle = `transform:rotate(${(_a = props.angle) != null ? _a : 0}deg); opacity: ${(_b = props.opacity) != null ? _b : 1}`;
|
|
24
27
|
if (!props.title)
|
|
25
28
|
return {
|
|
26
|
-
img: `<img class="ATaxiCar ${carIcon}" src="${
|
|
29
|
+
img: `<img class="ATaxiCar ${carIcon}" src="${icon}" style="${carStyle}">`
|
|
27
30
|
};
|
|
28
31
|
const content = (hide$1) => `
|
|
29
32
|
<div class="ATaxiCar ${pointLayout}">
|
|
@@ -32,7 +35,7 @@ const ATaxiCar = defineSetup("ATaxiCar", function(props) {
|
|
|
32
35
|
})}">
|
|
33
36
|
<div class="${taxiCarTitle}">${titleRow}</div>
|
|
34
37
|
</div>
|
|
35
|
-
<img src="${
|
|
38
|
+
<img src="${icon}" class="${carIcon} ${hide({
|
|
36
39
|
hide: hide$1
|
|
37
40
|
})}" style="${carStyle}">
|
|
38
41
|
</div>
|
|
@@ -63,13 +66,16 @@ const ATaxiCar = defineSetup("ATaxiCar", function(props) {
|
|
|
63
66
|
const GTaxiCar = defineSetup("GTaxiCar", function(props) {
|
|
64
67
|
const contentRef = computed(() => {
|
|
65
68
|
var _a, _b;
|
|
69
|
+
const {
|
|
70
|
+
icon = ICON_TAXI_CAR_URL
|
|
71
|
+
} = props;
|
|
66
72
|
const titleRow = !props.title ? "" : decodeAsterisk(props.title).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize}">${item.value}</span>`).join("");
|
|
67
73
|
const carStyle = `transform:rotate(${(_a = props.angle) != null ? _a : 0}deg); opacity: ${(_b = props.opacity) != null ? _b : 1}`;
|
|
68
74
|
if (!props.title)
|
|
69
75
|
return {
|
|
70
76
|
img: createDom("img", {
|
|
71
77
|
class: `GTaxiCar ${carIcon}`,
|
|
72
|
-
src:
|
|
78
|
+
src: icon,
|
|
73
79
|
style: carStyle
|
|
74
80
|
})
|
|
75
81
|
};
|
|
@@ -81,7 +87,7 @@ const GTaxiCar = defineSetup("GTaxiCar", function(props) {
|
|
|
81
87
|
})}">
|
|
82
88
|
<div class="${taxiCarTitle}">${titleRow}</div>
|
|
83
89
|
</div>
|
|
84
|
-
<img src="${
|
|
90
|
+
<img src="${icon}" class="${carIcon} ${hide({
|
|
85
91
|
hide: hide$1
|
|
86
92
|
})}" style="${carStyle}">
|
|
87
93
|
`);
|
|
@@ -111,8 +117,13 @@ const GTaxiCar = defineSetup("GTaxiCar", function(props) {
|
|
|
111
117
|
const TaxiCar = defineSetup("TaxiCar", function(props) {
|
|
112
118
|
const payload = useMapSupplier();
|
|
113
119
|
return () => {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
const icon = (_b = (_a = payload.themeVariables) == null ? void 0 : _a.ICON_TAXI_CAR_URL) != null ? _b : props.icon;
|
|
114
122
|
return createElement(payload.supplier === "gmap" ? GTaxiCar : ATaxiCar, {
|
|
115
|
-
attrs:
|
|
123
|
+
attrs: {
|
|
124
|
+
...props,
|
|
125
|
+
icon
|
|
126
|
+
}
|
|
116
127
|
});
|
|
117
128
|
};
|
|
118
129
|
});
|
|
@@ -2,6 +2,7 @@ import "../css/Loading-49e58ced.css";
|
|
|
2
2
|
import { h } from "vue";
|
|
3
3
|
import { ICON_LOAD_FAILED_URL } from "../api/cdn.js";
|
|
4
4
|
import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
5
|
+
import { useMapSupplier } from "../hooks/useMapSupplier.js";
|
|
5
6
|
import { defineSetup } from "../types/helper.js";
|
|
6
7
|
import { SvgInlineWebComponentTag } from "../components/SvgInline/SvgInline.web-component.js";
|
|
7
8
|
const imgGrid = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzg1IiBoZWlnaHQ9IjgxNyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDM4NSA4MTciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjRDhEQkUyIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjEiPjxwYXRoIGQ9Ik0uNSA4MTdWME0yNC41IDgxN1YwTTQ4LjUgODE3VjBNNzIuNSA4MTdWME05Ni41IDgxN1YwTTEyMC41IDgxN1YwTTE0NC41IDgxN1YwTTE2OC41IDgxN1YwTTE5Mi41IDgxN1YwTTIxNi41IDgxN1YwTTI0MC41IDgxN1YwTTI2NC41IDgxN1YwTTI4OC41IDgxN1YwTTMxMi41IDgxN1YwTTMzNi41IDgxN1YwTTM2MC41IDgxN1YwTTM4NC41IDgxN1YwTTAgLjVoMzg1TTAgMjQuNWgzODVNMCA0OC41aDM4NU0wIDcyLjVoMzg1TTAgOTYuNWgzODVNMCAxMjAuNWgzODVNMCAxNDQuNWgzODVNMCAxNjguNWgzODVNMCAxOTIuNWgzODVNMCAyMTYuNWgzODVNMCAyNDAuNWgzODVNMCAyNjQuNWgzODVNMCAyODguNWgzODVNMCAzMTIuNWgzODVNMCAzMzYuNWgzODVNMCAzNjAuNWgzODVNMCAzODQuNWgzODVNMCA0MDguNWgzODVNMCA0MzIuNWgzODVNMCA0NTYuNWgzODVNMCA0ODAuNWgzODVNMCA1MDQuNWgzODVNMCA1MjguNWgzODVNMCA1NTIuNWgzODVNMCA1NzYuNWgzODVNMCA2MDAuNWgzODVNMCA2MjQuNWgzODVNMCA2NDguNWgzODVNMCA2NzIuNWgzODVNMCA2OTYuNWgzODVNMCA3MjAuNWgzODVNMCA3NDQuNWgzODVNMCA3NjguNWgzODVNMCA3OTIuNWgzODVNMCA4MTYuNWgzODUiLz48L2c+PC9zdmc+";
|
|
@@ -29,6 +30,11 @@ const Loading = defineSetup("Loading", function() {
|
|
|
29
30
|
})]);
|
|
30
31
|
});
|
|
31
32
|
const LoadFailed = defineSetup("LoadFailed", function(props) {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
const {
|
|
35
|
+
themeVariables
|
|
36
|
+
} = useMapSupplier();
|
|
37
|
+
const icon = (_b = (_a = props.icon) != null ? _a : themeVariables == null ? void 0 : themeVariables.ICON_LOAD_FAILED_URL) != null ? _b : ICON_LOAD_FAILED_URL;
|
|
32
38
|
return () => h("div", {
|
|
33
39
|
"class": loadingLayout
|
|
34
40
|
}, [h("img", {
|
|
@@ -41,7 +47,7 @@ const LoadFailed = defineSetup("LoadFailed", function(props) {
|
|
|
41
47
|
}, [h(SvgInlineWebComponentTag, {
|
|
42
48
|
"class": iconLoadFailed,
|
|
43
49
|
"attrs": {
|
|
44
|
-
"src":
|
|
50
|
+
"src": icon
|
|
45
51
|
}
|
|
46
52
|
}), h("span", {
|
|
47
53
|
"class": `${title} ${verticalGap}`
|
|
@@ -2,6 +2,7 @@ export declare const Loading: import("vue").DefineComponent<import("vue3").Compo
|
|
|
2
2
|
interface LoadFailedProps {
|
|
3
3
|
title?: string;
|
|
4
4
|
description?: string;
|
|
5
|
+
icon?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare const LoadFailed: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<LoadFailedProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<LoadFailedProps, Required<LoadFailedProps>>, never, LoadFailedProps>;
|
|
7
8
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "vue";
|
|
2
2
|
import "../../api/cdn.js";
|
|
3
|
-
import { L, a } from "../../chunks/Loading.
|
|
3
|
+
import { L, a } from "../../chunks/Loading.70dfc720.js";
|
|
4
4
|
import "../../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
5
|
+
import "../../hooks/useMapSupplier.js";
|
|
5
6
|
import "../../types/helper.js";
|
|
6
7
|
import "../SvgInline/SvgInline.web-component.js";
|
|
7
8
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../css/MapProvider-156bfd53.css";
|
|
2
2
|
import { h } from "vue";
|
|
3
3
|
import { reactive, toRefs } from "vue-demi";
|
|
4
|
-
import { L as LoadFailed, a as Loading, i as imgGrid } from "../../chunks/Loading.
|
|
4
|
+
import { L as LoadFailed, a as Loading, i as imgGrid } from "../../chunks/Loading.70dfc720.js";
|
|
5
5
|
import { useMapLoader, Status } from "../../hooks/useMapLoader.js";
|
|
6
6
|
import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
7
7
|
import { defineLagecySetup } from "../../types/helper.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Point } from "../types/interface";
|
|
2
2
|
export declare const apiLocalIsPointInRing: (point: Point, path: Point[]) => boolean;
|
|
3
3
|
export declare const useAmapGeometry: () => {
|
|
4
|
-
apiMapDistance: (from: Point, to: Point) => number
|
|
4
|
+
apiMapDistance: (from: Point, to: Point) => number;
|
|
5
5
|
apiMapDistanceToLine: (from: Point, line: Point[]) => number | undefined;
|
|
6
6
|
apiMapDistanceOfLine: (line: Point[]) => number | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const useGmapGeometry: () => {
|
|
9
|
-
apiMapDistance: (from: Point, to: Point) => number
|
|
9
|
+
apiMapDistance: (from: Point, to: Point) => number;
|
|
10
10
|
apiMapDistanceToLine: (from: Point, line: Point[]) => 0 | undefined;
|
|
11
11
|
apiMapDistanceOfLine: (line: Point[]) => number | undefined;
|
|
12
12
|
};
|
|
13
13
|
export declare const useMapGeometry: () => {
|
|
14
|
-
apiMapDistance: (from: Point, to: Point) => number
|
|
14
|
+
apiMapDistance: (from: Point, to: Point) => number;
|
|
15
15
|
apiMapDistanceToLine: (from: Point, line: Point[]) => number | undefined;
|
|
16
16
|
apiMapDistanceOfLine: (line: Point[]) => number | undefined;
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pointInPolygon } from "../utils/geometryPolygon.js";
|
|
1
|
+
import { pointInPolygon, distanceBetweenTwoPoints } 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";
|
|
@@ -7,7 +7,7 @@ const useAmapGeometry = () => {
|
|
|
7
7
|
const payload = useMapSupplier();
|
|
8
8
|
const apiMapDistance = (from, to) => {
|
|
9
9
|
if (payload.status !== Status.SUCCESS)
|
|
10
|
-
return
|
|
10
|
+
return distanceBetweenTwoPoints(from, to);
|
|
11
11
|
return AMap.GeometryUtil.distance(from, to);
|
|
12
12
|
};
|
|
13
13
|
const apiMapDistanceToLine = (from, line) => {
|
|
@@ -26,7 +26,7 @@ const useGmapGeometry = () => {
|
|
|
26
26
|
const payload = useMapSupplier();
|
|
27
27
|
const apiMapDistance = (from, to) => {
|
|
28
28
|
if (payload.status !== Status.SUCCESS)
|
|
29
|
-
return
|
|
29
|
+
return distanceBetweenTwoPoints(from, to);
|
|
30
30
|
return google.maps.geometry.spherical.computeDistanceBetween(vec2lnglat(from), vec2lnglat(to));
|
|
31
31
|
};
|
|
32
32
|
const apiMapDistanceToLine = (from, line) => {
|
|
@@ -1,15 +1,56 @@
|
|
|
1
1
|
import { shallowRef } from "vue-demi";
|
|
2
|
+
import { MAX_DEVIATION_DISTANCE_WALKING } from "../api/contants.js";
|
|
2
3
|
import { watchPostEffectForDeepOption } from "../utils/compare.js";
|
|
3
4
|
import { googleServiceApiWalkingRoute, amapJsApiWalkingRoute, gaodeServiceApiWalkingRoute, gmapJsApiWalkingRoute } from "../utils/compatibleWalkingRoute.js";
|
|
5
|
+
import { findClosestPointInLine } from "../utils/geometry.js";
|
|
6
|
+
import { distanceBetweenTwoPoints } from "../utils/geometryPolygon.js";
|
|
7
|
+
import { spaceLog } from "../utils/log.js";
|
|
8
|
+
import { createMemoizeWithTTL } from "../utils/ttlCache.js";
|
|
4
9
|
import { inTaiwan, inKorean } from "./useMapInChina.js";
|
|
5
10
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
11
|
+
const WALKING_ROUTE_CACHE_TTL = 30 * 60 * 1e3;
|
|
12
|
+
const findBestContinuation = (args, cacheEntries) => {
|
|
13
|
+
const [from, to] = args;
|
|
14
|
+
let bestPath;
|
|
15
|
+
for (const [[cacheFrom, cacheTo], path] of cacheEntries) {
|
|
16
|
+
if (!path || path.length < 2)
|
|
17
|
+
continue;
|
|
18
|
+
const deviationOfEndPoint = distanceBetweenTwoPoints(cacheTo, to);
|
|
19
|
+
if (deviationOfEndPoint > MAX_DEVIATION_DISTANCE_WALKING)
|
|
20
|
+
continue;
|
|
21
|
+
{
|
|
22
|
+
const { distance: deviationOfStartPoint } = findClosestPointInLine(
|
|
23
|
+
from,
|
|
24
|
+
[cacheFrom, ...path],
|
|
25
|
+
distanceBetweenTwoPoints
|
|
26
|
+
);
|
|
27
|
+
if (deviationOfStartPoint > MAX_DEVIATION_DISTANCE_WALKING)
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const { point: projectedPoint, index } = findClosestPointInLine(
|
|
31
|
+
from,
|
|
32
|
+
path,
|
|
33
|
+
distanceBetweenTwoPoints
|
|
34
|
+
);
|
|
35
|
+
const trimmedPath = [projectedPoint, ...path.slice(index + 1)];
|
|
36
|
+
if (trimmedPath.length < 2)
|
|
37
|
+
continue;
|
|
38
|
+
if (!bestPath || trimmedPath.length < bestPath.length) {
|
|
39
|
+
bestPath = trimmedPath;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return bestPath;
|
|
43
|
+
};
|
|
44
|
+
const memoizeAmapWalkingRoute = createMemoizeWithTTL(WALKING_ROUTE_CACHE_TTL, findBestContinuation);
|
|
45
|
+
const memoizeGmapWalkingRoute = createMemoizeWithTTL(WALKING_ROUTE_CACHE_TTL, findBestContinuation);
|
|
6
46
|
const useAWalkingRoute = (props) => {
|
|
7
47
|
const { googleRoutesProxyUrl } = useMapSupplier();
|
|
8
48
|
const pathRef = shallowRef([]);
|
|
9
49
|
const amapWalking = new AMap.Walking({});
|
|
10
|
-
const apiMapWalkingRoute = (from, to) => {
|
|
50
|
+
const apiMapWalkingRoute = memoizeAmapWalkingRoute((from, to) => {
|
|
51
|
+
spaceLog("apiMapWalkingRoute", `amap from = ${from} to = ${to}`);
|
|
11
52
|
return googleRoutesProxyUrl && inTaiwan(from) ? googleServiceApiWalkingRoute(from, to, googleRoutesProxyUrl) : amapJsApiWalkingRoute(from, to, amapWalking);
|
|
12
|
-
};
|
|
53
|
+
});
|
|
13
54
|
watchPostEffectForDeepOption(
|
|
14
55
|
() => {
|
|
15
56
|
const { from, to } = props;
|
|
@@ -27,11 +68,12 @@ const useGWalkingRoute = (props) => {
|
|
|
27
68
|
const { gaodeDirectionWalkingProxyUrl, googleRoutesProxyUrl } = useMapSupplier();
|
|
28
69
|
const pathRef = shallowRef([]);
|
|
29
70
|
const gmapDirectionsService = new google.maps.DirectionsService();
|
|
30
|
-
const apiMapWalkingRoute = (from, to) => {
|
|
71
|
+
const apiMapWalkingRoute = memoizeGmapWalkingRoute((from, to) => {
|
|
72
|
+
spaceLog("apiMapWalkingRoute", `gmap from = ${from} to = ${to}`);
|
|
31
73
|
if (inKorean(from))
|
|
32
74
|
return Promise.resolve([]);
|
|
33
75
|
return gaodeDirectionWalkingProxyUrl && inKorean(from) ? gaodeServiceApiWalkingRoute(from, to, gaodeDirectionWalkingProxyUrl) : googleRoutesProxyUrl ? googleServiceApiWalkingRoute(from, to, googleRoutesProxyUrl) : gmapJsApiWalkingRoute(from, to, gmapDirectionsService);
|
|
34
|
-
};
|
|
76
|
+
});
|
|
35
77
|
watchPostEffectForDeepOption(
|
|
36
78
|
() => {
|
|
37
79
|
const { from, to } = props;
|
|
@@ -129,4 +129,11 @@ export type MapThemeVariables = {
|
|
|
129
129
|
ZONE_RESTRICTED_BORDER_COLOR?: string;
|
|
130
130
|
ZONE_FORBIDDEN_BACKGROUND_COLOR?: string;
|
|
131
131
|
ZONE_FORBIDDEN_BORDER_COLOR?: string;
|
|
132
|
+
ICON_START_POINT_EN_URL?: string;
|
|
133
|
+
ICON_END_POINT_EN_URL?: string;
|
|
134
|
+
ICON_END_POINT_ZH_TW_URL?: string;
|
|
135
|
+
ICON_TAXI_CAR_URL?: string;
|
|
136
|
+
ICON_DOT_LOADING_URL?: string;
|
|
137
|
+
ICON_LOAD_FAILED_URL?: string;
|
|
138
|
+
ICON_WAYPOINT_URL?: string;
|
|
132
139
|
};
|