@heycar/heycars-map 1.0.0-coordinate2 → 1.0.0-coordinate3
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 +27 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/v2/App.js +2 -2
- package/dist/v2/Demo/DemoBusinessQuoting.js +8 -3
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +7 -2
- package/dist/v2/Demo/DemoBusinessReselectPlace.js +7 -2
- package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +3 -1
- package/dist/v2/Demo/DemoBusinessTaxiEnd.js +18 -2
- package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -0
- package/dist/v2/Demo/DemoBusinessTaxiService.js +11 -2
- package/dist/v2/api/googleConnection.d.ts +5 -0
- package/dist/v2/api/googleConnection.js +51 -0
- package/dist/v2/api/googleSnapRoad.js +26 -2
- package/dist/v2/business-components/AuxiliaryLine/AuxiliaryLine.d.ts +3 -3
- package/dist/v2/business-components/AuxiliaryLine/AuxiliaryLine.js +9 -10
- package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +3 -1
- package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +4 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +3 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +4 -0
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +4 -0
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -1
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +3 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +6 -1
- package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.js +5 -3
- package/dist/v2/hooks/useGoogleConnection.d.ts +7 -0
- package/dist/v2/hooks/useGoogleConnection.js +15 -0
- package/dist/v2/hooks/useMapCoordinatify.js +1 -1
- package/dist/v2/hooks/useMapGeometry.d.ts +3 -3
- package/dist/v2/hooks/useMapGeometry.js +26 -15
- package/dist/v2/hooks-business/useBusinessQuotingMap.d.ts +1 -0
- package/dist/v2/hooks-business/useBusinessQuotingMap.js +3 -1
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.d.ts +1 -0
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +3 -0
- package/dist/v2/hooks-business/useBusinessReselectPlaceMap.d.ts +1 -0
- package/dist/v2/hooks-business/useBusinessTaxiEndMap.d.ts +3 -0
- package/dist/v2/hooks-business/useBusinessTaxiEndMap.js +7 -0
- package/dist/v2/hooks-business/useBusinessTaxiServiceMap.d.ts +1 -0
- package/dist/v2/hooks-business/useBusinessTaxiServiceMap.js +3 -1
- package/dist/v2/types/interface.d.ts +1 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/App.js +2 -2
- package/dist/v3/Demo/DemoBusinessQuoting.js +8 -3
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +7 -2
- package/dist/v3/Demo/DemoBusinessReselectPlace.js +7 -2
- package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +3 -1
- package/dist/v3/Demo/DemoBusinessTaxiEnd.js +17 -3
- package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -0
- package/dist/v3/Demo/DemoBusinessTaxiService.js +10 -3
- package/dist/v3/api/googleConnection.d.ts +5 -0
- package/dist/v3/api/googleConnection.js +51 -0
- package/dist/v3/api/googleSnapRoad.js +26 -2
- package/dist/v3/business-components/AuxiliaryLine/AuxiliaryLine.d.ts +3 -3
- package/dist/v3/business-components/AuxiliaryLine/AuxiliaryLine.js +9 -10
- package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +3 -1
- package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +4 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +3 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +4 -0
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +4 -0
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +3 -1
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +3 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +6 -1
- package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.js +5 -3
- package/dist/v3/hooks/useGoogleConnection.d.ts +7 -0
- package/dist/v3/hooks/useGoogleConnection.js +15 -0
- package/dist/v3/hooks/useMapCoordinatify.js +1 -1
- package/dist/v3/hooks/useMapGeometry.d.ts +3 -3
- package/dist/v3/hooks/useMapGeometry.js +26 -15
- package/dist/v3/hooks-business/useBusinessQuotingMap.d.ts +1 -0
- package/dist/v3/hooks-business/useBusinessQuotingMap.js +3 -1
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.d.ts +1 -0
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +3 -0
- package/dist/v3/hooks-business/useBusinessReselectPlaceMap.d.ts +1 -0
- package/dist/v3/hooks-business/useBusinessTaxiEndMap.d.ts +3 -0
- package/dist/v3/hooks-business/useBusinessTaxiEndMap.js +7 -0
- package/dist/v3/hooks-business/useBusinessTaxiServiceMap.d.ts +1 -0
- package/dist/v3/hooks-business/useBusinessTaxiServiceMap.js +3 -1
- package/dist/v3/types/interface.d.ts +1 -0
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,6 +92,8 @@ export enum CenterPlaceStatus {
|
|
|
92
92
|
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
93
93
|
OK = "OK",
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
export type GoogleConnectionStatus = "pending" | "connected" | "unconnected";
|
|
95
97
|
```
|
|
96
98
|
|
|
97
99
|
#### 在 入口文件添加 `MapProvider`
|
|
@@ -158,6 +160,7 @@ export default defineComponent({
|
|
|
158
160
|
setup() {
|
|
159
161
|
const {
|
|
160
162
|
centerPlace,
|
|
163
|
+
googleConnectionStatus,
|
|
161
164
|
mapContext,
|
|
162
165
|
setCenterPlaceByUserSpecified,
|
|
163
166
|
setCenterPlaceByUserSpecifiedInZone,
|
|
@@ -263,6 +266,10 @@ export default defineComponent({
|
|
|
263
266
|
isBusinessTimeout ? "给用户超时提示" : "给用户无权限反馈",
|
|
264
267
|
);
|
|
265
268
|
}}
|
|
269
|
+
onChangeGoogleConnection={(status) =>
|
|
270
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
271
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
272
|
+
}
|
|
266
273
|
/>
|
|
267
274
|
);
|
|
268
275
|
},
|
|
@@ -281,6 +288,7 @@ export default defineComponent({
|
|
|
281
288
|
setup() {
|
|
282
289
|
const {
|
|
283
290
|
centerPlace,
|
|
291
|
+
googleConnectionStatus,
|
|
284
292
|
mapContext,
|
|
285
293
|
setCenterPlaceByUserSpecified,
|
|
286
294
|
setCenterPlaceByUserSpecifiedInZone,
|
|
@@ -411,6 +419,10 @@ export default defineComponent({
|
|
|
411
419
|
isBusinessTimeout ? "给用户超时提示" : "给用户无权限反馈",
|
|
412
420
|
);
|
|
413
421
|
}}
|
|
422
|
+
onChangeGoogleConnection={(status) =>
|
|
423
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
424
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
425
|
+
}
|
|
414
426
|
/>
|
|
415
427
|
);
|
|
416
428
|
},
|
|
@@ -427,7 +439,7 @@ import { BusinessQuotingMap, useBusinessQuotingMap } from "@heycar/heycars-map";
|
|
|
427
439
|
|
|
428
440
|
export default defineComponent({
|
|
429
441
|
setup() {
|
|
430
|
-
const { setMap, registerFitVeiw } = useBusinessQuotingMap();
|
|
442
|
+
const { googleConnectionStatus, setMap, registerFitVeiw } = useBusinessQuotingMap();
|
|
431
443
|
return () => (
|
|
432
444
|
<BusinessQuotingMap
|
|
433
445
|
class={"demo"}
|
|
@@ -453,6 +465,10 @@ export default defineComponent({
|
|
|
453
465
|
registerOverlay={registerFitVeiw}
|
|
454
466
|
onClickStartPoint={(place) => console.log("点击起点时触发 palce = ", place)}
|
|
455
467
|
onClickEndPoint={(place) => console.log("点击终点时触发 palce = ", place)}
|
|
468
|
+
onChangeGoogleConnection={(status) =>
|
|
469
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
470
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
471
|
+
}
|
|
456
472
|
/>
|
|
457
473
|
);
|
|
458
474
|
},
|
|
@@ -469,7 +485,7 @@ import { BusinessTaxiServiceMap, useBusinessTaxiServiceMap } from "@heycar/heyca
|
|
|
469
485
|
|
|
470
486
|
export default defineComponent({
|
|
471
487
|
setup() {
|
|
472
|
-
const { setMap, registerFitVeiw } = useBusinessTaxiServiceMap();
|
|
488
|
+
const { googleConnectionStatus, setMap, registerFitVeiw } = useBusinessTaxiServiceMap();
|
|
473
489
|
return () => (
|
|
474
490
|
<BusinessTaxiServiceMap
|
|
475
491
|
class={css.adjustedDemo}
|
|
@@ -508,6 +524,10 @@ export default defineComponent({
|
|
|
508
524
|
interval={5000}
|
|
509
525
|
mapRef={setMap}
|
|
510
526
|
registerOverlay={registerFitVeiw}
|
|
527
|
+
onChangeGoogleConnection={(status) =>
|
|
528
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
529
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
530
|
+
}
|
|
511
531
|
/>
|
|
512
532
|
);
|
|
513
533
|
},
|
|
@@ -524,6 +544,7 @@ import { BusinessTaxiEndMap } from "@heycar/heycars-map";
|
|
|
524
544
|
|
|
525
545
|
export default defineComponent({
|
|
526
546
|
setup() {
|
|
547
|
+
const { googleConnectionStatus } = useBusinessTaxiEndMap();
|
|
527
548
|
return () => (
|
|
528
549
|
<BusinessTaxiEndMap
|
|
529
550
|
class={"demo"}
|
|
@@ -541,6 +562,10 @@ export default defineComponent({
|
|
|
541
562
|
displayName: "长城美华 Coffee Shop (CCMW)",
|
|
542
563
|
type: "wgs84",
|
|
543
564
|
}}
|
|
565
|
+
onChangeGoogleConnection={(status) =>
|
|
566
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
567
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
568
|
+
}
|
|
544
569
|
/>
|
|
545
570
|
);
|
|
546
571
|
},
|
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 } from "vue-demi";
|
|
3
|
-
import {
|
|
3
|
+
import { DemoBusinessTaxiEnd } from "./Demo/DemoBusinessTaxiEnd.js";
|
|
4
4
|
import { MapProvider } from "./components/MapProvider/MapProvider.js";
|
|
5
5
|
const gmapApiKey = "AIzaSyCRtkaNSWMOhOXDOUpJK4OVbm5RIstYj-I";
|
|
6
6
|
const gmapId = "d0af0c05331af64a";
|
|
@@ -19,7 +19,7 @@ const App = defineComponent({
|
|
|
19
19
|
"language": "en",
|
|
20
20
|
"supplier": "amap"
|
|
21
21
|
}
|
|
22
|
-
}, [h(
|
|
22
|
+
}, [h(DemoBusinessTaxiEnd)]);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
export {
|
|
@@ -5,10 +5,11 @@ 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
|
+
googleConnectionStatus,
|
|
8
9
|
setMap,
|
|
9
10
|
registerFitVeiw
|
|
10
11
|
} = useBusinessQuotingMap();
|
|
11
|
-
return () => h(BusinessQuotingMap, {
|
|
12
|
+
return () => h("div", [h("div", [googleConnectionStatus.value]), h(BusinessQuotingMap, {
|
|
12
13
|
"class": demo,
|
|
13
14
|
"attrs": {
|
|
14
15
|
"from": {
|
|
@@ -36,9 +37,13 @@ const DemoBusinessQuoting = defineSetup("DemoBusinessQuoting", function() {
|
|
|
36
37
|
},
|
|
37
38
|
"on": {
|
|
38
39
|
"clickStartPoint": (place) => console.log("点击起点时触发 palce = ", place),
|
|
39
|
-
"clickEndPoint": (place) => console.log("点击终点时触发 palce = ", place)
|
|
40
|
+
"clickEndPoint": (place) => console.log("点击终点时触发 palce = ", place),
|
|
41
|
+
"changeGoogleConnection": (status) => (
|
|
42
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
43
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
44
|
+
)
|
|
40
45
|
}
|
|
41
|
-
});
|
|
46
|
+
})]);
|
|
42
47
|
});
|
|
43
48
|
export {
|
|
44
49
|
DemoBusinessQuoting
|
|
@@ -53,6 +53,7 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
|
|
|
53
53
|
centerPlace,
|
|
54
54
|
mapContext,
|
|
55
55
|
geoPosition,
|
|
56
|
+
googleConnectionStatus,
|
|
56
57
|
setCenterPlaceByUserSpecified,
|
|
57
58
|
setCenterPlaceByUserSpecifiedInZone
|
|
58
59
|
} = useBusinessRecomendPlaceMap();
|
|
@@ -104,7 +105,7 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
|
|
|
104
105
|
}
|
|
105
106
|
});
|
|
106
107
|
return () => {
|
|
107
|
-
return h("div", [h("div", [JSON.stringify(centerPlace)]), h("div", [JSON.stringify(geoPosition.value)]), h(BusinessRecomendPlaceMap, {
|
|
108
|
+
return h("div", [h("div", [googleConnectionStatus.value]), h("div", [JSON.stringify(centerPlace)]), h("div", [JSON.stringify(geoPosition.value)]), h(BusinessRecomendPlaceMap, {
|
|
108
109
|
"class": demo,
|
|
109
110
|
"attrs": {
|
|
110
111
|
"geoLoadingTitle": "正在获取您当前的位置",
|
|
@@ -149,7 +150,11 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
|
|
|
149
150
|
},
|
|
150
151
|
"geoErrorOnce": (isBusinessTimeout) => {
|
|
151
152
|
console.log("获取GPS失败时触发, 只触发一次, ", isBusinessTimeout ? "给用户超时提示" : "给用户无权限反馈");
|
|
152
|
-
}
|
|
153
|
+
},
|
|
154
|
+
"changeGoogleConnection": (status) => (
|
|
155
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
156
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
157
|
+
)
|
|
153
158
|
}
|
|
154
159
|
})]);
|
|
155
160
|
};
|
|
@@ -52,6 +52,7 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
|
|
|
52
52
|
const {
|
|
53
53
|
centerPlace,
|
|
54
54
|
mapContext,
|
|
55
|
+
googleConnectionStatus,
|
|
55
56
|
setCenterPlaceByUserSpecified,
|
|
56
57
|
setCenterPlaceByUserSpecifiedInZone
|
|
57
58
|
} = useBusinessRecomendPlaceMap();
|
|
@@ -109,7 +110,7 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
|
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
112
|
return () => {
|
|
112
|
-
return h("div", [h("div", [JSON.stringify(centerPlace)]), h(BusinessReselectPlaceMap, {
|
|
113
|
+
return h("div", [h("div", [googleConnectionStatus.value]), h("div", [JSON.stringify(centerPlace)]), h(BusinessReselectPlaceMap, {
|
|
113
114
|
"class": demo,
|
|
114
115
|
"attrs": {
|
|
115
116
|
"unavailableTitle": "当前区域暂未开通服务",
|
|
@@ -150,7 +151,11 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
|
|
|
150
151
|
},
|
|
151
152
|
"geoErrorOnce": (isBusinessTimeout) => {
|
|
152
153
|
console.log("获取GPS失败时触发, 只触发一次, ", isBusinessTimeout ? "给用户超时提示" : "给用户无权限反馈");
|
|
153
|
-
}
|
|
154
|
+
},
|
|
155
|
+
"changeGoogleConnection": (status) => (
|
|
156
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
157
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
158
|
+
)
|
|
154
159
|
}
|
|
155
160
|
})]);
|
|
156
161
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type CoordinatePlace } from "../types/interface";
|
|
2
|
-
export declare const DemoBusinessTaxiEnd: import("vue-demi").DefineComponent<{},
|
|
2
|
+
export declare const DemoBusinessTaxiEnd: import("vue-demi").DefineComponent<{}, {
|
|
3
|
+
googleConnectionStatus: Readonly<import("vue-demi").Ref<import("../types/interface").GoogleConnectionStatus>>;
|
|
4
|
+
}, {
|
|
3
5
|
from: CoordinatePlace;
|
|
4
6
|
to: CoordinatePlace;
|
|
5
7
|
contentHeight: number;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
2
|
import { defineComponent } from "vue-demi";
|
|
3
3
|
import { BusinessTaxiEndMap } from "../business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
|
|
4
|
+
import { useBusinessTaxiEndMap } from "../hooks-business/useBusinessTaxiEndMap.js";
|
|
4
5
|
import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
|
|
5
6
|
const DemoBusinessTaxiEnd = defineComponent({
|
|
6
7
|
name: "DemoBusinessTaxiEnd",
|
|
8
|
+
setup() {
|
|
9
|
+
const {
|
|
10
|
+
googleConnectionStatus
|
|
11
|
+
} = useBusinessTaxiEndMap();
|
|
12
|
+
return {
|
|
13
|
+
googleConnectionStatus
|
|
14
|
+
};
|
|
15
|
+
},
|
|
7
16
|
data() {
|
|
8
17
|
return {
|
|
9
18
|
from: {
|
|
@@ -48,15 +57,22 @@ const DemoBusinessTaxiEnd = defineComponent({
|
|
|
48
57
|
const {
|
|
49
58
|
from,
|
|
50
59
|
to,
|
|
51
|
-
contentHeight
|
|
60
|
+
contentHeight,
|
|
61
|
+
googleConnectionStatus
|
|
52
62
|
} = this;
|
|
53
63
|
return h("div", {
|
|
54
64
|
"class": layout
|
|
55
|
-
}, [h("div", [JSON.stringify(from), " | ", JSON.stringify(to)]), h(BusinessTaxiEndMap, {
|
|
65
|
+
}, [h("div", [googleConnectionStatus]), h("div", [JSON.stringify(from), " | ", JSON.stringify(to)]), h(BusinessTaxiEndMap, {
|
|
56
66
|
"class": adjustedDemo,
|
|
57
67
|
"attrs": {
|
|
58
68
|
"from": from,
|
|
59
69
|
"to": to
|
|
70
|
+
},
|
|
71
|
+
"on": {
|
|
72
|
+
"changeGoogleConnection": (status) => (
|
|
73
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
74
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
|
|
75
|
+
)
|
|
60
76
|
}
|
|
61
77
|
}), h("div", {
|
|
62
78
|
"style": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
2
|
import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus } from "../types/interface";
|
|
3
3
|
export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent<Readonly<{}>, {
|
|
4
|
+
googleConnectionStatus: Readonly<import("vue-demi").Ref<import("../types/interface").GoogleConnectionStatus>>;
|
|
4
5
|
setMap: import("../hooks/useHeycarMap").SetMap<import("../components/Amap/SafeAmap").SafeAmap> | import("../hooks/useHeycarMap").SetMap<google.maps.Map>;
|
|
5
6
|
registerFitVeiw: import("../types/interface").RegisterOverlay<({
|
|
6
7
|
_needUpdate: boolean;
|
|
@@ -9,10 +9,12 @@ const DemoBusinessTaxiService = defineComponent({
|
|
|
9
9
|
name: "DemoBusinessTaxiService",
|
|
10
10
|
setup() {
|
|
11
11
|
const {
|
|
12
|
+
googleConnectionStatus,
|
|
12
13
|
setMap,
|
|
13
14
|
registerFitVeiw
|
|
14
15
|
} = useBusinessTaxiServiceMap();
|
|
15
16
|
return {
|
|
17
|
+
googleConnectionStatus,
|
|
16
18
|
setMap,
|
|
17
19
|
registerFitVeiw
|
|
18
20
|
};
|
|
@@ -82,7 +84,8 @@ const DemoBusinessTaxiService = defineComponent({
|
|
|
82
84
|
registerFitVeiw,
|
|
83
85
|
from,
|
|
84
86
|
to,
|
|
85
|
-
status
|
|
87
|
+
status,
|
|
88
|
+
googleConnectionStatus
|
|
86
89
|
} = this;
|
|
87
90
|
const isReady = isCoordinatePoint(from) && isCoordinatePoint(to);
|
|
88
91
|
if (!isReady)
|
|
@@ -92,7 +95,7 @@ const DemoBusinessTaxiService = defineComponent({
|
|
|
92
95
|
} = this;
|
|
93
96
|
return h("div", {
|
|
94
97
|
"class": layout
|
|
95
|
-
}, [h(BusinessTaxiServiceMap, {
|
|
98
|
+
}, [h("div", [googleConnectionStatus]), h(BusinessTaxiServiceMap, {
|
|
96
99
|
"class": adjustedDemo,
|
|
97
100
|
"attrs": {
|
|
98
101
|
"from": from,
|
|
@@ -113,6 +116,12 @@ const DemoBusinessTaxiService = defineComponent({
|
|
|
113
116
|
"interval": 5e3,
|
|
114
117
|
"mapRef": setMap,
|
|
115
118
|
"registerOverlay": registerFitVeiw
|
|
119
|
+
},
|
|
120
|
+
"on": {
|
|
121
|
+
"changeGoogleConnection": (status2) => (
|
|
122
|
+
// 根据目前的产品需求,连通性检测只会被检测一次。
|
|
123
|
+
console.log("谷歌连通性发生变化时触发,连通性状态是:", status2)
|
|
124
|
+
)
|
|
116
125
|
}
|
|
117
126
|
}), h("div", {
|
|
118
127
|
"style": {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { GoogleConnectionStatus } from "../types/interface";
|
|
2
|
+
export type GoogleConnectionOnChangeHandler = (status: GoogleConnectionStatus) => void;
|
|
3
|
+
export type GoogleConnectionOnChangeCleanup = () => void;
|
|
4
|
+
export declare const apiGoogleConnectionStatus: () => GoogleConnectionStatus;
|
|
5
|
+
export declare const apiSubscribeGoogleConnectionChange: (handler: GoogleConnectionOnChangeHandler) => GoogleConnectionOnChangeCleanup;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
const GOOGLE_DNS_RESOLVER = "https://dns.google/resolve?name=maps.googleapis.com&type=A";
|
|
8
|
+
const GOOGLE_CONNECTION_DEFAULT_TIMEOUT = 5e3;
|
|
9
|
+
const noop = () => {
|
|
10
|
+
};
|
|
11
|
+
class GoogleConnection {
|
|
12
|
+
constructor() {
|
|
13
|
+
__publicField(this, "status", "pending");
|
|
14
|
+
__publicField(this, "listeners", /* @__PURE__ */ new Set());
|
|
15
|
+
this.start();
|
|
16
|
+
}
|
|
17
|
+
async start() {
|
|
18
|
+
const status = await this.check();
|
|
19
|
+
this.status = status;
|
|
20
|
+
for (const handler of this.listeners) {
|
|
21
|
+
try {
|
|
22
|
+
handler(status);
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error(err);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
check(timeout = GOOGLE_CONNECTION_DEFAULT_TIMEOUT) {
|
|
29
|
+
const controller = new AbortController();
|
|
30
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
31
|
+
return fetch(GOOGLE_DNS_RESOLVER, { signal: controller.signal }).then(() => "connected").catch(() => "unconnected").finally(() => clearTimeout(timer));
|
|
32
|
+
}
|
|
33
|
+
onChange(handler) {
|
|
34
|
+
if (typeof handler !== "function")
|
|
35
|
+
return noop;
|
|
36
|
+
this.listeners.add(handler);
|
|
37
|
+
const clear = () => {
|
|
38
|
+
this.listeners.delete(handler);
|
|
39
|
+
};
|
|
40
|
+
return clear;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const googleConnection = new GoogleConnection();
|
|
44
|
+
const apiGoogleConnectionStatus = () => {
|
|
45
|
+
return googleConnection.status;
|
|
46
|
+
};
|
|
47
|
+
const apiSubscribeGoogleConnectionChange = (handler) => googleConnection.onChange(handler);
|
|
48
|
+
export {
|
|
49
|
+
apiGoogleConnectionStatus,
|
|
50
|
+
apiSubscribeGoogleConnectionChange
|
|
51
|
+
};
|
|
@@ -7,6 +7,27 @@ const point2snappedPoint = (point) => {
|
|
|
7
7
|
const [longitude, latitude] = point;
|
|
8
8
|
return { location: { longitude, latitude }, placeId: "" };
|
|
9
9
|
};
|
|
10
|
+
function assertLatitudeLongitudeLiteral(value) {
|
|
11
|
+
if (value && typeof value.longitude === "number" && typeof value.latitude === "number")
|
|
12
|
+
return;
|
|
13
|
+
throw Error(`MyError: expect type LatitudeLongitudeLiteral, actual is: ${JSON.stringify(value)}`);
|
|
14
|
+
}
|
|
15
|
+
function assertSnappedPoint(value) {
|
|
16
|
+
if (value)
|
|
17
|
+
assertLatitudeLongitudeLiteral(value.location);
|
|
18
|
+
throw Error(`MyError: expect type SnappedPoint, actual is: ${JSON.stringify(value)}`);
|
|
19
|
+
}
|
|
20
|
+
function assertSnapToRoadsResponse(value) {
|
|
21
|
+
const error = Error(
|
|
22
|
+
`MyError: expect type SnapToRoadsResponse, actual is: ${JSON.stringify(value)}`
|
|
23
|
+
);
|
|
24
|
+
if (typeof value !== "object" || value === null)
|
|
25
|
+
throw error;
|
|
26
|
+
if (!("snappedPoints" in value) || !Array.isArray(value.snappedPoints)) {
|
|
27
|
+
throw "warningMessage" in value && typeof value.warningMessage === "string" ? Error(value.warningMessage) : error;
|
|
28
|
+
}
|
|
29
|
+
value.snappedPoints.forEach(assertSnappedPoint);
|
|
30
|
+
}
|
|
10
31
|
async function apiGoogleSnapRoad(props) {
|
|
11
32
|
const { interpolate, path, proxyUrl = googleSnapRoadProxyUrl } = props;
|
|
12
33
|
if (!proxyUrl)
|
|
@@ -21,8 +42,11 @@ async function apiGoogleSnapRoad(props) {
|
|
|
21
42
|
url.searchParams.set("interpolate", String(interpolate));
|
|
22
43
|
url.searchParams.set("path", googleSnapRoadPointsStringify(path));
|
|
23
44
|
const response = await fetch(url);
|
|
24
|
-
if (response.ok)
|
|
25
|
-
|
|
45
|
+
if (response.ok) {
|
|
46
|
+
const result = await response.json();
|
|
47
|
+
assertSnapToRoadsResponse(result);
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
26
50
|
const error = await response.json();
|
|
27
51
|
if (isProxyError(error)) {
|
|
28
52
|
const { code: code2, msg } = error;
|
|
@@ -6,6 +6,6 @@ export interface AuxiliaryLineProps {
|
|
|
6
6
|
showDir?: boolean;
|
|
7
7
|
path: [number, number][];
|
|
8
8
|
}
|
|
9
|
-
export declare const AAuxiliaryLine: import("vue
|
|
10
|
-
export declare const GAuxiliaryLine: import("vue
|
|
11
|
-
export declare const AuxiliaryLine: import("vue
|
|
9
|
+
export declare const AAuxiliaryLine: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<AuxiliaryLineProps>, 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<AuxiliaryLineProps, Required<AuxiliaryLineProps>>, never, AuxiliaryLineProps>;
|
|
10
|
+
export declare const GAuxiliaryLine: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<AuxiliaryLineProps>, 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<AuxiliaryLineProps, Required<AuxiliaryLineProps>>, never, AuxiliaryLineProps>;
|
|
11
|
+
export declare const AuxiliaryLine: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<AuxiliaryLineProps>, 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<AuxiliaryLineProps, Required<AuxiliaryLineProps>>, never, AuxiliaryLineProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
import { computed } from "vue-demi";
|
|
3
2
|
import { AMAP_DEFAULT_MARKER_ICON_URL } from "../../api/cdn.js";
|
|
4
3
|
import { ZINDEX_AUXILIARY_GRASP } from "../../api/contants.js";
|
|
5
4
|
import { AmapCircle } from "../../components/AmapCircle/AmapCircle.js";
|
|
@@ -32,8 +31,6 @@ const AAuxiliaryLine = defineSetup("AAuxiliaryLine", function(props) {
|
|
|
32
31
|
opacity = 1,
|
|
33
32
|
scale = 1
|
|
34
33
|
} = props;
|
|
35
|
-
if (color === "yellow")
|
|
36
|
-
console.log("color, path = ", color, path);
|
|
37
34
|
const vw = window.innerWidth * 0.01;
|
|
38
35
|
const strokeWidth = 1 * vw;
|
|
39
36
|
const dashLength = 0.3 * vw;
|
|
@@ -110,7 +107,6 @@ const GAuxiliaryLine = defineSetup("GAuxiliaryLine", function(props) {
|
|
|
110
107
|
url: AMAP_DEFAULT_MARKER_ICON_URL,
|
|
111
108
|
scaledSize: new google.maps.Size(defaultMarkerSize * 38 / 63, defaultMarkerSize)
|
|
112
109
|
};
|
|
113
|
-
const pathRef = computed(() => props.path.map(vec2lnglat));
|
|
114
110
|
return () => {
|
|
115
111
|
const {
|
|
116
112
|
type = "dashed",
|
|
@@ -118,15 +114,16 @@ const GAuxiliaryLine = defineSetup("GAuxiliaryLine", function(props) {
|
|
|
118
114
|
opacity = 1,
|
|
119
115
|
scale = 1
|
|
120
116
|
} = props;
|
|
117
|
+
const path = props.path.map(vec2lnglat);
|
|
121
118
|
const vw = window.innerWidth * 0.01;
|
|
122
119
|
const strokeWidth = 1.25 * vw * 0.65;
|
|
123
|
-
if (pathRef.value.length < 2)
|
|
124
|
-
return;
|
|
125
120
|
switch (type) {
|
|
126
121
|
case "solid":
|
|
122
|
+
if (path.length < 2)
|
|
123
|
+
return;
|
|
127
124
|
return h(GmapPolyline, {
|
|
128
125
|
"attrs": {
|
|
129
|
-
"path":
|
|
126
|
+
"path": path,
|
|
130
127
|
"strokeWeight": strokeWidth * scale,
|
|
131
128
|
"strokeOpacity": opacity,
|
|
132
129
|
"strokeColor": color,
|
|
@@ -134,9 +131,11 @@ const GAuxiliaryLine = defineSetup("GAuxiliaryLine", function(props) {
|
|
|
134
131
|
}
|
|
135
132
|
});
|
|
136
133
|
case "dashed":
|
|
134
|
+
if (path.length < 2)
|
|
135
|
+
return;
|
|
137
136
|
return h(GmapPolyline, {
|
|
138
137
|
"attrs": {
|
|
139
|
-
"path":
|
|
138
|
+
"path": path,
|
|
140
139
|
"icons": [{
|
|
141
140
|
icon: {
|
|
142
141
|
path: `M 0,-0.5 0,0.5`,
|
|
@@ -153,7 +152,7 @@ const GAuxiliaryLine = defineSetup("GAuxiliaryLine", function(props) {
|
|
|
153
152
|
}
|
|
154
153
|
});
|
|
155
154
|
case "marker": {
|
|
156
|
-
const noneRepeatPath = Object.values(Object.fromEntries(
|
|
155
|
+
const noneRepeatPath = Object.values(Object.fromEntries(path.map((p) => [`${p.lng}|${p.lat}`, p])));
|
|
157
156
|
const points = noneRepeatPath.map((point, idx, list) => idx === list.length - 1 ? h(GmapMarker, {
|
|
158
157
|
"attrs": {
|
|
159
158
|
"position": point
|
|
@@ -167,7 +166,7 @@ const GAuxiliaryLine = defineSetup("GAuxiliaryLine", function(props) {
|
|
|
167
166
|
return h("div", [points]);
|
|
168
167
|
}
|
|
169
168
|
case "circle": {
|
|
170
|
-
const noneRepeatPath = Object.values(Object.fromEntries(
|
|
169
|
+
const noneRepeatPath = Object.values(Object.fromEntries(path.map((p) => [`${p.lng}|${p.lat}`, p])));
|
|
171
170
|
const points = noneRepeatPath.map((point) => h(GmapCircle, {
|
|
172
171
|
"attrs": {
|
|
173
172
|
"center": point,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GoogleConnectionOnChangeHandler } from "../../api/googleConnection";
|
|
1
2
|
import { type HeycarMapProps } from "../../components/MapProvider";
|
|
2
3
|
import type { MROP } from "../../hooks/useOverlay";
|
|
3
4
|
import type { CoordinatifyProps } from "../../types/coordinatify";
|
|
@@ -14,5 +15,6 @@ export type BusinessQuotingMapProps = CoordinatifyProps<Omit<HeycarMapProps, "ce
|
|
|
14
15
|
}) => string;
|
|
15
16
|
onClickStartPoint?: (value: CoordinatePlace) => void;
|
|
16
17
|
onClickEndPoint?: (value: CoordinatePlace) => void;
|
|
18
|
+
onChangeGoogleConnection?: GoogleConnectionOnChangeHandler;
|
|
17
19
|
};
|
|
18
|
-
export declare const BusinessQuotingMap: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<BusinessQuotingMapProps>, 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<BusinessQuotingMapProps, Required<BusinessQuotingMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "clickStartPoint" | "clickEndPoint", BusinessQuotingMapProps>;
|
|
20
|
+
export declare const BusinessQuotingMap: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<BusinessQuotingMapProps>, 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<BusinessQuotingMapProps, Required<BusinessQuotingMapProps>>, "resize" | "dragEnd" | "zoomEnd" | "changeGoogleConnection" | "clickStartPoint" | "clickEndPoint", BusinessQuotingMapProps>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
2
|
import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
|
|
3
|
+
import { useGoogleConnection } from "../../hooks/useGoogleConnection.js";
|
|
3
4
|
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
4
5
|
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
5
6
|
import { defineLagecySetup } from "../../types/helper.js";
|
|
@@ -30,6 +31,9 @@ const BusinessQuotingMap = defineLagecySetup("BusinessQuotingMap", function(prop
|
|
|
30
31
|
immediate: true
|
|
31
32
|
});
|
|
32
33
|
const deferedSetFitView = pipeDefer(() => registerOverlay.setFitView(true));
|
|
34
|
+
useGoogleConnection({
|
|
35
|
+
onChange: (status) => emit("changeGoogleConnection", status)
|
|
36
|
+
});
|
|
33
37
|
return () => {
|
|
34
38
|
const {
|
|
35
39
|
from: inputFromPlace,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GoogleConnectionOnChangeHandler } from "../../api/googleConnection";
|
|
1
2
|
import { type HeycarMapProps } from "../../components/MapProvider";
|
|
2
3
|
import type { BusinessRecomendPlaceContext } from "../../hooks-business/useBusinessRecomendPlaceMap";
|
|
3
4
|
import { type UseGeoLocationProps } from "../../hooks/useGeoLocation";
|
|
@@ -43,5 +44,6 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
43
44
|
onGeoErrorOnce?: (isBusinessTimeout: boolean) => void;
|
|
44
45
|
onClickLocatorText?: AbsoluteAddressBoxProps["onClickText"];
|
|
45
46
|
onClickLocatorPhoto?: AbsoluteAddressBoxProps["onClickPhoto"];
|
|
47
|
+
onChangeGoogleConnection?: GoogleConnectionOnChangeHandler;
|
|
46
48
|
}
|
|
47
|
-
export declare const BusinessRecomendPlaceMap: import("vue-demi").DefineComponent<import("vue3").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("vue3").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" | "changeGoogleConnection" | "changePlace" | "loadGeoLocation" | "loadDefaultGeoLocation" | "changeByDrag" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessRecomendPlaceMapProps>;
|
|
@@ -4,6 +4,7 @@ import { apiSaveCenterPlaceToCache } from "../../api/browser.js";
|
|
|
4
4
|
import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
|
|
5
5
|
import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
|
|
6
6
|
import { useGeoLocation } from "../../hooks/useGeoLocation.js";
|
|
7
|
+
import { useGoogleConnection } from "../../hooks/useGoogleConnection.js";
|
|
7
8
|
import { useHeycarMap } from "../../hooks/useHeycarMap.js";
|
|
8
9
|
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
9
10
|
import { useMapDrag } from "../../hooks/useMapDrag.js";
|
|
@@ -169,6 +170,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
169
170
|
emitGeoErrorOnce(error);
|
|
170
171
|
}
|
|
171
172
|
});
|
|
173
|
+
useGoogleConnection({
|
|
174
|
+
onChange: (status) => emit("changeGoogleConnection", status)
|
|
175
|
+
});
|
|
172
176
|
mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
|
|
173
177
|
mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
|
|
174
178
|
mapContext.panToGeoPositionByRecomend = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CoordinatePlace } from "../../types/interface";
|
|
2
2
|
import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap";
|
|
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"> {
|
|
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" | "onChangeGoogleConnection"> {
|
|
4
4
|
defaultPlace?: CoordinatePlace;
|
|
5
5
|
}
|
|
6
|
-
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue3").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>;
|
|
6
|
+
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue3").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>>, "changeGoogleConnection" | "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps>;
|
|
@@ -3,6 +3,7 @@ import { reactive, watchEffect } from "vue-demi";
|
|
|
3
3
|
import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
|
|
4
4
|
import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
|
|
5
5
|
import { useGeoLocation } from "../../hooks/useGeoLocation.js";
|
|
6
|
+
import { useGoogleConnection } from "../../hooks/useGoogleConnection.js";
|
|
6
7
|
import { useHeycarMap } from "../../hooks/useHeycarMap.js";
|
|
7
8
|
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
8
9
|
import { useMapDrag } from "../../hooks/useMapDrag.js";
|
|
@@ -142,6 +143,9 @@ const BusinessReselectPlaceMap = defineLagecySetup("BusinessReselectPlaceMap", f
|
|
|
142
143
|
emitGeoErrorOnce(error);
|
|
143
144
|
}
|
|
144
145
|
});
|
|
146
|
+
useGoogleConnection({
|
|
147
|
+
onChange: (status) => emit("changeGoogleConnection", status)
|
|
148
|
+
});
|
|
145
149
|
mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
|
|
146
150
|
mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
|
|
147
151
|
mapContext.panToGeoPositionByRecomend = () => {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { GoogleConnectionOnChangeHandler } from "../../api/googleConnection";
|
|
1
2
|
import type { Place } from "../../types/interface";
|
|
2
3
|
export interface BusinessTaxiEndMapProps {
|
|
3
4
|
from: Partial<Place>;
|
|
4
5
|
to: Partial<Place>;
|
|
6
|
+
onChangeGoogleConnection?: GoogleConnectionOnChangeHandler;
|
|
5
7
|
}
|
|
6
|
-
export declare const BusinessTaxiEndMap: import("vue").DefineComponent<import("vue3").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>>,
|
|
8
|
+
export declare const BusinessTaxiEndMap: import("vue").DefineComponent<import("vue3").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>>, "changeGoogleConnection", BusinessTaxiEndMapProps>;
|