@heycar/heycars-map 2.0.0-switchMap1 → 2.0.0-switchMap2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -29
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/v2/App.js +5 -3
- package/dist/v2/Demo/DemoBusinessQuoting.js +3 -2
- package/dist/v2/api/cdn.d.ts +1 -0
- package/dist/v2/api/cdn.js +2 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/v2/chunks/{Loading.fc6e75d0.js → Loading.da68a2a6.js} +31 -1
- package/dist/v2/chunks/throttle.8bdd8d3b.js +20 -0
- package/dist/v2/components/Loading/Loading.css.d.ts +5 -0
- package/dist/v2/components/Loading/Loading.d.ts +6 -0
- package/dist/v2/components/Loading/Loading.js +3 -1
- package/dist/v2/components/Loading/index.js +2 -1
- package/dist/v2/components/MapProvider/MapProvider.d.ts +2 -2
- package/dist/v2/components/MapProvider/MapProvider.js +16 -9
- package/dist/v2/css/Loading-0e058b68.css +51 -0
- package/dist/v2/hooks/useDeviceOrientation.js +1 -17
- package/dist/v2/hooks/useMapGCJ02.js +1 -3
- package/dist/v2/hooks/useMapGraspRoad.js +1 -2
- package/dist/v2/hooks/useMapInChina.d.ts +3 -15
- package/dist/v2/hooks/useMapInChina.js +11 -16
- package/dist/v2/hooks/useMapLoader.d.ts +10 -6
- package/dist/v2/hooks/useMapLoader.js +85 -59
- package/dist/v2/hooks/useMapPlace.js +1 -2
- package/dist/v2/hooks/useMapSupplier.d.ts +2 -0
- package/dist/v2/hooks-business/useBusinessQuotingMap.d.ts +2 -0
- package/dist/v2/hooks-business/useBusinessQuotingMap.js +7 -2
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/App.js +5 -3
- package/dist/v3/Demo/DemoBusinessQuoting.js +4 -3
- package/dist/v3/api/cdn.d.ts +1 -0
- package/dist/v3/api/cdn.js +2 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/v3/chunks/{Loading.a8e2f26a.js → Loading.98d687c0.js} +27 -1
- package/dist/v3/chunks/throttle.8bdd8d3b.js +20 -0
- package/dist/v3/components/Loading/Loading.css.d.ts +5 -0
- package/dist/v3/components/Loading/Loading.d.ts +8 -0
- package/dist/v3/components/Loading/Loading.js +3 -1
- package/dist/v3/components/Loading/index.js +2 -1
- package/dist/v3/components/MapProvider/MapProvider.d.ts +6 -3
- package/dist/v3/components/MapProvider/MapProvider.js +14 -9
- package/dist/v3/css/Loading-0e058b68.css +51 -0
- package/dist/v3/hooks/useDeviceOrientation.js +1 -17
- package/dist/v3/hooks/useMapGCJ02.js +1 -3
- package/dist/v3/hooks/useMapGraspRoad.js +1 -2
- package/dist/v3/hooks/useMapInChina.d.ts +3 -15
- package/dist/v3/hooks/useMapInChina.js +11 -16
- package/dist/v3/hooks/useMapLoader.d.ts +10 -6
- package/dist/v3/hooks/useMapLoader.js +85 -59
- package/dist/v3/hooks/useMapPlace.js +1 -2
- package/dist/v3/hooks/useMapSupplier.d.ts +2 -0
- package/dist/v3/hooks-business/useBusinessQuotingMap.d.ts +2 -0
- package/dist/v3/hooks-business/useBusinessQuotingMap.js +7 -2
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
- package/dist/v2/css/Loading-523061b9.css +0 -9
- package/dist/v3/css/Loading-523061b9.css +0 -9
package/README.md
CHANGED
|
@@ -120,6 +120,12 @@ export interface BusinessGeolocationPositionError extends GeolocationPositionErr
|
|
|
120
120
|
gmapKey={gmapApiKey}
|
|
121
121
|
// 使用哪个地图供应商,目前两个供应商: amap 高德 / gmap 谷歌
|
|
122
122
|
supplier={"amap"}
|
|
123
|
+
// 地图加载失败时显示的标题
|
|
124
|
+
renderLoadFailedTitle={() => (supplier === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败")}
|
|
125
|
+
// 地图加载失败时显示的描述
|
|
126
|
+
renderLoadFailedDescription={() =>
|
|
127
|
+
supplier === "gmap" ? "请确认您的网络能正常访问谷歌地图, \n或切回高德地图" : undefined
|
|
128
|
+
}
|
|
123
129
|
>
|
|
124
130
|
...
|
|
125
131
|
</MapProvider>
|
|
@@ -134,6 +140,8 @@ export interface BusinessGeolocationPositionError extends GeolocationPositionErr
|
|
|
134
140
|
:amap-key="amapApiKey"
|
|
135
141
|
:amap-secret="amapApiSecret"
|
|
136
142
|
supplier="amap"
|
|
143
|
+
render-load-failed-title='() => supplier === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败"'
|
|
144
|
+
render-load-failed-description='() => supplier === "gmap" ? "请确认您的网络能正常访问谷歌地图,\n或切回高德地图" : undefined'
|
|
137
145
|
>
|
|
138
146
|
...
|
|
139
147
|
</MapProvider>
|
|
@@ -431,36 +439,42 @@ import { BusinessQuotingMap, useBusinessQuotingMap } from "@heycar/heycars-map";
|
|
|
431
439
|
|
|
432
440
|
export default defineComponent({
|
|
433
441
|
setup() {
|
|
434
|
-
const { mapContext } = useBusinessQuotingMap();
|
|
442
|
+
const { mapContext, toAmapCoordinateType } = useBusinessQuotingMap();
|
|
435
443
|
return () => (
|
|
436
|
-
<
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
444
|
+
<div>
|
|
445
|
+
<BusinessQuotingMap
|
|
446
|
+
class={"demo"}
|
|
447
|
+
from={{
|
|
448
|
+
displayName: "The Malayan Council",
|
|
449
|
+
name: "10 Winstedt Rd, #01-17, Singapore 227977",
|
|
450
|
+
type: "wgs84",
|
|
451
|
+
lat: 1.311295,
|
|
452
|
+
lng: 103.841974,
|
|
453
|
+
}}
|
|
454
|
+
to={{
|
|
455
|
+
displayName: "CDG Engie Charging Station",
|
|
456
|
+
name: "21 Kent Ridge Rd, Singapore 119220",
|
|
457
|
+
type: "wgs84",
|
|
458
|
+
lat: 1.2966426,
|
|
459
|
+
lng: 103.7763939,
|
|
460
|
+
}}
|
|
461
|
+
fromDescription={"您将在此上车"}
|
|
462
|
+
renderDescription={({ distance, duration, tolls }) =>
|
|
463
|
+
`全程 *${distance / 1000}公里* 约行驶 *${duration}* 高速费用 *${tolls ?? 0}*元`
|
|
464
|
+
}
|
|
465
|
+
mapContext={mapContext}
|
|
466
|
+
onClickStartPoint={(place) => console.log("点击起点时触发 palce = ", place)}
|
|
467
|
+
onClickEndPoint={(place) => console.log("点击终点时触发 palce = ", place)}
|
|
468
|
+
onChangeGoogleConnection={(status) =>
|
|
469
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
470
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
471
|
+
}
|
|
472
|
+
/>
|
|
473
|
+
<div>
|
|
474
|
+
经度 103.841974, 纬度 1.311295 在高德地图上的坐标类型是:
|
|
475
|
+
{toAmapCoordinateType([103.841974, 1.311295])}
|
|
476
|
+
</div>
|
|
477
|
+
<div>
|
|
464
478
|
);
|
|
465
479
|
},
|
|
466
480
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./v2"
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./v2"
|
package/dist/v2/App.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } 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 = "AIzaSyCRtkaNSWMOhOXDOUpJK4OVbm5RIstYj-I";
|
|
6
6
|
const gmapId = "d0af0c05331af64a";
|
|
@@ -19,9 +19,11 @@ const App = defineComponent({
|
|
|
19
19
|
"gmapRasterId": gmapRasterId,
|
|
20
20
|
"gmapKey": gmapApiKey,
|
|
21
21
|
"language": "en",
|
|
22
|
-
"supplier": supplierRef.value
|
|
22
|
+
"supplier": supplierRef.value,
|
|
23
|
+
"renderLoadFailedTitle": () => supplierRef.value === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败",
|
|
24
|
+
"renderLoadFailedDescription": () => supplierRef.value === "gmap" ? "请确认您的网络能正常访问谷歌地图, \n或切回高德地图" : void 0
|
|
23
25
|
}
|
|
24
|
-
}, [h(
|
|
26
|
+
}, [h(DemoBusinessQuoting)]);
|
|
25
27
|
}
|
|
26
28
|
});
|
|
27
29
|
export {
|
|
@@ -5,7 +5,8 @@ import { defineSetup } from "../types/helper.js";
|
|
|
5
5
|
import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
|
|
6
6
|
const DemoBusinessQuoting = defineSetup("DemoBusinessQuoting", function() {
|
|
7
7
|
const {
|
|
8
|
-
mapContext
|
|
8
|
+
mapContext,
|
|
9
|
+
toAmapCoordinateType
|
|
9
10
|
} = useBusinessQuotingMap();
|
|
10
11
|
return () => h("div", [h(BusinessQuotingMap, {
|
|
11
12
|
"class": demo,
|
|
@@ -36,7 +37,7 @@ const DemoBusinessQuoting = defineSetup("DemoBusinessQuoting", function() {
|
|
|
36
37
|
"clickStartPoint": (place) => console.log("点击起点时触发 palce = ", place),
|
|
37
38
|
"clickEndPoint": (place) => console.log("点击终点时触发 palce = ", place)
|
|
38
39
|
}
|
|
39
|
-
})]);
|
|
40
|
+
}), h("div", ["经度 103.841974, 纬度 1.311295 在高德地图上的坐标类型是:", toAmapCoordinateType([103.841974, 1.311295])])]);
|
|
40
41
|
});
|
|
41
42
|
export {
|
|
42
43
|
DemoBusinessQuoting
|
package/dist/v2/api/cdn.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/he
|
|
|
5
5
|
export declare const ICON_END_POINT_ZH_TW_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/end-point-zh-TW.svg";
|
|
6
6
|
export declare const ICON_TAXI_CAR_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/taxi-car.svg";
|
|
7
7
|
export declare const ICON_DOT_LOADING_URL = "https://overseas-oss.heycars.cn/heycar-map/gif/dot-loading.gif";
|
|
8
|
+
export declare const ICON_LOAD_FAILED_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/load-failed.svg";
|
package/dist/v2/api/cdn.js
CHANGED
|
@@ -5,12 +5,14 @@ const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/en
|
|
|
5
5
|
const ICON_END_POINT_ZH_TW_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/end-point-zh-TW.svg";
|
|
6
6
|
const ICON_TAXI_CAR_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/taxi-car.svg";
|
|
7
7
|
const ICON_DOT_LOADING_URL = "https://overseas-oss.heycars.cn/heycar-map/gif/dot-loading.gif";
|
|
8
|
+
const ICON_LOAD_FAILED_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/load-failed.svg";
|
|
8
9
|
export {
|
|
9
10
|
AMAP_DEFAULT_MARKER_ICON_URL,
|
|
10
11
|
ICON_DOT_LOADING_URL,
|
|
11
12
|
ICON_END_POINT_EN_URL,
|
|
12
13
|
ICON_END_POINT_ZH_TW_URL,
|
|
13
14
|
ICON_FULL_SCREEN_URL,
|
|
15
|
+
ICON_LOAD_FAILED_URL,
|
|
14
16
|
ICON_START_POINT_EN_URL,
|
|
15
17
|
ICON_TAXI_CAR_URL
|
|
16
18
|
};
|
|
@@ -45,5 +45,5 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
45
45
|
onClickLocatorText?: AbsoluteAddressBoxProps["onClickText"];
|
|
46
46
|
onClickLocatorPhoto?: AbsoluteAddressBoxProps["onClickPhoto"];
|
|
47
47
|
}
|
|
48
|
-
export declare const BusinessRecomendPlaceMapInner: import("vue-demi").DefineComponent<import("@vue/runtime-core").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" | "
|
|
49
|
-
export declare const BusinessRecomendPlaceMap: import("vue-demi").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "
|
|
48
|
+
export declare const BusinessRecomendPlaceMapInner: import("vue-demi").DefineComponent<import("@vue/runtime-core").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", BusinessRecomendPlaceMapProps>;
|
|
49
|
+
export declare const BusinessRecomendPlaceMap: import("vue-demi").DefineComponent<import("@vue/runtime-core").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", BusinessRecomendPlaceMapProps>;
|
|
@@ -3,5 +3,5 @@ import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap"
|
|
|
3
3
|
export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "loading" | "fallback" | "log" | "getAvailable" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "renderPlacePhoto" | "renderPlaceTag" | "onChangeGeoLocation" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
|
|
4
4
|
defaultPlace?: CoordinatePlace;
|
|
5
5
|
}
|
|
6
|
-
export declare const BusinessReselectPlaceMapInner: import("vue-demi").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "
|
|
7
|
-
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "
|
|
6
|
+
export declare const BusinessReselectPlaceMapInner: import("vue-demi").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps>;
|
|
7
|
+
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import "../css/Loading-
|
|
1
|
+
import "../css/Loading-0e058b68.css";
|
|
2
2
|
import { h } from "vue";
|
|
3
|
+
import { ICON_LOAD_FAILED_URL } from "../api/cdn.js";
|
|
3
4
|
import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
4
5
|
import { defineSetup } from "../types/helper.js";
|
|
5
6
|
const imgGrid = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzg1IiBoZWlnaHQ9IjgxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2U9IiNEOERCRTIiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWRhc2hhcnJheT0iMSI+PHBhdGggZD0iTS41IDgxN1YwTTI0LjUgODE3VjBNNDguNSA4MTdWME03Mi41IDgxN1YwTTk2LjUgODE3VjBNMTIwLjUgODE3VjBNMTQ0LjUgODE3VjBNMTY4LjUgODE3VjBNMTkyLjUgODE3VjBNMjE2LjUgODE3VjBNMjQwLjUgODE3VjBNMjY0LjUgODE3VjBNMjg4LjUgODE3VjBNMzEyLjUgODE3VjBNMzM2LjUgODE3VjBNMzYwLjUgODE3VjBNMzg0LjUgODE3VjBNMCAuNWgzODVNMCAyNC41aDM4NU0wIDQ4LjVoMzg1TTAgNzIuNWgzODVNMCA5Ni41aDM4NU0wIDEyMC41aDM4NU0wIDE0NC41aDM4NU0wIDE2OC41aDM4NU0wIDE5Mi41aDM4NU0wIDIxNi41aDM4NU0wIDI0MC41aDM4NU0wIDI2NC41aDM4NU0wIDI4OC41aDM4NU0wIDMxMi41aDM4NU0wIDMzNi41aDM4NU0wIDM2MC41aDM4NU0wIDM4NC41aDM4NU0wIDQwOC41aDM4NU0wIDQzMi41aDM4NU0wIDQ1Ni41aDM4NU0wIDQ4MC41aDM4NU0wIDUwNC41aDM4NU0wIDUyOC41aDM4NU0wIDU1Mi41aDM4NU0wIDU3Ni41aDM4NU0wIDYwMC41aDM4NU0wIDYyNC41aDM4NU0wIDY0OC41aDM4NU0wIDY3Mi41aDM4NU0wIDY5Ni41aDM4NU0wIDcyMC41aDM4NU0wIDc0NC41aDM4NU0wIDc2OC41aDM4NU0wIDc5Mi41aDM4NU0wIDgxNi41aDM4NSIvPjwvZz48L3N2Zz4=";
|
|
6
7
|
const Loading_css_ts_vanilla = "";
|
|
8
|
+
var description = "_17ify496";
|
|
9
|
+
var iconLayout = "_17ify492";
|
|
10
|
+
var iconLoadFailed = "_17ify493";
|
|
7
11
|
var loadingBg = "_17ify491";
|
|
8
12
|
var loadingLayout = "_17ify490";
|
|
13
|
+
var textLayout = "_17ify494";
|
|
14
|
+
var title = "_17ify495";
|
|
9
15
|
const Loading = defineSetup("Loading", function() {
|
|
10
16
|
return () => h("div", {
|
|
11
17
|
"class": loadingLayout
|
|
@@ -21,7 +27,31 @@ const Loading = defineSetup("Loading", function() {
|
|
|
21
27
|
}
|
|
22
28
|
})]);
|
|
23
29
|
});
|
|
30
|
+
const LoadFailed = defineSetup("LoadFailed", function(props) {
|
|
31
|
+
return () => h("div", {
|
|
32
|
+
"class": loadingLayout
|
|
33
|
+
}, [h("img", {
|
|
34
|
+
"class": loadingBg,
|
|
35
|
+
"attrs": {
|
|
36
|
+
"src": imgGrid
|
|
37
|
+
}
|
|
38
|
+
}), h("div", {
|
|
39
|
+
"class": iconLayout
|
|
40
|
+
}, [h("img", {
|
|
41
|
+
"class": iconLoadFailed,
|
|
42
|
+
"attrs": {
|
|
43
|
+
"src": ICON_LOAD_FAILED_URL
|
|
44
|
+
}
|
|
45
|
+
}), h("div", {
|
|
46
|
+
"class": textLayout
|
|
47
|
+
}, [h("span", {
|
|
48
|
+
"class": title
|
|
49
|
+
}, [props.title]), h("span", {
|
|
50
|
+
"class": description
|
|
51
|
+
}, [props.description])])])]);
|
|
52
|
+
});
|
|
24
53
|
export {
|
|
25
54
|
Loading as L,
|
|
55
|
+
LoadFailed as a,
|
|
26
56
|
imgGrid as i
|
|
27
57
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { i as isObject, d as debounce } from "./debounce.5afe7867.js";
|
|
2
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
3
|
+
function throttle(func, wait, options) {
|
|
4
|
+
var leading = true, trailing = true;
|
|
5
|
+
if (typeof func != "function") {
|
|
6
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
7
|
+
}
|
|
8
|
+
if (isObject(options)) {
|
|
9
|
+
leading = "leading" in options ? !!options.leading : leading;
|
|
10
|
+
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
11
|
+
}
|
|
12
|
+
return debounce(func, wait, {
|
|
13
|
+
"leading": leading,
|
|
14
|
+
"maxWait": wait,
|
|
15
|
+
"trailing": trailing
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
throttle as t
|
|
20
|
+
};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const loadingLayout: string;
|
|
2
2
|
export declare const loadingBg: string;
|
|
3
|
+
export declare const iconLayout: string;
|
|
4
|
+
export declare const iconLoadFailed: string;
|
|
5
|
+
export declare const textLayout: string;
|
|
6
|
+
export declare const title: string;
|
|
7
|
+
export declare const description: string;
|
|
@@ -1 +1,7 @@
|
|
|
1
1
|
export declare const Loading: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<unknown>, 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<unknown, Required<unknown>>, never, unknown>;
|
|
2
|
+
interface LoadFailedProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
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
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import
|
|
2
|
+
import "../../api/cdn.js";
|
|
3
|
+
import { a, L } from "../../chunks/Loading.da68a2a6.js";
|
|
3
4
|
import "../../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
4
5
|
import "../../types/helper.js";
|
|
5
6
|
export {
|
|
7
|
+
a as LoadFailed,
|
|
6
8
|
L as Loading
|
|
7
9
|
};
|
|
@@ -5,8 +5,8 @@ import { type GmapLoaderProps, type UseMapLoaderProps } from "../../hooks/useMap
|
|
|
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">;
|
|
9
|
-
export declare const MapProvider: import("vue").DefineComponent<import("vue3").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>>, "
|
|
8
|
+
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
|
|
9
|
+
export declare const MapProvider: import("vue").DefineComponent<import("vue3").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", MapProviderProps>;
|
|
10
10
|
export interface HeycarMapProps extends Pick<GmapLoaderProps, "fallback" | "loading">, Pick<AmapProps, "center" | "zoom"> {
|
|
11
11
|
mapRef?: SetMap<AmapMap> | SetMap<google.maps.Map>;
|
|
12
12
|
outerArea?: () => VueNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../css/MapProvider-156bfd53.css";
|
|
2
2
|
import { h } from "vue";
|
|
3
|
-
import { L as Loading, i as imgGrid } from "../../chunks/Loading.
|
|
3
|
+
import { L as Loading, a as LoadFailed, i as imgGrid } from "../../chunks/Loading.da68a2a6.js";
|
|
4
4
|
import { useMapLoader, Status } from "../../hooks/useMapLoader.js";
|
|
5
5
|
import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
6
6
|
import { defineLagecySetup } from "../../types/helper.js";
|
|
@@ -36,7 +36,7 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
|
|
|
36
36
|
var _a;
|
|
37
37
|
return h("div", [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
38
38
|
};
|
|
39
|
-
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language"]);
|
|
39
|
+
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
|
|
40
40
|
const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
41
41
|
slots,
|
|
42
42
|
emit,
|
|
@@ -64,7 +64,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
64
64
|
const handleResize = () => emit("resize");
|
|
65
65
|
loadTraditionalChineseConvertOnce(payload.language === "zh-TW");
|
|
66
66
|
return () => {
|
|
67
|
-
var _a, _b, _c, _d, _e, _f;
|
|
67
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
68
68
|
const {
|
|
69
69
|
supplier,
|
|
70
70
|
gmapId,
|
|
@@ -83,12 +83,19 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
83
83
|
const node = (_a = slots.loading) == null ? void 0 : _a.call(slots);
|
|
84
84
|
return node ? h("div", [node]) : h(Loading);
|
|
85
85
|
}
|
|
86
|
-
if (status === Status.FAILURE) {
|
|
86
|
+
if (status === Status.FAILURE || status === Status.TIMEOUT) {
|
|
87
87
|
const node = (_b = slots.fallback) == null ? void 0 : _b.call(slots);
|
|
88
|
-
|
|
88
|
+
const title = (_c = payload.renderLoadFailedTitle) == null ? void 0 : _c.call(payload, status);
|
|
89
|
+
const description = (_d = payload.renderLoadFailedDescription) == null ? void 0 : _d.call(payload, status);
|
|
90
|
+
return node ? h("div", [node]) : h(LoadFailed, {
|
|
91
|
+
"attrs": {
|
|
92
|
+
"title": title,
|
|
93
|
+
"description": description
|
|
94
|
+
}
|
|
95
|
+
});
|
|
89
96
|
}
|
|
90
|
-
const children = (
|
|
91
|
-
const outArea = (
|
|
97
|
+
const children = (_e = slots.default) == null ? void 0 : _e.call(slots);
|
|
98
|
+
const outArea = (_f = slots.outerArea) == null ? void 0 : _f.call(slots);
|
|
92
99
|
const mapId = patchGmapIdForAlipayCompatible({
|
|
93
100
|
gmapId,
|
|
94
101
|
gmapRasterId,
|
|
@@ -98,7 +105,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
98
105
|
switch (supplier) {
|
|
99
106
|
case "gmap":
|
|
100
107
|
return h("div", {
|
|
101
|
-
"class": `${heycarMap} ${(
|
|
108
|
+
"class": `${heycarMap} ${(_g = attrs.class) != null ? _g : ""}`,
|
|
102
109
|
"attrs": {
|
|
103
110
|
"lang": language
|
|
104
111
|
},
|
|
@@ -129,7 +136,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
129
136
|
}), outArea]);
|
|
130
137
|
default:
|
|
131
138
|
return h("div", {
|
|
132
|
-
"class": `${heycarMap} ${(
|
|
139
|
+
"class": `${heycarMap} ${(_h = attrs.class) != null ? _h : ""}`,
|
|
133
140
|
"attrs": {
|
|
134
141
|
"lang": language
|
|
135
142
|
},
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
._17ify490 {
|
|
2
|
+
position: relative;
|
|
3
|
+
background-color: #EDF1F5;
|
|
4
|
+
}
|
|
5
|
+
._17ify491 {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
object-fit: cover;
|
|
9
|
+
}
|
|
10
|
+
._17ify492 {
|
|
11
|
+
position: absolute;
|
|
12
|
+
margin: auto;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
height: fit-content;
|
|
19
|
+
}
|
|
20
|
+
._17ify493 {
|
|
21
|
+
width: 40.8vw;
|
|
22
|
+
height: 24.53vw;
|
|
23
|
+
}
|
|
24
|
+
._17ify494 {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: center;
|
|
30
|
+
width: max-content;
|
|
31
|
+
left: 50%;
|
|
32
|
+
transform: translate(-50%, 0);
|
|
33
|
+
}
|
|
34
|
+
._17ify495 {
|
|
35
|
+
margin-top: 1.6vw;
|
|
36
|
+
font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
font-size: 4vw;
|
|
39
|
+
color: #1E1E1E;
|
|
40
|
+
line-height: 6.4vw;
|
|
41
|
+
}
|
|
42
|
+
._17ify496 {
|
|
43
|
+
margin-top: 1.6vw;
|
|
44
|
+
font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
font-size: 3.73vw;
|
|
47
|
+
color: #999BA1;
|
|
48
|
+
line-height: 6.4vw;
|
|
49
|
+
white-space: pre-line;
|
|
50
|
+
text-align: center;
|
|
51
|
+
}
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { reactive, watch } from "vue-demi";
|
|
2
2
|
import { MINI_PROGRAM_WEB_VIEW_CLOSE_EVENT } from "../utils/patchMiniprogram.js";
|
|
3
3
|
import { OS_PLATFORM, detectOSPlatform } from "../utils/platform.js";
|
|
4
|
-
import {
|
|
5
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
6
|
-
function throttle(func, wait, options) {
|
|
7
|
-
var leading = true, trailing = true;
|
|
8
|
-
if (typeof func != "function") {
|
|
9
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
10
|
-
}
|
|
11
|
-
if (isObject(options)) {
|
|
12
|
-
leading = "leading" in options ? !!options.leading : leading;
|
|
13
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
14
|
-
}
|
|
15
|
-
return debounce(func, wait, {
|
|
16
|
-
"leading": leading,
|
|
17
|
-
"maxWait": wait,
|
|
18
|
-
"trailing": trailing
|
|
19
|
-
});
|
|
20
|
-
}
|
|
4
|
+
import { t as throttle } from "../chunks/throttle.8bdd8d3b.js";
|
|
21
5
|
const DEVICE_ORIENTATION_INTERVAL = 200;
|
|
22
6
|
const CSS_DEVICE_ORIENTATION_VAR_PREFIX = "--CSS_DEVICE_ORIENTATION_VAR_ROTATION_DEGREE_";
|
|
23
7
|
const useDeviceOrientation = (props) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AMAP_TO_GCJ02_TIMEOUT } from "../api/contants.js";
|
|
2
2
|
import { lnglat2point } from "../utils/transform.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inChina, inHongkong, inMacau } from "./useMapInChina.js";
|
|
4
4
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
5
5
|
/**
|
|
6
6
|
* @preserve
|
|
@@ -515,7 +515,6 @@ const exported = Object.assign(Object.assign({}, CRSTypes), {
|
|
|
515
515
|
});
|
|
516
516
|
const useAmapGCJ02 = () => {
|
|
517
517
|
const { readyPromise } = useMapSupplier();
|
|
518
|
-
const { inChina } = useMapInChina();
|
|
519
518
|
const toCoordinateType = (p) => {
|
|
520
519
|
return inChina(p) ? "gcj02" : "wgs84";
|
|
521
520
|
};
|
|
@@ -567,7 +566,6 @@ const useAmapGCJ02 = () => {
|
|
|
567
566
|
};
|
|
568
567
|
const useGmapGCJ02 = () => {
|
|
569
568
|
const { readyPromise } = useMapSupplier();
|
|
570
|
-
const { inChina, inHongkong, inMacau } = useMapInChina();
|
|
571
569
|
const toCoordinateType = (p) => {
|
|
572
570
|
return inChina(p) && !inHongkong(p) && !inMacau(p) ? "gcj02" : "wgs84";
|
|
573
571
|
};
|
|
@@ -3,7 +3,7 @@ import { apiGoogleSnapRoad } from "../api/googleSnapRoad.js";
|
|
|
3
3
|
import { watchEffectForDeepOption } from "../utils/compare.js";
|
|
4
4
|
import { lnglat2point, trackPoints2amapGraspRoadPoints } from "../utils/transform.js";
|
|
5
5
|
import { useMapAngle } from "./useMapAngle.js";
|
|
6
|
-
import {
|
|
6
|
+
import { inChina } from "./useMapInChina.js";
|
|
7
7
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
8
8
|
const GRASP_ROAD_INPUT_MIN_AMOUNT = 2;
|
|
9
9
|
const GRASP_ROAD_INPUT_MAX_AMOUNT = 500;
|
|
@@ -12,7 +12,6 @@ const useAmapGraspRoad = (props) => {
|
|
|
12
12
|
const pathRef = ref([]);
|
|
13
13
|
const angleRef = ref(0);
|
|
14
14
|
const { apiMapComputeHeading } = useMapAngle();
|
|
15
|
-
const { inChina } = useMapInChina();
|
|
16
15
|
const apiMapToGraspRoadPath = (tracks) => {
|
|
17
16
|
return new Promise((resolve) => {
|
|
18
17
|
var _a, _b, _c;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import { type Point } from "../types/interface";
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
inMacau: (point: Point) => boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const useAmapInChina: () => {
|
|
8
|
-
inChina: (point: Point) => boolean;
|
|
9
|
-
inHongkong: (point: Point) => boolean;
|
|
10
|
-
inMacau: (point: Point) => boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const useGmapInChina: () => {
|
|
13
|
-
inChina: (point: Point) => boolean;
|
|
14
|
-
inHongkong: (point: Point) => boolean;
|
|
15
|
-
inMacau: (point: Point) => boolean;
|
|
16
|
-
};
|
|
2
|
+
export declare const inChina: (point: Point) => boolean;
|
|
3
|
+
export declare const inHongkong: (point: Point) => boolean;
|
|
4
|
+
export declare const inMacau: (point: Point) => boolean;
|
|
@@ -2593,22 +2593,17 @@ const macauBounds = [
|
|
|
2593
2593
|
22.19885
|
|
2594
2594
|
]
|
|
2595
2595
|
];
|
|
2596
|
-
const
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
return pointInPolygon(point, macauBounds) >= 0;
|
|
2605
|
-
};
|
|
2606
|
-
return { inChina, inHongkong, inMacau };
|
|
2596
|
+
const inChina = (point) => {
|
|
2597
|
+
return pointInPolygon(point, chinaBounds) >= 0;
|
|
2598
|
+
};
|
|
2599
|
+
const inHongkong = (point) => {
|
|
2600
|
+
return pointInPolygon(point, hongkongBounds) >= 0;
|
|
2601
|
+
};
|
|
2602
|
+
const inMacau = (point) => {
|
|
2603
|
+
return pointInPolygon(point, macauBounds) >= 0;
|
|
2607
2604
|
};
|
|
2608
|
-
const useAmapInChina = useMapInChina;
|
|
2609
|
-
const useGmapInChina = useMapInChina;
|
|
2610
2605
|
export {
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2606
|
+
inChina,
|
|
2607
|
+
inHongkong,
|
|
2608
|
+
inMacau
|
|
2614
2609
|
};
|
|
@@ -7,6 +7,7 @@ export declare const DEFAULT_AMAP_PLUGINS: AmapLoaderProps["plugins"];
|
|
|
7
7
|
export declare const DEFAULT_GMAP_LIBRARIES: LoaderOptions["libraries"];
|
|
8
8
|
export declare enum Status {
|
|
9
9
|
LOADING = "LOADING",
|
|
10
|
+
TIMEOUT = "TIMEOUT",
|
|
10
11
|
FAILURE = "FAILURE",
|
|
11
12
|
SUCCESS = "SUCCESS"
|
|
12
13
|
}
|
|
@@ -19,7 +20,7 @@ declare global {
|
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
export interface AmapLoaderProps extends Pick<GmapLoaderProps, "fallback" | "loading" | "
|
|
23
|
+
export interface AmapLoaderProps extends Pick<GmapLoaderProps, "fallback" | "loading" | "onSuccess" | "onFail">, Omit<AMapLoaderOptions, "key" | "version" | "plugins"> {
|
|
23
24
|
apiKey: string;
|
|
24
25
|
apiSecret?: string;
|
|
25
26
|
apiServiceHost?: string;
|
|
@@ -42,11 +43,13 @@ export interface GmapLoaderProps extends LoaderOptions {
|
|
|
42
43
|
*/
|
|
43
44
|
fallback?: () => VNodeChild;
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* Note: The callback be executed multiple times in the lifecycle of the component.
|
|
46
|
+
* 成功回调只会触发一次
|
|
48
47
|
*/
|
|
49
|
-
|
|
48
|
+
onSuccess?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* 失败回调可能会触发多次
|
|
51
|
+
*/
|
|
52
|
+
onFail?: () => void;
|
|
50
53
|
}
|
|
51
54
|
export declare const useGmapLoader: (props: GmapLoaderProps) => {
|
|
52
55
|
statusRef: import("vue-demi").ShallowRef<Status>;
|
|
@@ -64,7 +67,8 @@ export interface UseMapLoaderProps {
|
|
|
64
67
|
amapServiceHost?: string;
|
|
65
68
|
supplier: MapSupplier;
|
|
66
69
|
language: Language;
|
|
67
|
-
|
|
70
|
+
onSuccess?: () => void;
|
|
71
|
+
onFail?: () => void;
|
|
68
72
|
}
|
|
69
73
|
export declare const useMapLoader: (props: UseMapLoaderProps) => UseMapLoaderOutput;
|
|
70
74
|
export {};
|