@heycar/heycars-map 2.14.0-walkOptimize1 → 2.15.0-domestic1
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 +47 -4
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +2 -1
- package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
- package/dist/v2/Demo/DemoBusinessTaxiEnd.js +9 -2
- package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +4 -1
- package/dist/v2/Demo/DemoBusinessTaxiService.js +19 -1
- package/dist/v2/Demo/demo.data.mock.d.ts +4 -0
- package/dist/v2/Demo/demo.data.mock.js +1194 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +45 -7
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +80 -16
- package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +6 -0
- package/dist/v2/business-components/TaxiCar/RandomCars.js +47 -0
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.e9166e7d.js → BusinessRecomendPlaceMap.eebd0822.js} +7 -1
- package/dist/v2/hooks/useMapCoordinatify.d.ts +2 -1
- package/dist/v2/hooks/useMapCoordinatify.js +6 -1
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/types/interface.d.ts +12 -0
- package/dist/v2/utils/geometryPolygon.d.ts +9 -0
- package/dist/v2/utils/geometryPolygon.js +19 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v2/utils/platform.d.ts +2 -1
- package/dist/v2/utils/platform.js +2 -1
- package/dist/v2/utils/typeChecking.d.ts +7 -1
- package/dist/v2/utils/typeChecking.js +18 -0
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +2 -1
- package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
- package/dist/v3/Demo/DemoBusinessTaxiEnd.js +9 -2
- package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +4 -1
- package/dist/v3/Demo/DemoBusinessTaxiService.js +19 -1
- package/dist/v3/Demo/demo.data.mock.d.ts +4 -0
- package/dist/v3/Demo/demo.data.mock.js +1194 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +45 -7
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +62 -16
- package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +8 -0
- package/dist/v3/business-components/TaxiCar/RandomCars.js +45 -0
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.c71d0b97.js → BusinessRecomendPlaceMap.71c439c6.js} +5 -1
- package/dist/v3/hooks/useMapCoordinatify.d.ts +2 -1
- package/dist/v3/hooks/useMapCoordinatify.js +6 -1
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v3/types/interface.d.ts +12 -0
- package/dist/v3/utils/geometryPolygon.d.ts +9 -0
- package/dist/v3/utils/geometryPolygon.js +19 -0
- package/dist/v3/utils/log.js +1 -1
- package/dist/v3/utils/platform.d.ts +2 -1
- package/dist/v3/utils/platform.js +2 -1
- package/dist/v3/utils/typeChecking.d.ts +7 -1
- package/dist/v3/utils/typeChecking.js +18 -0
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
28
28
|
emptyTitle: string;
|
|
29
29
|
queryingTitle: string;
|
|
30
30
|
recomendDescription: string;
|
|
31
|
+
enableNearbyCars?: boolean;
|
|
31
32
|
disableLocator?: boolean;
|
|
32
33
|
disableLocatorPhoto?: boolean;
|
|
33
34
|
geoErrorOnceNotificationKey?: string;
|
|
@@ -26,8 +26,9 @@ import "../DeviceOrientation/DeviceOrientation.js";
|
|
|
26
26
|
import "../GreenZone/GreenZone.js";
|
|
27
27
|
import "../PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import "../PickupPoints/PickupPoints.js";
|
|
29
|
+
import "../TaxiCar/RandomCars.js";
|
|
29
30
|
import "./useCacheCenterPlace.js";
|
|
30
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
31
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.71c439c6.js";
|
|
31
32
|
export {
|
|
32
33
|
B as BusinessRecomendPlaceMap,
|
|
33
34
|
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.71c439c6.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.71c439c6.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";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CoordinatePlace, CoordinatePoint } from "../../types/interface";
|
|
2
2
|
export interface BusinessTaxiEndMapProps {
|
|
3
|
-
from: Partial<
|
|
4
|
-
to: Partial<
|
|
3
|
+
from: Partial<CoordinatePlace>;
|
|
4
|
+
to: Partial<CoordinatePlace>;
|
|
5
|
+
path?: CoordinatePoint[];
|
|
5
6
|
}
|
|
6
7
|
export declare const BusinessTaxiEndMapInner: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessTaxiEndMapProps>, 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<BusinessTaxiEndMapProps, Required<BusinessTaxiEndMapProps>>, never, import("@vue/runtime-core").PublicProps, BusinessTaxiEndMapProps, BusinessTaxiEndMapProps, import("@vue/runtime-core").SlotsType<{} & {
|
|
7
8
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
@@ -8,7 +8,7 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
|
8
8
|
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
9
9
|
import { defineSetup } from "../../types/helper.js";
|
|
10
10
|
import { place2point, pipeDefer } from "../../utils/transform.js";
|
|
11
|
-
import { isCoordinatePoint, toCoordinatePlaceType } from "../../utils/typeChecking.js";
|
|
11
|
+
import { isCoordinatePoint, toCoordinatePlaceType, toCoordinatePointType } from "../../utils/typeChecking.js";
|
|
12
12
|
import { SectionEndService } from "../BusinessTaxiServiceMap/BusinessTaxiServiceSection.js";
|
|
13
13
|
const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(props, {
|
|
14
14
|
attrs
|
|
@@ -18,6 +18,7 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
18
18
|
setMap
|
|
19
19
|
} = useHeycarMap();
|
|
20
20
|
const {
|
|
21
|
+
unCoordinatifyPoint,
|
|
21
22
|
unCoordinatifyPlace
|
|
22
23
|
} = useMapCoordinatify();
|
|
23
24
|
const {
|
|
@@ -31,11 +32,13 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
31
32
|
return () => {
|
|
32
33
|
const {
|
|
33
34
|
from: inputFrom,
|
|
34
|
-
to: inputTo
|
|
35
|
+
to: inputTo,
|
|
36
|
+
path: inputPath
|
|
35
37
|
} = props;
|
|
36
38
|
const isReady = isCoordinatePoint(inputFrom) && isCoordinatePoint(inputTo);
|
|
37
39
|
const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
|
|
38
40
|
const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
|
|
41
|
+
const path = inputPath == null ? void 0 : inputPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
|
|
39
42
|
const center = isReady ? place2point(from) : [...BEIJIN_POINT];
|
|
40
43
|
return createVNode(HeycarMap, {
|
|
41
44
|
"class": attrs.class,
|
|
@@ -49,6 +52,7 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
49
52
|
default: () => [isReady && createVNode(SectionEndService, {
|
|
50
53
|
"from": from,
|
|
51
54
|
"to": to,
|
|
55
|
+
"routePath": path,
|
|
52
56
|
"registerOverlay": registerFitVeiw
|
|
53
57
|
}, null)]
|
|
54
58
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HeycarMapProps } from "../../components/MapProvider";
|
|
2
2
|
import type { BusinessTaxiServiceContext } from "../../hooks-business/useBusinessTaxiServiceMap";
|
|
3
3
|
import type { CoordinatifyProps } from "../../types/coordinatify";
|
|
4
|
-
import type { CoordinatePlace, CoordinateTrackPoint, DriverStatus } from "../../types/interface";
|
|
4
|
+
import type { CoordinatePlace, CoordinatePoint, CoordinateTrackPoint, DriverStatus, GetDriverRouteOrTrackOutput } from "../../types/interface";
|
|
5
5
|
export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps, "center" | "zoom" | "mapRef">> & {
|
|
6
6
|
from: CoordinatePlace;
|
|
7
7
|
to: CoordinatePlace;
|
|
@@ -15,6 +15,8 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
|
|
|
15
15
|
driverStatus: DriverStatus;
|
|
16
16
|
interval: number;
|
|
17
17
|
disablePassenger?: boolean;
|
|
18
|
+
confirmedPath?: CoordinatePoint[];
|
|
19
|
+
endServicePath?: CoordinatePoint[];
|
|
18
20
|
mapContext: CoordinatifyProps<BusinessTaxiServiceContext>;
|
|
19
21
|
renderStartSerivceTitle: (titleProps: {
|
|
20
22
|
distance: number;
|
|
@@ -25,6 +27,7 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
|
|
|
25
27
|
duration: number;
|
|
26
28
|
}) => string;
|
|
27
29
|
getDriverPositionTrack?: () => Promise<CoordinateTrackPoint[]>;
|
|
30
|
+
getDriverRouteOrTrack?: () => Promise<GetDriverRouteOrTrackOutput>;
|
|
28
31
|
};
|
|
29
32
|
export declare const BusinessTaxiServiceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessTaxiServiceMapProps>, 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<BusinessTaxiServiceMapProps, Required<BusinessTaxiServiceMapProps>>, "resize" | "dragEnd" | "zoomEnd", import("vue-demi").PublicProps, BusinessTaxiServiceMapProps, BusinessTaxiServiceMapProps, import("vue-demi").SlotsType<{
|
|
30
33
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
@@ -10,9 +10,10 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
|
10
10
|
import { useMapAssertSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
11
11
|
import { defineSetup, defineLagecySetup } from "../../types/helper.js";
|
|
12
12
|
import { MANUAL_ABORT_MESSAGE } from "../../utils/ManualAbortError.js";
|
|
13
|
+
import { computeLineAngle } from "../../utils/geometryPolygon.js";
|
|
13
14
|
import { createAbortable, assertNotEmptyArray } from "../../utils/helper.js";
|
|
14
15
|
import { place2point, pipeDefer, lnglat2point } from "../../utils/transform.js";
|
|
15
|
-
import { toCoordinatePlaceType, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
|
|
16
|
+
import { toCoordinatePlaceType, toCoordinatePointType, createTypeError, toCoordinateExternalRoute, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
|
|
16
17
|
import { AuxiliaryGraspRoad } from "../AuxiliaryGraspRoad/AuxiliaryGraspRoad.js";
|
|
17
18
|
import { AuxiliaryPassanger } from "../AuxiliaryPassanger/AuxiliaryPassanger.js";
|
|
18
19
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
@@ -23,6 +24,7 @@ const IS_ENABLE_AUXILIARY_GRASP_ROAD = apiGetAuxiliaryGrapStatus();
|
|
|
23
24
|
const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", function(props, {
|
|
24
25
|
attrs
|
|
25
26
|
}) {
|
|
27
|
+
var _a;
|
|
26
28
|
const {
|
|
27
29
|
interval,
|
|
28
30
|
disablePassenger,
|
|
@@ -40,10 +42,17 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
40
42
|
} = useMapAssertSupplier();
|
|
41
43
|
const abortController = new AbortController();
|
|
42
44
|
const abortable = createAbortable(abortController.signal);
|
|
43
|
-
const
|
|
45
|
+
const getDriverRouteOrTrack = abortable((_a = props.getDriverRouteOrTrack) != null ? _a : async () => {
|
|
46
|
+
var _a2;
|
|
47
|
+
return {
|
|
48
|
+
tracks: await ((_a2 = props.getDriverPositionTrack) == null ? void 0 : _a2.call(props))
|
|
49
|
+
};
|
|
50
|
+
});
|
|
44
51
|
const {
|
|
52
|
+
unCoordinatifyPoint,
|
|
45
53
|
unCoordinatifyPlace,
|
|
46
|
-
unCoordinatifyTrackPoint
|
|
54
|
+
unCoordinatifyTrackPoint,
|
|
55
|
+
unCoordinatifyExternalRoute
|
|
47
56
|
} = useMapCoordinatify();
|
|
48
57
|
const {
|
|
49
58
|
registerFitVeiw: registerOverlay,
|
|
@@ -64,11 +73,27 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
64
73
|
const carPositionRef = ref();
|
|
65
74
|
const carAngleRef = ref();
|
|
66
75
|
const carTrackPositionsRef = ref([]);
|
|
76
|
+
const carRouteRef = ref();
|
|
67
77
|
watch(() => props.driverStatus, (status, _, onCleanup) => {
|
|
68
78
|
if (!STATUS_NEED_CAR_POSITION.includes(status))
|
|
69
79
|
return;
|
|
70
80
|
const update = async () => {
|
|
71
|
-
const
|
|
81
|
+
const output = await (getDriverRouteOrTrack == null ? void 0 : getDriverRouteOrTrack());
|
|
82
|
+
if (!("tracks" in output) && !("routes" in output)) {
|
|
83
|
+
throw createTypeError("GetDriverRouteOrTrackOutput", output);
|
|
84
|
+
}
|
|
85
|
+
if ("routes" in output) {
|
|
86
|
+
const routes = unCoordinatifyExternalRoute(toCoordinateExternalRoute(output.routes));
|
|
87
|
+
assertNotEmptyArray(routes.path, "routes.path");
|
|
88
|
+
carPositionRef.value = routes.path[0];
|
|
89
|
+
carAngleRef.value = computeLineAngle(routes.path[0], routes.path[1]);
|
|
90
|
+
carTrackPositionsRef.value = [];
|
|
91
|
+
carRouteRef.value = routes;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const {
|
|
95
|
+
tracks
|
|
96
|
+
} = output;
|
|
72
97
|
assertNotEmptyArray(tracks, "tracks");
|
|
73
98
|
const trackPositions = tracks.map((p) => unCoordinatifyTrackPoint(toCoordinateTrackPoint(p)));
|
|
74
99
|
const [{
|
|
@@ -77,6 +102,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
77
102
|
carPositionRef.value = lnglat2point(trackPositions[trackPositions.length - 1]);
|
|
78
103
|
carAngleRef.value = angle;
|
|
79
104
|
carTrackPositionsRef.value = trackPositions;
|
|
105
|
+
carRouteRef.value = void 0;
|
|
80
106
|
};
|
|
81
107
|
const timer = setInterval(update, interval);
|
|
82
108
|
update();
|
|
@@ -95,16 +121,21 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
95
121
|
dispatchingTitle,
|
|
96
122
|
bookDispatchingTitle,
|
|
97
123
|
bookDispatchedTitle,
|
|
98
|
-
driverArrivedTitle
|
|
124
|
+
driverArrivedTitle,
|
|
125
|
+
confirmedPath: inputConfirmedPath,
|
|
126
|
+
endServicePath: inputEndServicePath
|
|
99
127
|
} = props;
|
|
100
128
|
const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
|
|
101
129
|
const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
|
|
102
130
|
const relayTo = inputRelayTo ? unCoordinatifyPlace(toCoordinatePlaceType(inputRelayTo)) : void 0;
|
|
131
|
+
const confirmedPath = inputConfirmedPath == null ? void 0 : inputConfirmedPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
|
|
132
|
+
const endServicePath = inputEndServicePath == null ? void 0 : inputEndServicePath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
|
|
103
133
|
const carPosition = carPositionRef.value;
|
|
104
134
|
const carAngle = carAngleRef.value;
|
|
105
135
|
const carTrackPositions = carTrackPositionsRef.value;
|
|
106
136
|
const touchEnable = !["canceled", "canceling", "completed", "endService", "waitpay", "waitRechargePay", "refund", "rechargePayed", "payed"].includes(driverStatus);
|
|
107
137
|
const passengerPosition = disablePassenger || geoLoading.value || geoError.value ? void 0 : geoPosition.value;
|
|
138
|
+
const carRoute = carRouteRef.value;
|
|
108
139
|
return createVNode(HeycarMap, {
|
|
109
140
|
"class": attrs.class,
|
|
110
141
|
"style": attrs.style,
|
|
@@ -128,6 +159,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
128
159
|
"render": (orientation) => createVNode(SectionConfirmed, {
|
|
129
160
|
"from": from,
|
|
130
161
|
"to": to,
|
|
162
|
+
"routePath": confirmedPath,
|
|
131
163
|
"passengerPosition": passengerPosition,
|
|
132
164
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
133
165
|
"registerOverlay": registerOverlay
|
|
@@ -141,6 +173,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
141
173
|
"carPosition": carPosition,
|
|
142
174
|
"carAngle": carAngle,
|
|
143
175
|
"carTrackPositions": carTrackPositions,
|
|
176
|
+
"carRoute": carRoute,
|
|
144
177
|
"passengerPosition": passengerPosition,
|
|
145
178
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
146
179
|
"relayToTitle": relayToTitle,
|
|
@@ -155,6 +188,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
155
188
|
"carPosition": carPosition,
|
|
156
189
|
"carAngle": carAngle,
|
|
157
190
|
"carTrackPositions": carTrackPositions,
|
|
191
|
+
"carRoute": carRoute,
|
|
158
192
|
"passengerPosition": passengerPosition,
|
|
159
193
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
160
194
|
"renderTitle": renderStartSerivceTitle,
|
|
@@ -167,6 +201,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
167
201
|
"from": from,
|
|
168
202
|
"to": to,
|
|
169
203
|
"title": bookDispatchedTitle,
|
|
204
|
+
"routePath": confirmedPath,
|
|
170
205
|
"passengerPosition": passengerPosition,
|
|
171
206
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
172
207
|
"registerOverlay": registerOverlay
|
|
@@ -176,6 +211,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
176
211
|
"carPosition": carPosition,
|
|
177
212
|
"carAngle": carAngle,
|
|
178
213
|
"carTrackPositions": carTrackPositions,
|
|
214
|
+
"carRoute": carRoute,
|
|
179
215
|
"renderTitle": renderInServiceTitle,
|
|
180
216
|
"registerOverlay": registerOverlay,
|
|
181
217
|
"key": `${to.lng},${to.lat}`
|
|
@@ -198,15 +234,17 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
198
234
|
}, null) : driverStatus === "endService" || driverStatus === "completed" || driverStatus === "banlanceRefund" || driverStatus === "waitBanlanceRefund" || driverStatus === "rechargePayed" || driverStatus === "waitRechargePay" || driverStatus === "payed" || driverStatus === "waitpay" || driverStatus === "refund" ? createVNode(SectionEndService, {
|
|
199
235
|
"from": from,
|
|
200
236
|
"to": to,
|
|
237
|
+
"routePath": endServicePath,
|
|
201
238
|
"registerOverlay": registerOverlay
|
|
202
239
|
}, null) : (
|
|
203
240
|
// 匹配不到就显示灰色路线
|
|
204
241
|
createVNode(SectionEndService, {
|
|
205
242
|
"from": from,
|
|
206
243
|
"to": to,
|
|
244
|
+
"routePath": endServicePath,
|
|
207
245
|
"registerOverlay": registerOverlay
|
|
208
246
|
}, null)
|
|
209
|
-
), IS_ENABLE_AUXILIARY_GRASP_ROAD && createVNode(AuxiliaryGraspRoad, {
|
|
247
|
+
), IS_ENABLE_AUXILIARY_GRASP_ROAD && !carRoute && createVNode(AuxiliaryGraspRoad, {
|
|
210
248
|
"status": driverStatus,
|
|
211
249
|
"trackPoints": carTrackPositions,
|
|
212
250
|
"from": from,
|
|
@@ -233,7 +271,7 @@ const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", funct
|
|
|
233
271
|
attrs: props,
|
|
234
272
|
key: `${payload.supplier}${instanceNo}`
|
|
235
273
|
});
|
|
236
|
-
}).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "to"]);
|
|
274
|
+
}).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "getDriverRouteOrTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "confirmedPath", "endServicePath", "to"]);
|
|
237
275
|
export {
|
|
238
276
|
BusinessTaxiServiceMap,
|
|
239
277
|
BusinessTaxiServiceMapInner
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MROP } from "../../hooks/useOverlay";
|
|
2
|
-
import type { Place, Point, TrackPoint } from "../../types/interface";
|
|
2
|
+
import type { ExternalRoute, Place, Point, TrackPoint } from "../../types/interface";
|
|
3
3
|
import { type DrivingRouteRenderProps } from "../DrivingRoute";
|
|
4
4
|
type SectionDispatchingProps = Required<MROP> & {
|
|
5
5
|
title: string;
|
|
@@ -13,6 +13,7 @@ type SectionConfirmedProps = Required<MROP> & {
|
|
|
13
13
|
passengerAngle?: string;
|
|
14
14
|
from: Place;
|
|
15
15
|
to: Place;
|
|
16
|
+
routePath?: Point[];
|
|
16
17
|
};
|
|
17
18
|
export declare const SectionConfirmed: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionConfirmedProps>, 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<SectionConfirmedProps, Required<SectionConfirmedProps>>, never, import("vue").PublicProps, SectionConfirmedProps, SectionConfirmedProps, import("vue").SlotsType<{} & {
|
|
18
19
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
@@ -32,6 +33,7 @@ type SectionDriverStartServiceProps = Required<MROP> & {
|
|
|
32
33
|
carPosition?: Point;
|
|
33
34
|
carAngle?: number;
|
|
34
35
|
carTrackPositions?: TrackPoint[];
|
|
36
|
+
carRoute?: ExternalRoute;
|
|
35
37
|
from: Place;
|
|
36
38
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
37
39
|
};
|
|
@@ -45,6 +47,7 @@ type SectionBookDispatchedProps = Required<MROP> & {
|
|
|
45
47
|
passengerAngle?: string;
|
|
46
48
|
from: Place;
|
|
47
49
|
to: Place;
|
|
50
|
+
routePath?: Point[];
|
|
48
51
|
title?: string;
|
|
49
52
|
};
|
|
50
53
|
export declare const SectionBookDispatched: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionBookDispatchedProps>, 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<SectionBookDispatchedProps, Required<SectionBookDispatchedProps>>, never, import("vue").PublicProps, SectionBookDispatchedProps, SectionBookDispatchedProps, import("vue").SlotsType<{} & {
|
|
@@ -66,6 +69,7 @@ type SectionInServiceProps = Required<MROP> & {
|
|
|
66
69
|
carPosition?: Point;
|
|
67
70
|
carAngle?: number;
|
|
68
71
|
carTrackPositions?: TrackPoint[];
|
|
72
|
+
carRoute?: ExternalRoute;
|
|
69
73
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
70
74
|
};
|
|
71
75
|
export declare const SectionInService: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionInServiceProps>, 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<SectionInServiceProps, Required<SectionInServiceProps>>, never, import("vue").PublicProps, SectionInServiceProps, SectionInServiceProps, import("vue").SlotsType<{
|
|
@@ -83,6 +87,7 @@ export declare const SectionCanceled: import("vue").DefineComponent<import("vue"
|
|
|
83
87
|
export type SectionEndServiceProps = Required<MROP> & {
|
|
84
88
|
from: Place;
|
|
85
89
|
to: Place;
|
|
90
|
+
routePath?: Point[];
|
|
86
91
|
};
|
|
87
92
|
export declare const SectionEndService: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionEndServiceProps>, 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<SectionEndServiceProps, Required<SectionEndServiceProps>>, never, import("vue").PublicProps, SectionEndServiceProps, SectionEndServiceProps, import("vue").SlotsType<{} & {
|
|
88
93
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
@@ -67,12 +67,15 @@ const SectionConfirmed = defineSetup("SectionConfirmed", function(props) {
|
|
|
67
67
|
to: toPlace,
|
|
68
68
|
passengerPosition,
|
|
69
69
|
passengerAngle,
|
|
70
|
+
routePath,
|
|
70
71
|
registerOverlay
|
|
71
72
|
} = props;
|
|
72
73
|
const from = place2point(fromPlace);
|
|
73
74
|
const to = place2point(toPlace);
|
|
74
75
|
const passengerDistance = passengerPosition ? apiMapDistance(passengerPosition, from) : void 0;
|
|
75
|
-
return createVNode("div", null, [createVNode(
|
|
76
|
+
return createVNode("div", null, [routePath ? createVNode(DrivingLine, {
|
|
77
|
+
"path": routePath
|
|
78
|
+
}, null) : createVNode(DrivingRoute, {
|
|
76
79
|
"to": to,
|
|
77
80
|
"from": from,
|
|
78
81
|
"render": ({
|
|
@@ -129,12 +132,14 @@ const SectionDriverStartRelayService = defineSetup("SectionDriverStartRelayServi
|
|
|
129
132
|
apiMapDistance
|
|
130
133
|
} = useMapGeometry();
|
|
131
134
|
return () => {
|
|
135
|
+
var _a;
|
|
132
136
|
const {
|
|
133
137
|
from: fromPlace,
|
|
134
138
|
relayTo: relayToPlace,
|
|
135
139
|
carPosition,
|
|
136
140
|
carAngle,
|
|
137
141
|
carTrackPositions,
|
|
142
|
+
carRoute,
|
|
138
143
|
passengerPosition,
|
|
139
144
|
passengerAngle,
|
|
140
145
|
relayToTitle,
|
|
@@ -168,7 +173,17 @@ const SectionDriverStartRelayService = defineSetup("SectionDriverStartRelayServi
|
|
|
168
173
|
"position": relayTo,
|
|
169
174
|
"label": relayToTitle,
|
|
170
175
|
"hideIcon": true
|
|
171
|
-
}, null),
|
|
176
|
+
}, null), carRoute ? [createVNode(DrivingLine, {
|
|
177
|
+
"path": carRoute.path
|
|
178
|
+
}, null), createVNode(TaxiCar, {
|
|
179
|
+
"position": (_a = carRoute.path[0]) != null ? _a : carPosition,
|
|
180
|
+
"angle": carAngle,
|
|
181
|
+
"title": renderTitle({
|
|
182
|
+
distance: carRoute.distance,
|
|
183
|
+
duration: carRoute.duration
|
|
184
|
+
}),
|
|
185
|
+
"registerOverlay": fittableRegistryOverlay
|
|
186
|
+
}, null)] : !(carTrackPositions == null ? void 0 : carTrackPositions.length) || !carDistance ? null : createVNode(DeviationCorrectionDrivingRoute, {
|
|
172
187
|
"tracks": carTrackPositions,
|
|
173
188
|
"to": from,
|
|
174
189
|
"waypoints": waypoints,
|
|
@@ -180,12 +195,12 @@ const SectionDriverStartRelayService = defineSetup("SectionDriverStartRelayServi
|
|
|
180
195
|
duration,
|
|
181
196
|
trafficJams
|
|
182
197
|
}) => {
|
|
183
|
-
var
|
|
198
|
+
var _a2;
|
|
184
199
|
return [relayTo ? createVNode(TrafficDrivingLine, {
|
|
185
200
|
"path": path,
|
|
186
201
|
"trafficJams": trafficJams
|
|
187
202
|
}, null) : null, createVNode(TaxiCar, {
|
|
188
|
-
"position": (
|
|
203
|
+
"position": (_a2 = path[0]) != null ? _a2 : carPosition,
|
|
189
204
|
"angle": angle != null ? angle : carAngle,
|
|
190
205
|
"title": renderTitle({
|
|
191
206
|
distance,
|
|
@@ -226,11 +241,13 @@ const SectionDriverStartService = defineSetup("SectionDriverStartService", funct
|
|
|
226
241
|
apiMapDistance
|
|
227
242
|
} = useMapGeometry();
|
|
228
243
|
return () => {
|
|
244
|
+
var _a;
|
|
229
245
|
const {
|
|
230
246
|
from: fromPlace,
|
|
231
247
|
carPosition,
|
|
232
248
|
carAngle,
|
|
233
249
|
carTrackPositions,
|
|
250
|
+
carRoute,
|
|
234
251
|
passengerPosition,
|
|
235
252
|
passengerAngle,
|
|
236
253
|
renderTitle
|
|
@@ -252,7 +269,17 @@ const SectionDriverStartService = defineSetup("SectionDriverStartService", funct
|
|
|
252
269
|
"position": from,
|
|
253
270
|
"label": fromPlace.displayName,
|
|
254
271
|
"hideIcon": true
|
|
255
|
-
}, null),
|
|
272
|
+
}, null), carRoute ? [createVNode(DrivingLine, {
|
|
273
|
+
"path": carRoute.path
|
|
274
|
+
}, null), createVNode(TaxiCar, {
|
|
275
|
+
"position": (_a = carRoute.path[0]) != null ? _a : carPosition,
|
|
276
|
+
"angle": carAngle,
|
|
277
|
+
"title": renderTitle({
|
|
278
|
+
distance: carRoute.distance,
|
|
279
|
+
duration: carRoute.duration
|
|
280
|
+
}),
|
|
281
|
+
"registerOverlay": fittableRegistryOverlay
|
|
282
|
+
}, null)] : !(carTrackPositions == null ? void 0 : carTrackPositions.length) || !carDistance ? null : carDistance > CAR_DISTANCE_MIN ? createVNode(DeviationCorrectionDrivingRoute, {
|
|
256
283
|
"tracks": carTrackPositions,
|
|
257
284
|
"to": from,
|
|
258
285
|
"deviation": MAX_DEVIATION_DISTANCE,
|
|
@@ -263,12 +290,12 @@ const SectionDriverStartService = defineSetup("SectionDriverStartService", funct
|
|
|
263
290
|
duration,
|
|
264
291
|
trafficJams
|
|
265
292
|
}) => {
|
|
266
|
-
var
|
|
293
|
+
var _a2;
|
|
267
294
|
return [createVNode(TrafficDrivingLine, {
|
|
268
295
|
"path": path,
|
|
269
296
|
"trafficJams": trafficJams
|
|
270
297
|
}, null), createVNode(TaxiCar, {
|
|
271
|
-
"position": (
|
|
298
|
+
"position": (_a2 = path[0]) != null ? _a2 : carPosition,
|
|
272
299
|
"angle": angle != null ? angle : carAngle,
|
|
273
300
|
"title": renderTitle({
|
|
274
301
|
distance,
|
|
@@ -283,9 +310,9 @@ const SectionDriverStartService = defineSetup("SectionDriverStartService", funct
|
|
|
283
310
|
path: graspRoadPath,
|
|
284
311
|
angle
|
|
285
312
|
}) => {
|
|
286
|
-
var
|
|
313
|
+
var _a2;
|
|
287
314
|
return createVNode(TaxiCar, {
|
|
288
|
-
"position": (
|
|
315
|
+
"position": (_a2 = graspRoadPath[graspRoadPath.length - 1]) != null ? _a2 : carPosition,
|
|
289
316
|
"angle": angle != null ? angle : carAngle,
|
|
290
317
|
"title": renderTitle({
|
|
291
318
|
distance: carDistance,
|
|
@@ -325,12 +352,15 @@ const SectionBookDispatched = defineSetup("SectionBookDispatched", function(prop
|
|
|
325
352
|
title,
|
|
326
353
|
passengerPosition,
|
|
327
354
|
passengerAngle,
|
|
355
|
+
routePath,
|
|
328
356
|
registerOverlay
|
|
329
357
|
} = props;
|
|
330
358
|
const from = place2point(fromPlace);
|
|
331
359
|
const to = place2point(toPlace);
|
|
332
360
|
const passengerDistance = passengerPosition ? apiMapDistance(passengerPosition, from) : void 0;
|
|
333
|
-
return createVNode("div", null, [createVNode(
|
|
361
|
+
return createVNode("div", null, [routePath ? createVNode(DrivingLine, {
|
|
362
|
+
"path": routePath
|
|
363
|
+
}, null) : createVNode(DrivingRoute, {
|
|
334
364
|
"to": to,
|
|
335
365
|
"from": from,
|
|
336
366
|
"render": ({
|
|
@@ -451,11 +481,13 @@ const SectionInService = defineSetup("SectionInService", function(props) {
|
|
|
451
481
|
immediate: true
|
|
452
482
|
});
|
|
453
483
|
return () => {
|
|
484
|
+
var _a;
|
|
454
485
|
const {
|
|
455
486
|
to: toPlace,
|
|
456
487
|
carPosition,
|
|
457
488
|
carAngle,
|
|
458
489
|
carTrackPositions,
|
|
490
|
+
carRoute,
|
|
459
491
|
renderTitle
|
|
460
492
|
} = props;
|
|
461
493
|
const to = place2point(toPlace);
|
|
@@ -466,7 +498,17 @@ const SectionInService = defineSetup("SectionInService", function(props) {
|
|
|
466
498
|
apiMapDistance
|
|
467
499
|
} = useMapGeometry();
|
|
468
500
|
const carDistance = carPosition ? apiMapDistance(carPosition, to) : void 0;
|
|
469
|
-
return createVNode("div", null, [
|
|
501
|
+
return createVNode("div", null, [carRoute ? [createVNode(DrivingLine, {
|
|
502
|
+
"path": carRoute.path
|
|
503
|
+
}, null), createVNode(TaxiCar, {
|
|
504
|
+
"position": (_a = carRoute.path[0]) != null ? _a : carPosition,
|
|
505
|
+
"angle": carAngle,
|
|
506
|
+
"title": renderTitle({
|
|
507
|
+
distance: carRoute.distance,
|
|
508
|
+
duration: carRoute.duration
|
|
509
|
+
}),
|
|
510
|
+
"registerOverlay": fittableRegistryOverlay
|
|
511
|
+
}, null)] : !(carTrackPositions == null ? void 0 : carTrackPositions.length) || !carDistance ? null : carDistance > CAR_DISTANCE_MIN ? createVNode(DeviationCorrectionDrivingRoute, {
|
|
470
512
|
"tracks": carTrackPositions,
|
|
471
513
|
"to": to,
|
|
472
514
|
"deviation": MAX_DEVIATION_DISTANCE,
|
|
@@ -477,12 +519,12 @@ const SectionInService = defineSetup("SectionInService", function(props) {
|
|
|
477
519
|
duration,
|
|
478
520
|
trafficJams
|
|
479
521
|
}) => {
|
|
480
|
-
var
|
|
522
|
+
var _a2;
|
|
481
523
|
return [createVNode(TrafficDrivingLine, {
|
|
482
524
|
"path": path,
|
|
483
525
|
"trafficJams": trafficJams
|
|
484
526
|
}, null), createVNode(TaxiCar, {
|
|
485
|
-
"position": (
|
|
527
|
+
"position": (_a2 = path[0]) != null ? _a2 : carPosition,
|
|
486
528
|
"angle": angle != null ? angle : carAngle,
|
|
487
529
|
"title": renderTitle({
|
|
488
530
|
distance,
|
|
@@ -497,9 +539,9 @@ const SectionInService = defineSetup("SectionInService", function(props) {
|
|
|
497
539
|
path: graspRoadPath,
|
|
498
540
|
angle
|
|
499
541
|
}) => {
|
|
500
|
-
var
|
|
542
|
+
var _a2;
|
|
501
543
|
return createVNode(TaxiCar, {
|
|
502
|
-
"position": (
|
|
544
|
+
"position": (_a2 = graspRoadPath[graspRoadPath.length - 1]) != null ? _a2 : carPosition,
|
|
503
545
|
"angle": angle != null ? angle : carAngle,
|
|
504
546
|
"title": renderTitle({
|
|
505
547
|
distance: carDistance,
|
|
@@ -574,11 +616,15 @@ const SectionEndService = defineSetup("SectionEndService", function(props) {
|
|
|
574
616
|
const {
|
|
575
617
|
from: fromPlace,
|
|
576
618
|
to: toPlace,
|
|
619
|
+
routePath,
|
|
577
620
|
registerOverlay
|
|
578
621
|
} = props;
|
|
579
622
|
const from = place2point(fromPlace);
|
|
580
623
|
const to = place2point(toPlace);
|
|
581
|
-
return createVNode("div", null, [createVNode(
|
|
624
|
+
return createVNode("div", null, [routePath ? createVNode(DrivingLine, {
|
|
625
|
+
"path": routePath,
|
|
626
|
+
"status": "DONE"
|
|
627
|
+
}, null) : createVNode(DrivingRoute, {
|
|
582
628
|
"from": from,
|
|
583
629
|
"to": to,
|
|
584
630
|
"render": ({
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Point } from "../../types/interface";
|
|
2
|
+
interface RandomCarsProps {
|
|
3
|
+
center: Point;
|
|
4
|
+
}
|
|
5
|
+
export declare const RandomCars: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<RandomCarsProps>, 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<RandomCarsProps, Required<RandomCarsProps>>, never, import("vue-demi").PublicProps, RandomCarsProps, RandomCarsProps, import("vue-demi").SlotsType<{} & {
|
|
6
|
+
default?: import("../../demi-polyfill").Slot | undefined;
|
|
7
|
+
}>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createVNode } from "vue";
|
|
2
|
+
import { computed } from "vue-demi";
|
|
3
|
+
import { defineSetup } from "../../types/helper.js";
|
|
4
|
+
import { TaxiCar } from "./TaxiCar.js";
|
|
5
|
+
const RANDOM_CARS_RADIUS = 300;
|
|
6
|
+
const RANDOM_CARS_COUNT = 2;
|
|
7
|
+
const createRandomPoint = (center, radius) => {
|
|
8
|
+
const [lng, lat] = center;
|
|
9
|
+
const R_EARTH_METERS = 6371e3;
|
|
10
|
+
const randomAngle = Math.random() * 2 * Math.PI;
|
|
11
|
+
const randomRadiusInMeters = radius * Math.sqrt(Math.random());
|
|
12
|
+
const dx = randomRadiusInMeters * Math.cos(randomAngle);
|
|
13
|
+
const dy = randomRadiusInMeters * Math.sin(randomAngle);
|
|
14
|
+
const dLat = dy / R_EARTH_METERS;
|
|
15
|
+
const centerLatRadians = lat * (Math.PI / 180);
|
|
16
|
+
const dLng = dx / (R_EARTH_METERS * Math.cos(centerLatRadians));
|
|
17
|
+
return [lng + dLng * (180 / Math.PI), lat + dLat * (180 / Math.PI)];
|
|
18
|
+
};
|
|
19
|
+
const useRandomCars = (center) => {
|
|
20
|
+
return computed(() => {
|
|
21
|
+
return Array.from({
|
|
22
|
+
length: RANDOM_CARS_COUNT
|
|
23
|
+
}).map(() => {
|
|
24
|
+
const position = createRandomPoint(center, RANDOM_CARS_RADIUS);
|
|
25
|
+
const angle = Math.random() * 360;
|
|
26
|
+
return {
|
|
27
|
+
position,
|
|
28
|
+
angle
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const RandomCars = defineSetup("RandomCars", function(props) {
|
|
34
|
+
const {
|
|
35
|
+
center
|
|
36
|
+
} = props;
|
|
37
|
+
const randomCarsRef = useRandomCars(center);
|
|
38
|
+
return () => createVNode("div", null, [randomCarsRef.value.map((car) => createVNode(TaxiCar, {
|
|
39
|
+
"position": car.position,
|
|
40
|
+
"angle": car.angle
|
|
41
|
+
}, null))]);
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
RandomCars
|
|
45
|
+
};
|
package/dist/v3/chunks/{BusinessRecomendPlaceMap.c71d0b97.js → BusinessRecomendPlaceMap.71c439c6.js}
RENAMED
|
@@ -26,6 +26,7 @@ import { DeviceOrientation } from "../business-components/DeviceOrientation/Devi
|
|
|
26
26
|
import { GreenZone } from "../business-components/GreenZone/GreenZone.js";
|
|
27
27
|
import { PassengerCircle } from "../business-components/PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import { PickupPoints } from "../business-components/PickupPoints/PickupPoints.js";
|
|
29
|
+
import { RandomCars } from "../business-components/TaxiCar/RandomCars.js";
|
|
29
30
|
import { useCacheCenterPlace } from "../business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js";
|
|
30
31
|
import { b as baseGetTag, r as root } from "./isSymbol.555c14bf.js";
|
|
31
32
|
import { i as isObject } from "./debounce.5afe7867.js";
|
|
@@ -556,6 +557,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
556
557
|
recomendDescription,
|
|
557
558
|
unavailableTitle,
|
|
558
559
|
forbiddenTitle,
|
|
560
|
+
enableNearbyCars,
|
|
559
561
|
disableLocator,
|
|
560
562
|
renderPlacePhoto,
|
|
561
563
|
renderPlaceTag
|
|
@@ -603,6 +605,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
603
605
|
"zoomIconMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_ICON_MIN : RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
604
606
|
"zoomTextMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_TEXT_MIN : RECOMMEND_PLACE_TEXT_ZOOM_MIN,
|
|
605
607
|
"onClick": panToCenterByPlace
|
|
608
|
+
}, null), !!enableNearbyCars && zoomRef.value >= RECOMMEND_PLACE_ZONE_ICON_MIN && createVNode(RandomCars, {
|
|
609
|
+
"center": [centerPlace.lng, centerPlace.lat]
|
|
606
610
|
}, null)];
|
|
607
611
|
}
|
|
608
612
|
});
|
|
@@ -627,7 +631,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
627
631
|
key: `${payload.supplier}${instanceNo}`,
|
|
628
632
|
on: generateCreateElementV2PropsOn(props, emit, ["loadGeoLocation", "loadDefaultGeoLocation", "changeByDrag", "changeGeoLocation", "changePlace", "changeRecomandPlace", "geoError", "geoErrorOnce", "clickLocatorText", "clickLocatorPhoto"])
|
|
629
633
|
});
|
|
630
|
-
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "geoErrorOnceNotificationKey", "unavailableTitle", "forbiddenTitle", "recomendDescription", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
|
|
634
|
+
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "geoErrorOnceNotificationKey", "unavailableTitle", "forbiddenTitle", "recomendDescription", "enableNearbyCars", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
|
|
631
635
|
export {
|
|
632
636
|
BusinessRecomendPlaceMap as B,
|
|
633
637
|
DEFAULT_ZOOM as D,
|