@heycar/heycars-map 2.9.0 → 2.11.0
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 +9 -4
- package/dist/v2/App.js +5 -3
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +4 -1
- package/dist/v2/Demo/DemoBusinessReselectPlace.js +4 -1
- package/dist/v2/api/googleRoutes.d.ts +27 -0
- package/dist/v2/api/googleRoutes.js +135 -0
- package/dist/v2/business-components/AbsoluteAddressBox/AbsoluteAddressBox.css.d.ts +3 -0
- package/dist/v2/business-components/AbsoluteAddressBox/AbsoluteAddressBox.d.ts +6 -1
- package/dist/v2/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +24 -14
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +4 -1
- package/dist/v2/components/MapProvider/MapProvider.d.ts +1 -1
- package/dist/v2/components/MapProvider/MapProvider.js +1 -1
- package/dist/v2/css/{AbsoluteAddressBox-ea4f4761.css → AbsoluteAddressBox-7502ed45.css} +31 -6
- package/dist/v2/hooks/useDrivingRoute.js +4 -4
- package/dist/v2/hooks/useMapSupplier.d.ts +1 -0
- package/dist/v2/hooks/useWalkingRoute.js +4 -4
- package/dist/v2/utils/compatibleDrivingRoute.d.ts +1 -0
- package/dist/v2/utils/compatibleDrivingRoute.js +47 -1
- package/dist/v2/utils/compatibleWalkingRoute.d.ts +1 -0
- package/dist/v2/utils/compatibleWalkingRoute.js +29 -1
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/App.js +5 -3
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +4 -1
- package/dist/v3/Demo/DemoBusinessReselectPlace.js +4 -1
- package/dist/v3/api/googleRoutes.d.ts +27 -0
- package/dist/v3/api/googleRoutes.js +135 -0
- package/dist/v3/business-components/AbsoluteAddressBox/AbsoluteAddressBox.css.d.ts +3 -0
- package/dist/v3/business-components/AbsoluteAddressBox/AbsoluteAddressBox.d.ts +6 -1
- package/dist/v3/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +22 -14
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +4 -3
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +0 -2
- package/dist/v3/components/MapProvider/MapProvider.d.ts +1 -1
- package/dist/v3/components/MapProvider/MapProvider.js +1 -1
- package/dist/v3/css/{AbsoluteAddressBox-ea4f4761.css → AbsoluteAddressBox-7502ed45.css} +31 -6
- package/dist/v3/hooks/useDrivingRoute.js +4 -4
- package/dist/v3/hooks/useMapSupplier.d.ts +1 -0
- package/dist/v3/hooks/useWalkingRoute.js +4 -4
- package/dist/v3/utils/compatibleDrivingRoute.d.ts +1 -0
- package/dist/v3/utils/compatibleDrivingRoute.js +47 -1
- package/dist/v3/utils/compatibleWalkingRoute.d.ts +1 -0
- package/dist/v3/utils/compatibleWalkingRoute.js +29 -1
- package/dist/v3/utils/log.js +1 -1
- package/package.json +2 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { apiGaodeDirectionWalking } from "../api/gaodeDirectionWalking.js";
|
|
2
2
|
import { apiGoogleDirections } from "../api/googleDirections.js";
|
|
3
|
+
import { apiGoogleRoutes } from "../api/googleRoutes.js";
|
|
3
4
|
const isIgnoredAmapTimeoutError = (err) => err === "RETURN_TIMEOUT";
|
|
4
5
|
function amapJsApiWalkingRoute(from, to, amapWalking) {
|
|
5
6
|
return new Promise((resolve, reject) => {
|
|
@@ -79,7 +80,7 @@ function gmapJsApiWalkingRoute(from, to, gmapDirectionsService) {
|
|
|
79
80
|
);
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
async function
|
|
83
|
+
async function googleServiceApiWalkingDirection(from, to, proxyUrl) {
|
|
83
84
|
const { status, routes, error_message } = await apiGoogleDirections({
|
|
84
85
|
proxyUrl,
|
|
85
86
|
mode: "WALKING",
|
|
@@ -99,9 +100,36 @@ async function googleServiceApiWalkingRoute(from, to, proxyUrl) {
|
|
|
99
100
|
throw Error(error_message != null ? error_message : status);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
103
|
+
async function googleServiceApiWalkingRoute(from, to, proxyUrl) {
|
|
104
|
+
const { routes } = await apiGoogleRoutes({
|
|
105
|
+
proxyUrl,
|
|
106
|
+
origin: {
|
|
107
|
+
location: {
|
|
108
|
+
latLng: {
|
|
109
|
+
latitude: from[1],
|
|
110
|
+
longitude: from[0]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
destination: {
|
|
115
|
+
location: {
|
|
116
|
+
latLng: {
|
|
117
|
+
latitude: to[1],
|
|
118
|
+
longitude: to[0]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const firstRoute = routes == null ? void 0 : routes[0];
|
|
124
|
+
if (!firstRoute)
|
|
125
|
+
return [];
|
|
126
|
+
const path = firstRoute.path.map(({ lng, lat }) => [lng(), lat()]);
|
|
127
|
+
return path;
|
|
128
|
+
}
|
|
102
129
|
export {
|
|
103
130
|
amapJsApiWalkingRoute,
|
|
104
131
|
gaodeServiceApiWalkingRoute,
|
|
105
132
|
gmapJsApiWalkingRoute,
|
|
133
|
+
googleServiceApiWalkingDirection,
|
|
106
134
|
googleServiceApiWalkingRoute
|
|
107
135
|
};
|
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.
|
|
3
|
+
const pkgVersion = "2.11.0";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
package/dist/v3/App.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createVNode } from "vue";
|
|
2
2
|
import { defineComponent, ref } from "vue-demi";
|
|
3
|
-
import {
|
|
3
|
+
import { DemoBusinessQuoting } from "./Demo/DemoBusinessQuoting.js";
|
|
4
4
|
import { MapProvider } from "./components/MapProvider/MapProvider.js";
|
|
5
5
|
const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
|
|
6
6
|
const gmapId = "d0af0c05331af64a";
|
|
@@ -8,7 +8,7 @@ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
|
|
|
8
8
|
const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
|
|
9
9
|
const App = /* @__PURE__ */ defineComponent({
|
|
10
10
|
setup() {
|
|
11
|
-
const supplierRef = ref("
|
|
11
|
+
const supplierRef = ref("gmap");
|
|
12
12
|
window.supplierRef = supplierRef;
|
|
13
13
|
return () => createVNode(MapProvider, {
|
|
14
14
|
"amapKey": amapApiKey,
|
|
@@ -17,13 +17,15 @@ const App = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
"gmapKey": gmapApiKey,
|
|
18
18
|
"language": "en",
|
|
19
19
|
"supplier": supplierRef.value,
|
|
20
|
+
"googleSnapRoadProxyUrl": "/overseas/maps/snapToRoads",
|
|
21
|
+
"googleRoutesProxyUrl": "/overseas/maps/routes/directions",
|
|
20
22
|
"renderLoadFailedTitle": () => supplierRef.value === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败",
|
|
21
23
|
"renderLoadFailedDescription": () => supplierRef.value === "gmap" ? "请确认您的网络能正常访问谷歌地图, \n或切回高德地图" : void 0,
|
|
22
24
|
"onSuccess": () => console.log(`${supplierRef.value} load success`),
|
|
23
25
|
"onFail": () => console.log(`${supplierRef.value} load failed`),
|
|
24
26
|
"onDownloadOptimizeEnd": () => console.log(`${supplierRef.value} load download optimize end`)
|
|
25
27
|
}, {
|
|
26
|
-
default: () => [createVNode(
|
|
28
|
+
default: () => [createVNode(DemoBusinessQuoting, null, null)]
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
});
|
|
@@ -126,7 +126,10 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
|
|
|
126
126
|
"getAvailable": () => Promise.resolve(true),
|
|
127
127
|
"getRecomendPlace": getRecomendPlace,
|
|
128
128
|
"renderPlacePhoto": (place) => {
|
|
129
|
-
return
|
|
129
|
+
return {
|
|
130
|
+
title: "图文引导",
|
|
131
|
+
src: "https://oss-now.heycars.cn/image/graphicGuidance/file/hmlh38_xs6_DdksNX0_TbgF0lKXp.jpg"
|
|
132
|
+
};
|
|
130
133
|
},
|
|
131
134
|
"renderPlaceTag": (place) => {
|
|
132
135
|
return "最近使用";
|
|
@@ -130,7 +130,10 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
|
|
|
130
130
|
"getAvailable": () => Promise.resolve(true),
|
|
131
131
|
"getRecomendPlace": getRecomendPlace,
|
|
132
132
|
"renderPlacePhoto": (place) => {
|
|
133
|
-
return
|
|
133
|
+
return {
|
|
134
|
+
title: "图文引导",
|
|
135
|
+
src: "https://oss-now.heycars.cn/image/graphicGuidance/file/hmlh38_xs6_DdksNX0_TbgF0lKXp.jpg"
|
|
136
|
+
};
|
|
134
137
|
},
|
|
135
138
|
"renderPlaceTag": (place) => {
|
|
136
139
|
return "最近使用";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import type { protos } from "@googlemaps/routing";
|
|
3
|
+
type GoogleRoutesMeasurableObject = {
|
|
4
|
+
distanceMeters?: number;
|
|
5
|
+
staticDuration?: string;
|
|
6
|
+
staticDurationSeconds?: number;
|
|
7
|
+
duration?: string;
|
|
8
|
+
durationSeconds?: number;
|
|
9
|
+
};
|
|
10
|
+
type GoogleRoutesStep = Omit<protos.google.maps.routing.v2.IRouteLegStep, "staticDuration"> & GoogleRoutesMeasurableObject & {
|
|
11
|
+
path: google.maps.LatLng[];
|
|
12
|
+
};
|
|
13
|
+
type GoogleRoutesLeg = Omit<protos.google.maps.routing.v2.IRouteLeg, "steps" | "staticDuration" | "duration"> & GoogleRoutesMeasurableObject & {
|
|
14
|
+
steps: GoogleRoutesStep[];
|
|
15
|
+
};
|
|
16
|
+
type GoogleRoutesRoute = Omit<protos.google.maps.routing.v2.IRoute, "legs" | "staticDuration" | "duration"> & GoogleRoutesMeasurableObject & {
|
|
17
|
+
legs: GoogleRoutesLeg[];
|
|
18
|
+
path: google.maps.LatLng[];
|
|
19
|
+
};
|
|
20
|
+
export interface GoogleRoutesResponse {
|
|
21
|
+
routes: GoogleRoutesRoute[];
|
|
22
|
+
}
|
|
23
|
+
interface ApiGoogleRoutesProps extends protos.google.maps.routing.v2.IComputeRoutesRequest {
|
|
24
|
+
proxyUrl?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function apiGoogleRoutes(props: ApiGoogleRoutesProps): Promise<GoogleRoutesResponse>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { googleEncodedPolyline2googleLatLng } from "../utils/transform.js";
|
|
2
|
+
import { isProxyServiceError, createTypeError } from "../utils/typeChecking.js";
|
|
3
|
+
const ALL_ROUTES_STATUS = [
|
|
4
|
+
"OK",
|
|
5
|
+
"CANCELLED",
|
|
6
|
+
"UNKNOWN",
|
|
7
|
+
"INVALID_ARGUMENT",
|
|
8
|
+
"DEADLINE_EXCEEDED",
|
|
9
|
+
"NOT_FOUND",
|
|
10
|
+
"ALREADY_EXISTS",
|
|
11
|
+
"PERMISSION_DENIED",
|
|
12
|
+
"UNAUTHENTICATED",
|
|
13
|
+
"RESOURCE_EXHAUSTED",
|
|
14
|
+
"FAILED_PRECONDITION",
|
|
15
|
+
"ABORTED",
|
|
16
|
+
"OUT_OF_RANGE",
|
|
17
|
+
"UNIMPLEMENTED",
|
|
18
|
+
"INTERNAL",
|
|
19
|
+
"UNAVAILABLE",
|
|
20
|
+
"DATA_LOSS"
|
|
21
|
+
];
|
|
22
|
+
const isGoogleRoutesStatus = (value) => {
|
|
23
|
+
return typeof value === "string" && ALL_ROUTES_STATUS.includes(value);
|
|
24
|
+
};
|
|
25
|
+
const isGoogleRoutesError = (value) => {
|
|
26
|
+
return typeof value === "object" && value !== null && "error" in value && typeof value.error === "object" && value.error !== null && "code" in value.error && typeof value.error.code === "number" && "message" in value.error && typeof value.error.message === "string" && "status" in value.error && isGoogleRoutesStatus(value.error.status);
|
|
27
|
+
};
|
|
28
|
+
const isGoogleRoutesMeasurableObject = (value) => {
|
|
29
|
+
if (typeof value !== "object" || value === null || !("distanceMeters" in value) || typeof value.distanceMeters !== "number" || !("staticDuration" in value) || typeof value.staticDuration !== "string" || !value.staticDuration.endsWith("s")) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
value.staticDurationSeconds = Number(
|
|
33
|
+
value.staticDuration.slice(0, -1)
|
|
34
|
+
);
|
|
35
|
+
if (!("duration" in value))
|
|
36
|
+
return true;
|
|
37
|
+
if (typeof value.duration !== "string" || !value.duration.endsWith("s"))
|
|
38
|
+
return false;
|
|
39
|
+
value.durationSeconds = Number(value.duration.slice(0, -1));
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
const isGoogleRoutesPolyline = (value) => {
|
|
43
|
+
return typeof value === "object" && value !== null && "encodedPolyline" in value && typeof value.encodedPolyline === "string";
|
|
44
|
+
};
|
|
45
|
+
function assertGoogleRoutesStep(value) {
|
|
46
|
+
const error = createTypeError("GoogleRoutesStep", value);
|
|
47
|
+
if (!isGoogleRoutesMeasurableObject(value))
|
|
48
|
+
throw error;
|
|
49
|
+
if (!("polyline" in value) || value.polyline === null) {
|
|
50
|
+
value.path = [];
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (!isGoogleRoutesPolyline(value.polyline))
|
|
54
|
+
throw error;
|
|
55
|
+
value.path = googleEncodedPolyline2googleLatLng(
|
|
56
|
+
value.polyline.encodedPolyline
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function assertGoogleRoutesLeg(value) {
|
|
60
|
+
if (!isGoogleRoutesMeasurableObject(value) || !("steps" in value) || !Array.isArray(value.steps))
|
|
61
|
+
throw createTypeError("GoogleRoutesLeg", value);
|
|
62
|
+
try {
|
|
63
|
+
for (const step of value.steps) {
|
|
64
|
+
assertGoogleRoutesStep(step);
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {
|
|
67
|
+
const { message: detail } = error;
|
|
68
|
+
throw createTypeError("GoogleRoutesLeg", value, detail);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function assertGoogleRoutesRoute(value) {
|
|
72
|
+
if (typeof value !== "object" || value === null || !("legs" in value) || !Array.isArray(value.legs) || !("polyline" in value) || !isGoogleRoutesPolyline(value.polyline))
|
|
73
|
+
throw createTypeError("GoogleRoutesRoute", value);
|
|
74
|
+
value.path = googleEncodedPolyline2googleLatLng(
|
|
75
|
+
value.polyline.encodedPolyline
|
|
76
|
+
);
|
|
77
|
+
try {
|
|
78
|
+
for (const leg of value.legs) {
|
|
79
|
+
assertGoogleRoutesLeg(leg);
|
|
80
|
+
}
|
|
81
|
+
} catch (error) {
|
|
82
|
+
const { message: detail } = error;
|
|
83
|
+
throw createTypeError("GoogleRoutesRoute", value, detail);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function assertGoogleRoutesResponse(value) {
|
|
87
|
+
if (typeof value !== "object" || value === null || !("routes" in value) || !Array.isArray(value.routes))
|
|
88
|
+
throw createTypeError("GoogleRoutesResponse", value);
|
|
89
|
+
try {
|
|
90
|
+
for (const route of value.routes) {
|
|
91
|
+
assertGoogleRoutesRoute(route);
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
const { message: detail } = error;
|
|
95
|
+
throw createTypeError("GoogleRoutesResponse", value, detail);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function apiGoogleRoutes(props) {
|
|
99
|
+
const { proxyUrl, ...request } = props;
|
|
100
|
+
if (!proxyUrl) {
|
|
101
|
+
console.warn("Warning: google routes service is bypassed due to proxyUrl is not provided!");
|
|
102
|
+
return { routes: [] };
|
|
103
|
+
}
|
|
104
|
+
const { protocol, host } = location;
|
|
105
|
+
const baseUrl = proxyUrl.startsWith(protocol) ? void 0 : `${protocol}//${host}`;
|
|
106
|
+
const url = new URL(proxyUrl, baseUrl);
|
|
107
|
+
const response = await fetch(url, {
|
|
108
|
+
method: "POST",
|
|
109
|
+
headers: { "Content-Type": "application/json" },
|
|
110
|
+
body: JSON.stringify(request)
|
|
111
|
+
});
|
|
112
|
+
if (response.ok) {
|
|
113
|
+
const result = await response.json();
|
|
114
|
+
assertGoogleRoutesResponse(result);
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
const error = await response.json();
|
|
118
|
+
if (isProxyServiceError(error)) {
|
|
119
|
+
const { code, msg } = error;
|
|
120
|
+
throw new Error(`apiGoogleRoutes proxy failed code: ${code}, msg: ${msg}`);
|
|
121
|
+
}
|
|
122
|
+
if (isGoogleRoutesError(error)) {
|
|
123
|
+
const {
|
|
124
|
+
error: { status, message }
|
|
125
|
+
} = error;
|
|
126
|
+
throw new Error(`apiGoogleRoutes failed status: ${status}, message:
|
|
127
|
+
${message}`);
|
|
128
|
+
}
|
|
129
|
+
throw new Error(
|
|
130
|
+
`apiGoogleRoutes failed with unrecognized server response: ${JSON.stringify(error)}`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
apiGoogleRoutes
|
|
135
|
+
};
|
|
@@ -15,6 +15,9 @@ export declare const boxTextLayout: import("@vanilla-extract/recipes").RuntimeFn
|
|
|
15
15
|
}>;
|
|
16
16
|
export declare const boxPhotoLayout: string;
|
|
17
17
|
export declare const boxPhoto: string;
|
|
18
|
+
export declare const boxPhotoDescriptionLayout: string;
|
|
19
|
+
export declare const boxPhotoArrow: string;
|
|
20
|
+
export declare const boxPhotoDescription: string;
|
|
18
21
|
export declare const boxPhotoIcon: string;
|
|
19
22
|
export declare const boxTitle: string;
|
|
20
23
|
export declare const boxDescription: string;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
interface AddressBoxPhoto {
|
|
2
|
+
src: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
}
|
|
1
5
|
export interface AbsoluteAddressBoxProps {
|
|
2
6
|
type: "box" | "locator" | "loading";
|
|
3
7
|
title: string;
|
|
4
8
|
description?: string;
|
|
5
|
-
photo?:
|
|
9
|
+
photo?: AddressBoxPhoto;
|
|
6
10
|
withArrow?: boolean;
|
|
7
11
|
onClickText?: () => any;
|
|
8
12
|
onClickPhoto?: () => any;
|
|
@@ -10,3 +14,4 @@ export interface AbsoluteAddressBoxProps {
|
|
|
10
14
|
export declare const AbsoluteAddressBox: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<AbsoluteAddressBoxProps>, 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<AbsoluteAddressBoxProps, Required<AbsoluteAddressBoxProps>>, "clickText" | "clickPhoto", import("vue-demi").PublicProps, AbsoluteAddressBoxProps, AbsoluteAddressBoxProps, import("vue-demi").SlotsType<{} & {
|
|
11
15
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
12
16
|
}>>;
|
|
17
|
+
export {};
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import "../../css/AbsoluteAddressBox-
|
|
1
|
+
import "../../css/AbsoluteAddressBox-7502ed45.css";
|
|
2
2
|
import { createVNode } from "vue";
|
|
3
3
|
import { computed } from "vue-demi";
|
|
4
|
-
import { ICON_DOT_LOADING_URL
|
|
4
|
+
import { ICON_DOT_LOADING_URL } from "../../api/cdn.js";
|
|
5
5
|
import { i as imgAddressLocator } from "../../chunks/address-locator.98305e58.js";
|
|
6
6
|
import { i as imgArrowRight } from "../../chunks/arrow-right.eedc7433.js";
|
|
7
7
|
import { defineSetup } from "../../types/helper.js";
|
|
8
8
|
import { c as createRuntimeFn } from "../../chunks/vanilla-extract-recipes-createRuntimeFn.esm.bd6fc290.js";
|
|
9
9
|
const imgBubbleRightArc = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTAgMGgyLjEzMWExMCAxMCAwIDAxOS42OTYgNy41NTJMMTggMzJILjA0MkwwIDB6IiBmaWxsPSIjMjUzRTdBIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=";
|
|
10
|
+
const imgGuideArrow = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHdpZHRoPSIyIiBoZWlnaHQ9IjYiPgogIDxwYXRoIGQ9Ik0uNTE2IDEuMTAzQS4zLjMgMCAwMDAgMS4zMXYyLjY2OGEuMy4zIDAgMDAuNTE2LjIwOEwxLjggMi44NTNhLjMuMyAwIDAwMC0uNDE2TC41MTYgMS4xMDN6IiBmaWxsPSIjRkZGIiAvPgo8L3N2Zz4=";
|
|
10
11
|
const AbsoluteAddressBox_css_ts_vanilla = "";
|
|
11
12
|
var absoluteAddressBox = "n8tgem1";
|
|
12
13
|
var absoluteAddressBoxLayout = "n8tgem0";
|
|
13
|
-
var arrowRight = "
|
|
14
|
+
var arrowRight = "n8tgemj";
|
|
14
15
|
var boxBody = "n8tgem2";
|
|
15
16
|
var boxHeader = "n8tgem3";
|
|
16
17
|
var boxHeaderIcon = "n8tgem4";
|
|
17
18
|
var boxHeaderText = "n8tgem5";
|
|
18
19
|
var boxPhoto = "n8tgemb";
|
|
19
|
-
var
|
|
20
|
+
var boxPhotoArrow = "n8tgemd";
|
|
21
|
+
var boxPhotoDescription = "n8tgeme";
|
|
22
|
+
var boxPhotoDescriptionLayout = "n8tgemc";
|
|
20
23
|
var boxPhotoLayout = "n8tgema";
|
|
21
24
|
var boxTextClickableArea = "n8tgem6";
|
|
22
25
|
var boxTextLayout = createRuntimeFn({ defaultClassName: "n8tgem7", variantClassNames: { withArrow: { true: "n8tgem8", false: "n8tgem9" } }, defaultVariants: {}, compoundVariants: [] });
|
|
23
|
-
var boxTitle = "
|
|
24
|
-
var imgDotLoading = "
|
|
25
|
-
var locatorIcon = "
|
|
26
|
-
var straightLine = "
|
|
26
|
+
var boxTitle = "n8tgemg";
|
|
27
|
+
var imgDotLoading = "n8tgemi";
|
|
28
|
+
var locatorIcon = "n8tgeml";
|
|
29
|
+
var straightLine = "n8tgemk";
|
|
27
30
|
const MultilineTitle = defineSetup("MultilineTitle", function(props, {
|
|
28
31
|
attrs
|
|
29
32
|
}) {
|
|
@@ -80,16 +83,21 @@ const AbsoluteAddressBox = defineSetup("AbsoluteAddressBox", function(props, {
|
|
|
80
83
|
"src": imgBubbleRightArc
|
|
81
84
|
}, null)]), createVNode("div", {
|
|
82
85
|
"class": boxBody
|
|
83
|
-
}, [!!photo && createVNode("div", {
|
|
86
|
+
}, [!!(photo == null ? void 0 : photo.src) && createVNode("div", {
|
|
84
87
|
"class": boxPhotoLayout
|
|
85
88
|
}, [createVNode("img", {
|
|
86
89
|
"class": boxPhoto,
|
|
87
|
-
"src": photo,
|
|
90
|
+
"src": photo.src,
|
|
88
91
|
"onClick": handleClickPhoto
|
|
89
|
-
}, null), createVNode("
|
|
90
|
-
"class":
|
|
91
|
-
"
|
|
92
|
-
},
|
|
92
|
+
}, null), !!photo.title && createVNode("div", {
|
|
93
|
+
"class": boxPhotoDescriptionLayout,
|
|
94
|
+
"onClick": handleClickPhoto
|
|
95
|
+
}, [createVNode("div", {
|
|
96
|
+
"class": boxPhotoDescription
|
|
97
|
+
}, [photo.title]), createVNode("img", {
|
|
98
|
+
"class": boxPhotoArrow,
|
|
99
|
+
"src": imgGuideArrow
|
|
100
|
+
}, null)])]), createVNode("div", {
|
|
93
101
|
"class": boxTextClickableArea,
|
|
94
102
|
"onClick": handleClickText
|
|
95
103
|
}, [createVNode("div", {
|
|
@@ -33,7 +33,10 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
33
33
|
geoErrorOnceNotificationKey?: string;
|
|
34
34
|
mapContext: CoordinatifyProps<BusinessRecomendPlaceContext>;
|
|
35
35
|
defaultCenterPlace?: CoordinatePlace | ((place?: CoordinatePlace) => CoordinatePlace | undefined);
|
|
36
|
-
renderPlacePhoto?: (place: CoordinatePlace) =>
|
|
36
|
+
renderPlacePhoto?: (place: CoordinatePlace) => undefined | {
|
|
37
|
+
src: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
};
|
|
37
40
|
renderPlaceTag?: PickupPointsProps["renderPlaceTag"];
|
|
38
41
|
onLoadGeoLocation?: Coordinatify<UseGeoLocationProps["onLoad"]>;
|
|
39
42
|
onLoadDefaultGeoLocation?: Coordinatify<UseGeoLocationProps["onLoadDefault"]>;
|
|
@@ -47,7 +50,6 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
47
50
|
onClickLocatorPhoto?: AbsoluteAddressBoxProps["onClickPhoto"];
|
|
48
51
|
}
|
|
49
52
|
export declare const BusinessRecomendPlaceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "changePlace" | "loadGeoLocation" | "loadDefaultGeoLocation" | "changeByDrag" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", import("vue-demi").PublicProps, BusinessRecomendPlaceMapProps, BusinessRecomendPlaceMapProps, import("vue-demi").SlotsType<{
|
|
50
|
-
renderPlacePhoto?: ((place: CoordinatePlace) => string | undefined) | undefined;
|
|
51
53
|
renderPlaceTag?: PickupPointsProps["renderPlaceTag"];
|
|
52
54
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
53
55
|
loading?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
@@ -56,7 +58,6 @@ export declare const BusinessRecomendPlaceMapInner: import("vue-demi").DefineCom
|
|
|
56
58
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
57
59
|
}>>;
|
|
58
60
|
export declare const BusinessRecomendPlaceMap: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "changePlace" | "loadGeoLocation" | "loadDefaultGeoLocation" | "changeByDrag" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", import("vue-demi").PublicProps, BusinessRecomendPlaceMapProps, BusinessRecomendPlaceMapProps, import("vue-demi").SlotsType<{
|
|
59
|
-
renderPlacePhoto?: ((place: CoordinatePlace) => string | undefined) | undefined;
|
|
60
61
|
renderPlaceTag?: PickupPointsProps["renderPlaceTag"];
|
|
61
62
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
62
63
|
loading?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
@@ -7,7 +7,6 @@ export declare const BusinessReselectPlaceMapInner: import("vue-demi").DefineCom
|
|
|
7
7
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
8
8
|
loading?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
9
9
|
renderPlaceTag?: ((place: Place) => string | undefined) | undefined;
|
|
10
|
-
renderPlacePhoto?: ((place: CoordinatePlace) => string | undefined) | undefined;
|
|
11
10
|
} & {
|
|
12
11
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
13
12
|
}>>;
|
|
@@ -15,7 +14,6 @@ export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponen
|
|
|
15
14
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
16
15
|
loading?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
17
16
|
renderPlaceTag?: ((place: Place) => string | undefined) | undefined;
|
|
18
|
-
renderPlacePhoto?: ((place: CoordinatePlace) => string | undefined) | undefined;
|
|
19
17
|
} & {
|
|
20
18
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
21
19
|
}>>;
|
|
@@ -5,7 +5,7 @@ import { Status, type GmapLoaderProps, type UseMapLoaderProps } from "../../hook
|
|
|
5
5
|
import { type MapSupplierPayolad } from "../../hooks/useMapSupplier";
|
|
6
6
|
import type { AmapMap } from "../../types/interface";
|
|
7
7
|
import { type AmapProps } from "../Amap";
|
|
8
|
-
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleSnapRoadProxyUrl" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
|
|
8
|
+
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
|
|
9
9
|
export declare const MapProvider: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<MapProviderProps>, 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<MapProviderProps, Required<MapProviderProps>>, "success" | "fail" | "downloadOptimizeEnd", import("vue-demi").PublicProps, MapProviderProps, MapProviderProps, import("vue-demi").SlotsType<{
|
|
10
10
|
renderLoadFailedTitle?: ((status: Status) => string | undefined) | undefined;
|
|
11
11
|
renderLoadFailedDescription?: ((status: Status) => string | undefined) | undefined;
|
|
@@ -53,7 +53,7 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
|
|
|
53
53
|
var _a;
|
|
54
54
|
return createVNode("div", null, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
55
55
|
};
|
|
56
|
-
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleSnapRoadProxyUrl", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
|
|
56
|
+
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
|
|
57
57
|
const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
58
58
|
slots,
|
|
59
59
|
emit,
|
|
@@ -69,6 +69,31 @@
|
|
|
69
69
|
height: 100%;
|
|
70
70
|
}
|
|
71
71
|
.n8tgemc {
|
|
72
|
+
position: absolute;
|
|
73
|
+
bottom: 0;
|
|
74
|
+
left: 0;
|
|
75
|
+
right: 0;
|
|
76
|
+
height: 3.6vw;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
align-items: center;
|
|
81
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
82
|
+
}
|
|
83
|
+
.n8tgemd {
|
|
84
|
+
margin-left: 0.6vw;
|
|
85
|
+
margin-top: 0.2vw;
|
|
86
|
+
width: 0.6vw;
|
|
87
|
+
height: 1.8vw;
|
|
88
|
+
}
|
|
89
|
+
.n8tgeme {
|
|
90
|
+
font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
|
|
91
|
+
font-weight: 500;
|
|
92
|
+
font-size: 2.1vw;
|
|
93
|
+
color: #FFFFFF;
|
|
94
|
+
line-height: 1;
|
|
95
|
+
}
|
|
96
|
+
.n8tgemf {
|
|
72
97
|
pointer-events: none;
|
|
73
98
|
position: absolute;
|
|
74
99
|
right: 0.045vw;
|
|
@@ -76,7 +101,7 @@
|
|
|
76
101
|
width: 3.74vw;
|
|
77
102
|
height: 3.74vw;
|
|
78
103
|
}
|
|
79
|
-
.
|
|
104
|
+
.n8tgemg {
|
|
80
105
|
display: -webkit-box;
|
|
81
106
|
font-size: 3.47vw;
|
|
82
107
|
font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_SEMI_BOLD);
|
|
@@ -87,7 +112,7 @@
|
|
|
87
112
|
-webkit-box-orient: vertical;
|
|
88
113
|
overflow: hidden;
|
|
89
114
|
}
|
|
90
|
-
.
|
|
115
|
+
.n8tgemh {
|
|
91
116
|
margin-top: 0.53vw;
|
|
92
117
|
font-size: 2.93vw;
|
|
93
118
|
font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
|
|
@@ -96,22 +121,22 @@
|
|
|
96
121
|
line-height: 4.27vw;
|
|
97
122
|
opacity: 0.8;
|
|
98
123
|
}
|
|
99
|
-
.
|
|
124
|
+
.n8tgemi {
|
|
100
125
|
margin: 1.865vw 0;
|
|
101
126
|
width: 7.467vw;
|
|
102
127
|
height: 1.6vw;
|
|
103
128
|
}
|
|
104
|
-
.
|
|
129
|
+
.n8tgemj {
|
|
105
130
|
width: 1.758vw;
|
|
106
131
|
height: 2.93vw;
|
|
107
132
|
}
|
|
108
|
-
.
|
|
133
|
+
.n8tgemk {
|
|
109
134
|
width: 0.8vw;
|
|
110
135
|
height: 4vw;
|
|
111
136
|
background: #4C80FF;
|
|
112
137
|
border-radius: 0vw 0vw 26.67vw 26.67vw;
|
|
113
138
|
}
|
|
114
|
-
.
|
|
139
|
+
.n8tgeml {
|
|
115
140
|
width: 6.9355vw;
|
|
116
141
|
height: 10.67vw;
|
|
117
142
|
}
|
|
@@ -4,7 +4,7 @@ import { googleServiceApiDrivingRoute, amapJsApiDrivingRoute, gaodeServiceApiDri
|
|
|
4
4
|
import { inTaiwan, inKorean } from "./useMapInChina.js";
|
|
5
5
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
6
6
|
const useADrivingRoute = (props) => {
|
|
7
|
-
const {
|
|
7
|
+
const { googleRoutesProxyUrl } = useMapSupplier();
|
|
8
8
|
const outputRoute = reactive({
|
|
9
9
|
path: [],
|
|
10
10
|
distance: 0,
|
|
@@ -15,7 +15,7 @@ const useADrivingRoute = (props) => {
|
|
|
15
15
|
});
|
|
16
16
|
const amapDriving = new AMap.Driving({});
|
|
17
17
|
const apiMapDrivingRoute = (from, to) => {
|
|
18
|
-
return
|
|
18
|
+
return googleRoutesProxyUrl && inTaiwan(from) ? googleServiceApiDrivingRoute(from, to, googleRoutesProxyUrl) : amapJsApiDrivingRoute(from, to, amapDriving);
|
|
19
19
|
};
|
|
20
20
|
watchPostEffectForDeepOption(
|
|
21
21
|
() => {
|
|
@@ -31,11 +31,11 @@ const useADrivingRoute = (props) => {
|
|
|
31
31
|
return { route: outputRoute, apiMapDrivingRoute };
|
|
32
32
|
};
|
|
33
33
|
const useGDrivingRoute = (props) => {
|
|
34
|
-
const { gaodeDirectionDrivingProxyUrl } = useMapSupplier();
|
|
34
|
+
const { gaodeDirectionDrivingProxyUrl, googleRoutesProxyUrl } = useMapSupplier();
|
|
35
35
|
const outputRoute = reactive({ path: [], distance: 0, duration: 0, steps: [] });
|
|
36
36
|
const gmapDirectionsService = new google.maps.DirectionsService();
|
|
37
37
|
const apiMapDrivingRoute = (from, to) => {
|
|
38
|
-
return gaodeDirectionDrivingProxyUrl && inKorean(from) ? gaodeServiceApiDrivingRoute(from, to, gaodeDirectionDrivingProxyUrl) : gmapJsApiDrivingRoute(from, to, gmapDirectionsService);
|
|
38
|
+
return gaodeDirectionDrivingProxyUrl && inKorean(from) ? gaodeServiceApiDrivingRoute(from, to, gaodeDirectionDrivingProxyUrl) : googleRoutesProxyUrl ? googleServiceApiDrivingRoute(from, to, googleRoutesProxyUrl) : gmapJsApiDrivingRoute(from, to, gmapDirectionsService);
|
|
39
39
|
};
|
|
40
40
|
watchPostEffectForDeepOption(
|
|
41
41
|
() => {
|
|
@@ -10,6 +10,7 @@ export interface MapSupplierPayolad extends UseMapLoaderProps {
|
|
|
10
10
|
gaodeDirectionDrivingProxyUrl?: string;
|
|
11
11
|
gaodeDirectionWalkingProxyUrl?: string;
|
|
12
12
|
googleDirectionsProxyUrl?: string;
|
|
13
|
+
googleRoutesProxyUrl?: string;
|
|
13
14
|
googleSnapRoadProxyUrl?: string;
|
|
14
15
|
renderLoadFailedTitle?: (status: Status) => string | undefined;
|
|
15
16
|
renderLoadFailedDescription?: (status: Status) => string | undefined;
|
|
@@ -4,11 +4,11 @@ import { googleServiceApiWalkingRoute, amapJsApiWalkingRoute, gaodeServiceApiWal
|
|
|
4
4
|
import { inTaiwan, inKorean } from "./useMapInChina.js";
|
|
5
5
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
6
6
|
const useAWalkingRoute = (props) => {
|
|
7
|
-
const {
|
|
7
|
+
const { googleRoutesProxyUrl } = useMapSupplier();
|
|
8
8
|
const pathRef = shallowRef([]);
|
|
9
9
|
const amapWalking = new AMap.Walking({});
|
|
10
10
|
const apiMapWalkingRoute = (from, to) => {
|
|
11
|
-
return
|
|
11
|
+
return googleRoutesProxyUrl && inTaiwan(from) ? googleServiceApiWalkingRoute(from, to, googleRoutesProxyUrl) : amapJsApiWalkingRoute(from, to, amapWalking);
|
|
12
12
|
};
|
|
13
13
|
watchPostEffectForDeepOption(
|
|
14
14
|
() => {
|
|
@@ -24,13 +24,13 @@ const useAWalkingRoute = (props) => {
|
|
|
24
24
|
return pathRef;
|
|
25
25
|
};
|
|
26
26
|
const useGWalkingRoute = (props) => {
|
|
27
|
-
const { gaodeDirectionWalkingProxyUrl } = useMapSupplier();
|
|
27
|
+
const { gaodeDirectionWalkingProxyUrl, googleRoutesProxyUrl } = useMapSupplier();
|
|
28
28
|
const pathRef = shallowRef([]);
|
|
29
29
|
const gmapDirectionsService = new google.maps.DirectionsService();
|
|
30
30
|
const apiMapWalkingRoute = (from, to) => {
|
|
31
31
|
if (inKorean(from))
|
|
32
32
|
return Promise.resolve([]);
|
|
33
|
-
return gaodeDirectionWalkingProxyUrl && inKorean(from) ? gaodeServiceApiWalkingRoute(from, to, gaodeDirectionWalkingProxyUrl) : gmapJsApiWalkingRoute(from, to, gmapDirectionsService);
|
|
33
|
+
return gaodeDirectionWalkingProxyUrl && inKorean(from) ? gaodeServiceApiWalkingRoute(from, to, gaodeDirectionWalkingProxyUrl) : googleRoutesProxyUrl ? googleServiceApiWalkingRoute(from, to, googleRoutesProxyUrl) : gmapJsApiWalkingRoute(from, to, gmapDirectionsService);
|
|
34
34
|
};
|
|
35
35
|
watchPostEffectForDeepOption(
|
|
36
36
|
() => {
|
|
@@ -3,4 +3,5 @@ import type { Point, Route } from "../types/interface";
|
|
|
3
3
|
export declare function amapJsApiDrivingRoute(from: Point, to: Point, amapDriving: AMap.Driving): Promise<Route>;
|
|
4
4
|
export declare function gaodeServiceApiDrivingRoute(from: Point, to: Point, proxyUrl: string): Promise<Route>;
|
|
5
5
|
export declare function gmapJsApiDrivingRoute(from: Point, to: Point, gmapDirectionsService: google.maps.DirectionsService): Promise<Route>;
|
|
6
|
+
export declare function googleServiceApiDrivingDirection(from: Point, to: Point, proxyUrl: string): Promise<Route>;
|
|
6
7
|
export declare function googleServiceApiDrivingRoute(from: Point, to: Point, proxyUrl: string): Promise<Route>;
|