@heycar/heycars-map 2.15.0-domestic4 → 2.16.0-downgrade1
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 +16 -50
- package/dist/v2/App.js +2 -2
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -2
- package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
- package/dist/v2/Demo/DemoBusinessTaxiEnd.js +2 -9
- package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -4
- package/dist/v2/Demo/DemoBusinessTaxiService.js +1 -19
- package/dist/v2/api/googleRoutes.js +2 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +2 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -80
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.eebd0822.js → BusinessRecomendPlaceMap.ed4b75d5.js} +30 -11
- package/dist/{v3/chunks/Loading.4b53c31f.js → v2/chunks/Loading.70dfc720.js} +30 -34
- package/dist/v2/components/Loading/Loading.js +1 -1
- package/dist/v2/components/Loading/index.js +1 -1
- package/dist/v2/components/MapProvider/MapProvider.d.ts +1 -3
- package/dist/v2/components/MapProvider/MapProvider.js +13 -25
- package/dist/v2/hooks/useMapCoordinatify.d.ts +1 -2
- package/dist/v2/hooks/useMapCoordinatify.js +1 -6
- package/dist/v2/hooks/useMapFitView.js +3 -0
- package/dist/v2/hooks/useMapFitZoom.d.ts +6 -0
- package/dist/v2/hooks/useMapFitZoom.js +22 -2
- package/dist/v2/hooks/useMapLoader.js +3 -3
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/types/interface.d.ts +0 -12
- package/dist/v2/utils/geometryPolygon.d.ts +0 -9
- package/dist/v2/utils/geometryPolygon.js +0 -19
- package/dist/v2/utils/log.js +1 -1
- package/dist/v2/utils/platform.d.ts +1 -3
- package/dist/v2/utils/platform.js +2 -8
- package/dist/v2/utils/typeChecking.d.ts +1 -7
- package/dist/v2/utils/typeChecking.js +0 -18
- package/dist/v3/App.js +2 -2
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -2
- package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +1 -2
- package/dist/v3/Demo/DemoBusinessTaxiEnd.js +2 -9
- package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -4
- package/dist/v3/Demo/DemoBusinessTaxiService.js +1 -19
- package/dist/v3/api/googleRoutes.js +2 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -3
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +2 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +2 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +14 -6
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +6 -2
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -4
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +2 -6
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -4
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +7 -45
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +1 -6
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +16 -62
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.71c439c6.js → BusinessRecomendPlaceMap.4ec9353a.js} +30 -9
- package/dist/{v2/chunks/Loading.8aa3aad3.js → v3/chunks/Loading.4c949ec9.js} +27 -47
- package/dist/v3/components/Loading/Loading.js +1 -1
- package/dist/v3/components/Loading/index.js +1 -1
- package/dist/v3/components/MapProvider/MapProvider.d.ts +1 -3
- package/dist/v3/components/MapProvider/MapProvider.js +14 -26
- package/dist/v3/hooks/useMapCoordinatify.d.ts +1 -2
- package/dist/v3/hooks/useMapCoordinatify.js +1 -6
- package/dist/v3/hooks/useMapFitView.js +3 -0
- package/dist/v3/hooks/useMapFitZoom.d.ts +6 -0
- package/dist/v3/hooks/useMapFitZoom.js +22 -2
- package/dist/v3/hooks/useMapLoader.js +3 -3
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v3/types/interface.d.ts +0 -12
- package/dist/v3/utils/geometryPolygon.d.ts +0 -9
- package/dist/v3/utils/geometryPolygon.js +0 -19
- package/dist/v3/utils/log.js +1 -1
- package/dist/v3/utils/platform.d.ts +1 -3
- package/dist/v3/utils/platform.js +2 -8
- package/dist/v3/utils/typeChecking.d.ts +1 -7
- package/dist/v3/utils/typeChecking.js +0 -18
- package/package.json +1 -1
- package/dist/v2/Demo/demo.data.mock.d.ts +0 -4
- package/dist/v2/Demo/demo.data.mock.js +0 -1194
- package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +0 -6
- package/dist/v2/business-components/TaxiCar/RandomCars.js +0 -47
- package/dist/v3/Demo/demo.data.mock.d.ts +0 -4
- package/dist/v3/Demo/demo.data.mock.js +0 -1194
- package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +0 -8
- package/dist/v3/business-components/TaxiCar/RandomCars.js +0 -45
package/README.md
CHANGED
|
@@ -133,17 +133,6 @@ export interface CoordinateTrackPoint {
|
|
|
133
133
|
timestamp: number;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
export interface CoordinateExternalRoute {
|
|
137
|
-
path: CoordinatePoint[];
|
|
138
|
-
duration: number;
|
|
139
|
-
distance: number;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export type GetDriverRouteOrTrackOutput = {
|
|
143
|
-
routes?: CoordinateExternalRoute;
|
|
144
|
-
tracks?: CoordinateTrackPoint[];
|
|
145
|
-
};
|
|
146
|
-
|
|
147
136
|
export enum CenterPlaceStatus {
|
|
148
137
|
GEO_LOADING = "GEO_LOADING",
|
|
149
138
|
QUERYING_INFO = "QUERYING_INFO",
|
|
@@ -206,7 +195,6 @@ export type DriverStatus =
|
|
|
206
195
|
gmapKey={gmapApiKey}
|
|
207
196
|
// 使用哪个地图供应商,目前两个供应商: amap 高德 / gmap 谷歌
|
|
208
197
|
supplier={"amap"}
|
|
209
|
-
// 对于国内聚合,路径将 "/overseas/.*" 改为 "/now/.*"
|
|
210
198
|
// 可选,高德驾车路线规划代理地址
|
|
211
199
|
gaodeDirectionDrivingProxyUrl="/overseas/amap/driveGuide"
|
|
212
200
|
// 可选,高德步行路线规划代理地址
|
|
@@ -216,7 +204,7 @@ export type DriverStatus =
|
|
|
216
204
|
// 弃用,谷歌路线规划代理地址
|
|
217
205
|
googleDirectionsProxyUrl="/overseas/maps/directions/json"
|
|
218
206
|
// 可选,谷歌路由服务代理地址
|
|
219
|
-
googleRoutesProxyUrl="/overseas/maps/routes/directions"
|
|
207
|
+
googleRoutesProxyUrl="/overseas/maps/routes/directions/v2"
|
|
220
208
|
// 可选,自定义地图颜色
|
|
221
209
|
themeVariables={
|
|
222
210
|
{
|
|
@@ -249,8 +237,6 @@ export type DriverStatus =
|
|
|
249
237
|
// ICON_WAYPOINT_URL: "https://<支付宝oss域名>/heycar-map/svg/0.12/waypoint.svg";
|
|
250
238
|
}
|
|
251
239
|
}
|
|
252
|
-
// 可选,是否启用强制浏览器模式
|
|
253
|
-
forceBrowserPlatformH5
|
|
254
240
|
// 地图加载失败时显示的标题
|
|
255
241
|
renderLoadFailedTitle={() => (supplier === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败")}
|
|
256
242
|
// 地图加载失败时显示的描述
|
|
@@ -363,8 +349,6 @@ export default defineComponent({
|
|
|
363
349
|
queryingTitle={"正在获取地址信息"}
|
|
364
350
|
recomendDescription={"您将在此处上车"}
|
|
365
351
|
geoErrorOnceNotificationKey="BusinessReselectPlaceMap_GeoErrorOnceKey"
|
|
366
|
-
// 是否显示附近车辆
|
|
367
|
-
enableNearbyCars={true}
|
|
368
352
|
defaultCenterPlace={(place) =>
|
|
369
353
|
place ?? {
|
|
370
354
|
lng: 139.777777,
|
|
@@ -374,6 +358,17 @@ export default defineComponent({
|
|
|
374
358
|
displayName: "default place displayName",
|
|
375
359
|
}
|
|
376
360
|
}
|
|
361
|
+
// 可选,应用启动时是否跳过等待 GPS,默认 false
|
|
362
|
+
skipWaitGeo={
|
|
363
|
+
false ||
|
|
364
|
+
true || {
|
|
365
|
+
lng: 139.55555,
|
|
366
|
+
lat: 35.5555,
|
|
367
|
+
type: "wgs84",
|
|
368
|
+
name: "skip geo place name",
|
|
369
|
+
displayName: "skip geo place displayName",
|
|
370
|
+
}
|
|
371
|
+
}
|
|
377
372
|
getAvailable={() => Promise.resolve(true)}
|
|
378
373
|
getRecomendPlace={getRecomendPlace}
|
|
379
374
|
getDefaultCenterPlace={getDefaultCenterPlace}
|
|
@@ -612,6 +607,10 @@ export default defineComponent({
|
|
|
612
607
|
mapContext={mapContext}
|
|
613
608
|
onClickStartPoint={(place) => console.log("点击起点时触发 palce = ", place)}
|
|
614
609
|
onClickEndPoint={(place) => console.log("点击终点时触发 palce = ", place)}
|
|
610
|
+
onChangeGoogleConnection={(status) =>
|
|
611
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
612
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
613
|
+
}
|
|
615
614
|
/>
|
|
616
615
|
<div>
|
|
617
616
|
经度 103.841974, 纬度 1.311295 在高德地图上的坐标类型是:
|
|
@@ -670,18 +669,6 @@ export default defineComponent({
|
|
|
670
669
|
renderInServiceTitle={({ distance, duration }) =>
|
|
671
670
|
`距离终点*${distance}*公里, 预计*${duration}*分钟`
|
|
672
671
|
}
|
|
673
|
-
// 选填。 司机接单时,第三方指定的起点到终点的路径
|
|
674
|
-
confirmedPath={[
|
|
675
|
-
{lng: 121.401554, lat: 31.21653, type: "gcj02"},
|
|
676
|
-
{lng: 121.401554, lat: 31.21653, type: "gcj02"},
|
|
677
|
-
{lng: 121.401795, lat: 31.21654, type: "gcj02"},
|
|
678
|
-
]}
|
|
679
|
-
// 选填。 订单结束时,实际行驶路径
|
|
680
|
-
endServicePath={[
|
|
681
|
-
{lng: 121.401554, lat: 31.21653, type: "gcj02"},
|
|
682
|
-
{lng: 121.401554, lat: 31.21653, type: "gcj02"},
|
|
683
|
-
{lng: 121.401795, lat: 31.21654, type: "gcj02"},
|
|
684
|
-
]}
|
|
685
672
|
getDriverPositionTrack={async () => {
|
|
686
673
|
// 向后端请求司机的历史轨迹
|
|
687
674
|
return Promise.resolve<TrackPoint[]>([
|
|
@@ -690,21 +677,6 @@ export default defineComponent({
|
|
|
690
677
|
{ lng: 121.403581, lat: 31.216415, type: "gcj02", angle: 30, timestamp: 1698058442000 },
|
|
691
678
|
]);
|
|
692
679
|
}}
|
|
693
|
-
// getDriverRouteOrTrack 与 getDriverPositionTrack 二选一
|
|
694
|
-
getDriverRouteOrTrack={async () => {
|
|
695
|
-
// 后端返回司机的真实导航路径或者历史轨迹
|
|
696
|
-
return Promise.resolve<GetDriverRouteOrTrackOutput>({
|
|
697
|
-
routes: {
|
|
698
|
-
distance: 4270,
|
|
699
|
-
duration: 1310,
|
|
700
|
-
path: [
|
|
701
|
-
{lng: 121.401554, lat: 31.21653, type: "gcj02"},
|
|
702
|
-
{lng: 121.401554, lat: 31.21653, type: "gcj02"},
|
|
703
|
-
{lng: 121.401795, lat: 31.21654, type: "gcj02"},
|
|
704
|
-
],
|
|
705
|
-
},
|
|
706
|
-
});
|
|
707
|
-
}}
|
|
708
680
|
interval={5000}
|
|
709
681
|
mapContext={mapContext}
|
|
710
682
|
/>
|
|
@@ -740,12 +712,6 @@ export default defineComponent({
|
|
|
740
712
|
displayName: "长城美华 Coffee Shop (CCMW)",
|
|
741
713
|
type: "wgs84",
|
|
742
714
|
}}
|
|
743
|
-
// 选填。实际行驶路径
|
|
744
|
-
path={[
|
|
745
|
-
{ lng: 103.996211, lat: 1.35202, type: "wgs84" },
|
|
746
|
-
{ lng: 103.996469, lat: 1.352348, type: "wgs84" },
|
|
747
|
-
{ lng: 103.996581, lat: 1.3526, type: "wgs84" },
|
|
748
|
-
]}
|
|
749
715
|
/>
|
|
750
716
|
);
|
|
751
717
|
},
|
package/dist/v2/App.js
CHANGED
|
@@ -8,7 +8,7 @@ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
|
|
|
8
8
|
const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
|
|
9
9
|
const App = defineComponent({
|
|
10
10
|
setup() {
|
|
11
|
-
const supplierRef = ref("
|
|
11
|
+
const supplierRef = ref("gmap");
|
|
12
12
|
window.supplierRef = supplierRef;
|
|
13
13
|
return () => h(MapProvider, {
|
|
14
14
|
"attrs": {
|
|
@@ -19,7 +19,7 @@ const App = defineComponent({
|
|
|
19
19
|
"language": "en",
|
|
20
20
|
"supplier": supplierRef.value,
|
|
21
21
|
"googleSnapRoadProxyUrl": "/overseas/maps/snapToRoads",
|
|
22
|
-
"googleRoutesProxyUrl": "/overseas/maps/routes/directions",
|
|
22
|
+
"googleRoutesProxyUrl": "/overseas/maps/routes/directions/v2",
|
|
23
23
|
"themeVariables": {
|
|
24
24
|
// 默认主题
|
|
25
25
|
// TRAFFIC_UNKNOWN_BACKGROUND_COLOR: "#00C875",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
|
|
3
3
|
import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
|
|
4
4
|
import { defineSetup } from "../types/helper.js";
|
|
5
5
|
import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
|
|
@@ -124,7 +124,6 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
|
|
|
124
124
|
name: "default place name",
|
|
125
125
|
displayName: "default place displayName"
|
|
126
126
|
},
|
|
127
|
-
"enableNearbyCars": true,
|
|
128
127
|
"getAvailable": () => Promise.resolve(true),
|
|
129
128
|
"getRecomendPlace": getRecomendPlace,
|
|
130
129
|
"renderPlacePhoto": (place) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type CoordinatePlace
|
|
1
|
+
import { type CoordinatePlace } from "../types/interface";
|
|
2
2
|
export declare const DemoBusinessTaxiEnd: import("vue-demi").DefineComponent<{}, unknown, {
|
|
3
3
|
from: CoordinatePlace;
|
|
4
4
|
to: CoordinatePlace;
|
|
5
|
-
path: CoordinatePoint[];
|
|
6
5
|
contentHeight: number;
|
|
7
6
|
}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}>;
|
|
@@ -2,7 +2,6 @@ import { h } from "vue";
|
|
|
2
2
|
import { defineComponent } from "vue-demi";
|
|
3
3
|
import { BusinessTaxiEndMap } from "../business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
|
|
4
4
|
import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
|
|
5
|
-
import { mockPath } from "./demo.data.mock.js";
|
|
6
5
|
const DemoBusinessTaxiEnd = defineComponent({
|
|
7
6
|
name: "DemoBusinessTaxiEnd",
|
|
8
7
|
data() {
|
|
@@ -21,7 +20,6 @@ const DemoBusinessTaxiEnd = defineComponent({
|
|
|
21
20
|
displayName: "",
|
|
22
21
|
type: "wgs84"
|
|
23
22
|
},
|
|
24
|
-
path: [],
|
|
25
23
|
contentHeight: 200
|
|
26
24
|
};
|
|
27
25
|
},
|
|
@@ -45,16 +43,12 @@ const DemoBusinessTaxiEnd = defineComponent({
|
|
|
45
43
|
setTimeout(() => {
|
|
46
44
|
this.contentHeight = 600;
|
|
47
45
|
}, 2500);
|
|
48
|
-
setTimeout(() => {
|
|
49
|
-
this.path = [...mockPath];
|
|
50
|
-
}, 3500);
|
|
51
46
|
},
|
|
52
47
|
render() {
|
|
53
48
|
const {
|
|
54
49
|
from,
|
|
55
50
|
to,
|
|
56
|
-
contentHeight
|
|
57
|
-
path
|
|
51
|
+
contentHeight
|
|
58
52
|
} = this;
|
|
59
53
|
return h("div", {
|
|
60
54
|
"class": layout
|
|
@@ -62,8 +56,7 @@ const DemoBusinessTaxiEnd = defineComponent({
|
|
|
62
56
|
"class": adjustedDemo,
|
|
63
57
|
"attrs": {
|
|
64
58
|
"from": from,
|
|
65
|
-
"to": to
|
|
66
|
-
"path": path
|
|
59
|
+
"to": to
|
|
67
60
|
}
|
|
68
61
|
}), h("div", {
|
|
69
62
|
"style": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CoordinatePlace, type
|
|
1
|
+
import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus } from "../types/interface";
|
|
2
2
|
export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent<Readonly<{}>, {
|
|
3
3
|
mapContext: import("../hooks-business/useBusinessTaxiServiceMap").BusinessTaxiServiceContext;
|
|
4
4
|
}, {
|
|
@@ -7,9 +7,6 @@ export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent
|
|
|
7
7
|
relayTo: Partial<CoordinatePlace>;
|
|
8
8
|
status: DriverStatus;
|
|
9
9
|
contentHeight: number;
|
|
10
|
-
confirmedPath: CoordinatePoint[];
|
|
11
|
-
endServicePath: CoordinatePoint[];
|
|
12
10
|
}, {}, {
|
|
13
11
|
getDriverPositionTrack(): Promise<CoordinateTrackPoint[]>;
|
|
14
|
-
getDriverRouteOrTrack(): Promise<GetDriverRouteOrTrackOutput>;
|
|
15
12
|
}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<Readonly<{}>>>, {}>;
|
|
@@ -4,9 +4,7 @@ import { BusinessTaxiServiceMap } from "../business-components/BusinessTaxiServi
|
|
|
4
4
|
import { useBusinessTaxiServiceMap } from "../hooks-business/useBusinessTaxiServiceMap.js";
|
|
5
5
|
import { isCoordinatePoint } from "../utils/typeChecking.js";
|
|
6
6
|
import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
|
|
7
|
-
import { mockConfirmedPath, mockExternalRoute } from "./demo.data.mock.js";
|
|
8
7
|
const allDriverStatus = ["dispatching", "book-dispatching", "dispatched", "driverStartRelayService", "driverStartService", "book-driverStartService", "book-dispatched", "driverArrived", "inService", "canceled", "endService", "completed", "canceling", "banlanceRefund", "waitBanlanceRefund", "rechargePayed", "waitRechargePay", "payed", "waitpay", "refund", "confirmed", "assign"];
|
|
9
|
-
const mockDriverRoute = mockExternalRoute;
|
|
10
8
|
const mockDriverTrackPoints = [{
|
|
11
9
|
lng: 121.4036983,
|
|
12
10
|
lat: 31.216324,
|
|
@@ -42,9 +40,7 @@ const DemoBusinessTaxiService = defineComponent({
|
|
|
42
40
|
to: {},
|
|
43
41
|
relayTo: {},
|
|
44
42
|
status: "driverStartRelayService",
|
|
45
|
-
contentHeight: 200
|
|
46
|
-
confirmedPath: [],
|
|
47
|
-
endServicePath: []
|
|
43
|
+
contentHeight: 200
|
|
48
44
|
};
|
|
49
45
|
},
|
|
50
46
|
created() {
|
|
@@ -89,24 +85,10 @@ const DemoBusinessTaxiService = defineComponent({
|
|
|
89
85
|
type
|
|
90
86
|
});
|
|
91
87
|
};
|
|
92
|
-
window.updateDriverRoute = () => {
|
|
93
|
-
mockDriverRoute.path = mockDriverRoute.path.slice(5);
|
|
94
|
-
};
|
|
95
|
-
window.updateConfirmedPath = () => {
|
|
96
|
-
this.confirmedPath = [...mockConfirmedPath];
|
|
97
|
-
};
|
|
98
|
-
window.updateEndServicePath = () => {
|
|
99
|
-
this.endServicePath = [...mockConfirmedPath];
|
|
100
|
-
};
|
|
101
88
|
},
|
|
102
89
|
methods: {
|
|
103
90
|
getDriverPositionTrack() {
|
|
104
91
|
return Promise.resolve(mockDriverTrackPoints);
|
|
105
|
-
},
|
|
106
|
-
getDriverRouteOrTrack() {
|
|
107
|
-
return Promise.resolve({
|
|
108
|
-
routes: mockDriverRoute
|
|
109
|
-
});
|
|
110
92
|
}
|
|
111
93
|
},
|
|
112
94
|
render() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { googleEncodedPolyline2googleLatLng } from "../utils/transform.js";
|
|
2
2
|
import { isProxyServiceError, createTypeError } from "../utils/typeChecking.js";
|
|
3
|
+
const DEFAULT_GOOGLE_ROUTES_FIELDS = ["routes.polyline", "routes.legs"];
|
|
3
4
|
const ALL_ROUTES_STATUS = [
|
|
4
5
|
"OK",
|
|
5
6
|
"CANCELLED",
|
|
@@ -104,6 +105,7 @@ async function apiGoogleRoutes(props) {
|
|
|
104
105
|
const { protocol, host } = location;
|
|
105
106
|
const baseUrl = proxyUrl.startsWith(protocol) ? void 0 : `${protocol}//${host}`;
|
|
106
107
|
const url = new URL(proxyUrl, baseUrl);
|
|
108
|
+
url.searchParams.set("fields", DEFAULT_GOOGLE_ROUTES_FIELDS.join(","));
|
|
107
109
|
const response = await fetch(url, {
|
|
108
110
|
method: "POST",
|
|
109
111
|
headers: { "Content-Type": "application/json" },
|
|
@@ -5,7 +5,7 @@ import { type UseMapDragProps } from "../../hooks/useMapDrag";
|
|
|
5
5
|
import type { UseMapPlaceProps } from "../../hooks/useMapPlace";
|
|
6
6
|
import { type UseMapRecomendPlaceProps } from "../../hooks/useMapRecomendPlace";
|
|
7
7
|
import type { Coordinatify, CoordinatifyProps } from "../../types/coordinatify";
|
|
8
|
-
import { type BusinessGeolocationPositionError, type CoordinatePlace } from "../../types/interface";
|
|
8
|
+
import { type BusinessGeolocationPositionError, type CoordinatePlace, type CoordinatePoint } from "../../types/interface";
|
|
9
9
|
import { type AbsoluteAddressBoxProps } from "../AbsoluteAddressBox";
|
|
10
10
|
import { type PickupPointsProps } from "../PickupPoints";
|
|
11
11
|
export declare const RECOMMEND_PLACE_DRAG_LIMIT = 10;
|
|
@@ -28,12 +28,12 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
28
28
|
emptyTitle: string;
|
|
29
29
|
queryingTitle: string;
|
|
30
30
|
recomendDescription: string;
|
|
31
|
-
enableNearbyCars?: boolean;
|
|
32
31
|
disableLocator?: boolean;
|
|
33
32
|
disableLocatorPhoto?: boolean;
|
|
34
33
|
geoErrorOnceNotificationKey?: string;
|
|
35
34
|
mapContext: CoordinatifyProps<BusinessRecomendPlaceContext>;
|
|
36
35
|
defaultCenterPlace?: CoordinatePlace | ((place?: CoordinatePlace) => CoordinatePlace | undefined);
|
|
36
|
+
skipWaitGeo?: boolean | CoordinatePlace | CoordinatePoint;
|
|
37
37
|
renderPlacePhoto?: (place: CoordinatePlace) => undefined | {
|
|
38
38
|
src: string;
|
|
39
39
|
title?: string;
|
|
@@ -2,6 +2,7 @@ import "vue";
|
|
|
2
2
|
import "vue-demi";
|
|
3
3
|
import "../../api/browser.js";
|
|
4
4
|
import "../../api/memory.js";
|
|
5
|
+
import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
|
|
5
6
|
import "../../components/MapProvider/MapProvider.js";
|
|
6
7
|
import "../../demi-polyfill/demi-polyfill.js";
|
|
7
8
|
import "../../hooks/useGeoLocation.js";
|
|
@@ -26,12 +27,10 @@ import "../DeviceOrientation/DeviceOrientation.js";
|
|
|
26
27
|
import "../GreenZone/GreenZone.js";
|
|
27
28
|
import "../PassengerCircle/PassengerCircle.js";
|
|
28
29
|
import "../PickupPoints/PickupPoints.js";
|
|
29
|
-
import "../TaxiCar/RandomCars.js";
|
|
30
30
|
import "./useCacheCenterPlace.js";
|
|
31
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.eebd0822.js";
|
|
32
31
|
export {
|
|
33
32
|
B as BusinessRecomendPlaceMap,
|
|
34
|
-
|
|
33
|
+
g as BusinessRecomendPlaceMapInner,
|
|
35
34
|
D as DEFAULT_ZOOM,
|
|
36
35
|
E as EMPTY_PLACE,
|
|
37
36
|
R as RECOMMEND_PLACE_DRAG_LIMIT,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B,
|
|
1
|
+
import { B, g, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BusinessRecomendPlaceMap,
|
|
4
|
-
|
|
4
|
+
g as BusinessRecomendPlaceMapInner,
|
|
5
5
|
D as DEFAULT_ZOOM,
|
|
6
6
|
E as EMPTY_PLACE,
|
|
7
7
|
R as RECOMMEND_PLACE_DRAG_LIMIT,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { CoordinatePlace, Point } from "../../types/interface";
|
|
1
|
+
import type { CoordinatePlace, CoordinatePoint, Point } from "../../types/interface";
|
|
2
2
|
interface UseDefaultCenterPlaceProps {
|
|
3
3
|
emptyTitle: string;
|
|
4
4
|
geoLoadingTitle: string;
|
|
5
|
+
skipWaitGeo?: boolean | CoordinatePlace | CoordinatePoint;
|
|
5
6
|
defaultCenterPlace?: CoordinatePlace | ((place?: CoordinatePlace) => CoordinatePlace | undefined);
|
|
6
7
|
}
|
|
7
8
|
export declare const useCacheCenterPlace: (props: UseDefaultCenterPlaceProps) => {
|
|
@@ -3,13 +3,21 @@ import { apiGetCenterPlaceFromCache } from "../../api/browser.js";
|
|
|
3
3
|
import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
|
|
4
4
|
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
5
5
|
import { maybeFunctionToFunction, lnglat2point } from "../../utils/transform.js";
|
|
6
|
+
import { t as throttle } from "../../chunks/throttle.8bdd8d3b.js";
|
|
6
7
|
const IS_FIRST_LOAD_KEY = "IS_FIRST_LOAD_KEY";
|
|
8
|
+
const THROTTLE_TIME = 3e3;
|
|
9
|
+
const throttledApiMemoryShouldSkipByKey = throttle(apiMemoryShouldSkipByKey, THROTTLE_TIME, {
|
|
10
|
+
trailing: false
|
|
11
|
+
});
|
|
7
12
|
const useCacheCenterPlace = (props) => {
|
|
8
|
-
|
|
9
|
-
const
|
|
13
|
+
var _a;
|
|
14
|
+
const { geoLoadingTitle, emptyTitle, skipWaitGeo } = props;
|
|
15
|
+
const isAppFirstLoad = !throttledApiMemoryShouldSkipByKey(IS_FIRST_LOAD_KEY);
|
|
16
|
+
const isFirstLoadWithGps = isAppFirstLoad && !skipWaitGeo;
|
|
10
17
|
const getDefaultCenterPlace = maybeFunctionToFunction(props.defaultCenterPlace);
|
|
11
18
|
const { unCoordinatifyPlace } = useMapCoordinatify();
|
|
12
|
-
const
|
|
19
|
+
const inputSkipGeoPlace = typeof skipWaitGeo === "object" ? skipWaitGeo : void 0;
|
|
20
|
+
const inputDefaultCenterPlace = (_a = isAppFirstLoad ? inputSkipGeoPlace : void 0) != null ? _a : getDefaultCenterPlace == null ? void 0 : getDefaultCenterPlace(apiGetCenterPlaceFromCache());
|
|
13
21
|
const defaultCenterPlace = {
|
|
14
22
|
lng: 0,
|
|
15
23
|
lat: 0,
|
|
@@ -21,10 +29,10 @@ const useCacheCenterPlace = (props) => {
|
|
|
21
29
|
const centerPlace = reactive({
|
|
22
30
|
lng: defaultCenterPlace.lng,
|
|
23
31
|
lat: defaultCenterPlace.lat,
|
|
24
|
-
name:
|
|
25
|
-
displayName:
|
|
32
|
+
name: isFirstLoadWithGps ? geoLoadingTitle : defaultCenterPlace.name,
|
|
33
|
+
displayName: isFirstLoadWithGps ? geoLoadingTitle : defaultCenterPlace.displayName
|
|
26
34
|
});
|
|
27
|
-
return { isFirstLoad, centerPlace, geoDefaultPosition, defaultCenterPlace };
|
|
35
|
+
return { isFirstLoad: isFirstLoadWithGps, centerPlace, geoDefaultPosition, defaultCenterPlace };
|
|
28
36
|
};
|
|
29
37
|
export {
|
|
30
38
|
useCacheCenterPlace
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
2
|
import { reactive, watch, watchEffect, onUnmounted } from "vue-demi";
|
|
3
3
|
import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
|
|
4
|
+
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, f as airportSgnBounds } from "../../chunks/BusinessRecomendPlaceMap.ed4b75d5.js";
|
|
4
5
|
import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
|
|
5
6
|
import { createElement } from "../../demi-polyfill/demi-polyfill.js";
|
|
6
7
|
import { useGeoLocation } from "../../hooks/useGeoLocation.js";
|
|
@@ -21,7 +22,6 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
|
|
|
21
22
|
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
|
|
22
23
|
import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
|
|
23
24
|
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.eebd0822.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";
|
|
@@ -74,7 +74,11 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
74
74
|
setFitZoom
|
|
75
75
|
} = useMapFitZoom({
|
|
76
76
|
mapRef,
|
|
77
|
-
padding: ZONE_FITVIEW_PANDING
|
|
77
|
+
padding: ZONE_FITVIEW_PANDING,
|
|
78
|
+
certainZoomAreas: [{
|
|
79
|
+
zoom: DEFAULT_ZOOM,
|
|
80
|
+
points: airportSgnBounds
|
|
81
|
+
}]
|
|
78
82
|
});
|
|
79
83
|
const {
|
|
80
84
|
assertSupplier
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Place } from "../../types/interface";
|
|
2
2
|
export interface BusinessTaxiEndMapProps {
|
|
3
|
-
from: Partial<
|
|
4
|
-
to: Partial<
|
|
5
|
-
path?: CoordinatePoint[];
|
|
3
|
+
from: Partial<Place>;
|
|
4
|
+
to: Partial<Place>;
|
|
6
5
|
}
|
|
7
6
|
export declare const BusinessTaxiEndMapInner: import("vue/types/v3-define-component").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, BusinessTaxiEndMapProps>;
|
|
8
7
|
export declare const BusinessTaxiEndMap: import("vue/types/v3-define-component").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, BusinessTaxiEndMapProps>;
|
|
@@ -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
|
|
11
|
+
import { isCoordinatePoint, toCoordinatePlaceType } from "../../utils/typeChecking.js";
|
|
12
12
|
import { SectionEndService } from "../BusinessTaxiServiceMap/BusinessTaxiServiceSection.js";
|
|
13
13
|
const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(props, {
|
|
14
14
|
attrs
|
|
@@ -18,7 +18,6 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
18
18
|
setMap
|
|
19
19
|
} = useHeycarMap();
|
|
20
20
|
const {
|
|
21
|
-
unCoordinatifyPoint,
|
|
22
21
|
unCoordinatifyPlace
|
|
23
22
|
} = useMapCoordinatify();
|
|
24
23
|
const {
|
|
@@ -32,13 +31,11 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
32
31
|
return () => {
|
|
33
32
|
const {
|
|
34
33
|
from: inputFrom,
|
|
35
|
-
to: inputTo
|
|
36
|
-
path: inputPath
|
|
34
|
+
to: inputTo
|
|
37
35
|
} = props;
|
|
38
36
|
const isReady = isCoordinatePoint(inputFrom) && isCoordinatePoint(inputTo);
|
|
39
37
|
const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
|
|
40
38
|
const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
|
|
41
|
-
const path = inputPath == null ? void 0 : inputPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
|
|
42
39
|
const center = isReady ? place2point(from) : [...BEIJIN_POINT];
|
|
43
40
|
return h(HeycarMap, {
|
|
44
41
|
"class": attrs.class,
|
|
@@ -56,7 +53,6 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
56
53
|
"attrs": {
|
|
57
54
|
"from": from,
|
|
58
55
|
"to": to,
|
|
59
|
-
"routePath": path,
|
|
60
56
|
"registerOverlay": registerFitVeiw
|
|
61
57
|
}
|
|
62
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,
|
|
4
|
+
import type { CoordinatePlace, CoordinateTrackPoint, DriverStatus } from "../../types/interface";
|
|
5
5
|
export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps, "center" | "zoom" | "mapRef">> & {
|
|
6
6
|
from: CoordinatePlace;
|
|
7
7
|
to: CoordinatePlace;
|
|
@@ -15,8 +15,6 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
|
|
|
15
15
|
driverStatus: DriverStatus;
|
|
16
16
|
interval: number;
|
|
17
17
|
disablePassenger?: boolean;
|
|
18
|
-
confirmedPath?: CoordinatePoint[];
|
|
19
|
-
endServicePath?: CoordinatePoint[];
|
|
20
18
|
mapContext: CoordinatifyProps<BusinessTaxiServiceContext>;
|
|
21
19
|
renderStartSerivceTitle: (titleProps: {
|
|
22
20
|
distance: number;
|
|
@@ -27,7 +25,6 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
|
|
|
27
25
|
duration: number;
|
|
28
26
|
}) => string;
|
|
29
27
|
getDriverPositionTrack?: () => Promise<CoordinateTrackPoint[]>;
|
|
30
|
-
getDriverRouteOrTrack?: () => Promise<GetDriverRouteOrTrackOutput>;
|
|
31
28
|
};
|
|
32
29
|
export declare const BusinessTaxiServiceMapInner: import("vue-demi").DefineComponent<import("@vue/runtime-core").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", BusinessTaxiServiceMapProps>;
|
|
33
30
|
export declare const BusinessTaxiServiceMap: import("vue-demi").DefineComponent<import("@vue/runtime-core").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", BusinessTaxiServiceMapProps>;
|