@heycar/heycars-map 2.17.0-curve1 → 2.17.0-curve3
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 +22 -0
- package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +3 -1
- package/dist/v2/hooks/useDrivingRoute.js +1 -1
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/index.js +6 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +3 -1
- package/dist/v3/hooks/useDrivingRoute.js +1 -1
- package/dist/v3/index.d.ts +1 -0
- package/dist/v3/index.js +6 -0
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -818,3 +818,25 @@ isCoordinatePointEqual(
|
|
|
818
818
|
{ type: "wgs84", lng: 114.21016180538568, lat: 22.219570659901557 },
|
|
819
819
|
) === true;
|
|
820
820
|
```
|
|
821
|
+
|
|
822
|
+
```ts
|
|
823
|
+
import { inChina, inHongKong, inMacau, inTaiwan, inKorean } from "@heycar/heycars-map";
|
|
824
|
+
|
|
825
|
+
// 判断某点是否在某区域内
|
|
826
|
+
const point = [114.215114, 22.215972];
|
|
827
|
+
|
|
828
|
+
// 是否在中国 (不包含台湾)
|
|
829
|
+
inChina(point);
|
|
830
|
+
|
|
831
|
+
// 是否在香港
|
|
832
|
+
inHongKong(point);
|
|
833
|
+
|
|
834
|
+
// 是否在澳门
|
|
835
|
+
inMacau(point);
|
|
836
|
+
|
|
837
|
+
// 是否在台湾
|
|
838
|
+
inTaiwan(point);
|
|
839
|
+
|
|
840
|
+
// 是否在韩国
|
|
841
|
+
inKorean(point);
|
|
842
|
+
```
|
|
@@ -7,6 +7,7 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
|
7
7
|
import { useMapSupplier, useMapAssertSupplier } from "../../hooks/useMapSupplier.js";
|
|
8
8
|
import { defineSetup, defineLagecySetup } from "../../types/helper.js";
|
|
9
9
|
import { generateCreateElementV2PropsOn } from "../../utils/compare.js";
|
|
10
|
+
import { distanceBetweenTwoPoints } from "../../utils/geometryPolygon.js";
|
|
10
11
|
import { place2point, pipeDefer } from "../../utils/transform.js";
|
|
11
12
|
import { toCoordinatePlaceType } from "../../utils/typeChecking.js";
|
|
12
13
|
import { DrivingQuadraticBezierCurve } from "../DrivingQuadraticBezierCurve/DrivingQuadraticBezierCurve.js";
|
|
@@ -60,6 +61,7 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
|
|
|
60
61
|
const toPlace = unCoordinatifyPlace(toCoordinatePlaceType(inputToPlace));
|
|
61
62
|
const from = place2point(fromPlace);
|
|
62
63
|
const to = place2point(toPlace);
|
|
64
|
+
const distance = distanceBetweenTwoPoints(from, to);
|
|
63
65
|
return h(HeycarMap, {
|
|
64
66
|
"class": attrs.class,
|
|
65
67
|
"style": attrs.style,
|
|
@@ -96,7 +98,7 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
|
|
|
96
98
|
"position": to,
|
|
97
99
|
"title": toPlace.displayName,
|
|
98
100
|
"description": renderDescription({
|
|
99
|
-
distance
|
|
101
|
+
distance,
|
|
100
102
|
duration: 0,
|
|
101
103
|
tolls: 0
|
|
102
104
|
}),
|
|
@@ -13,7 +13,7 @@ const useADrivingRoute = (props) => {
|
|
|
13
13
|
steps: [],
|
|
14
14
|
trafficJams: void 0
|
|
15
15
|
});
|
|
16
|
-
const amapDriving = new AMap.Driving({});
|
|
16
|
+
const amapDriving = new AMap.Driving({ ferry: 1 });
|
|
17
17
|
const apiMapDrivingRoute = (from, to, waypoints = []) => {
|
|
18
18
|
return googleRoutesProxyUrl && inTaiwan(from) ? googleServiceApiDrivingRoute(from, to, waypoints, googleRoutesProxyUrl) : amapJsApiDrivingRoute(from, to, waypoints, amapDriving);
|
|
19
19
|
};
|
package/dist/v2/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { useMapGeometry } from "./hooks/useMapGeometry";
|
|
|
31
31
|
export { useMapPlace } from "./hooks/useMapPlace";
|
|
32
32
|
export { useMapRecomendPlace } from "./hooks/useMapRecomendPlace";
|
|
33
33
|
export { useWalkingRoute } from "./hooks/useWalkingRoute";
|
|
34
|
+
export * from "./hooks/useMapInChina";
|
|
34
35
|
export * from "./types/global";
|
|
35
36
|
export * from "./types/interface";
|
|
36
37
|
export * from "./utils/patchMiniprogram";
|
package/dist/v2/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import { useMapGeometry } from "./hooks/useMapGeometry.js";
|
|
|
32
32
|
import { useMapPlace } from "./hooks/useMapPlace.js";
|
|
33
33
|
import { useMapRecomendPlace } from "./hooks/useMapRecomendPlace.js";
|
|
34
34
|
import { useWalkingRoute } from "./hooks/useWalkingRoute.js";
|
|
35
|
+
import { inChina, inHongkong, inKorean, inMacau, inTaiwan } from "./hooks/useMapInChina.js";
|
|
35
36
|
import { CenterPlaceStatus } from "./types/interface.js";
|
|
36
37
|
import { MINI_PROGRAM_WEB_VIEW_CLOSE_EVENT, MINI_PROGRAM_WEB_VIEW_CLOSE_TIMEOUT, patchMiniprogramRedirectTo } from "./utils/patchMiniprogram.js";
|
|
37
38
|
export {
|
|
@@ -56,6 +57,11 @@ export {
|
|
|
56
57
|
WalkingLine,
|
|
57
58
|
WalkingRoute,
|
|
58
59
|
WaveCircle,
|
|
60
|
+
inChina,
|
|
61
|
+
inHongkong,
|
|
62
|
+
inKorean,
|
|
63
|
+
inMacau,
|
|
64
|
+
inTaiwan,
|
|
59
65
|
isCoordinatePointEqual,
|
|
60
66
|
patchMiniprogramRedirectTo,
|
|
61
67
|
useBusinessAlarm,
|
package/dist/v2/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.17.0-
|
|
3
|
+
const pkgVersion = "2.17.0-curve3";
|
|
4
4
|
const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
|
|
5
5
|
const enableSessionLogKey = (key) => {
|
|
6
6
|
const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
|
|
@@ -7,6 +7,7 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
|
7
7
|
import { useMapSupplier, useMapAssertSupplier } from "../../hooks/useMapSupplier.js";
|
|
8
8
|
import { defineSetup, defineLagecySetup } from "../../types/helper.js";
|
|
9
9
|
import { generateCreateElementV2PropsOn } from "../../utils/compare.js";
|
|
10
|
+
import { distanceBetweenTwoPoints } from "../../utils/geometryPolygon.js";
|
|
10
11
|
import { place2point, pipeDefer } from "../../utils/transform.js";
|
|
11
12
|
import { toCoordinatePlaceType } from "../../utils/typeChecking.js";
|
|
12
13
|
import { DrivingQuadraticBezierCurve } from "../DrivingQuadraticBezierCurve/DrivingQuadraticBezierCurve.js";
|
|
@@ -60,6 +61,7 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
|
|
|
60
61
|
const toPlace = unCoordinatifyPlace(toCoordinatePlaceType(inputToPlace));
|
|
61
62
|
const from = place2point(fromPlace);
|
|
62
63
|
const to = place2point(toPlace);
|
|
64
|
+
const distance = distanceBetweenTwoPoints(from, to);
|
|
63
65
|
return createVNode(HeycarMap, {
|
|
64
66
|
"class": attrs.class,
|
|
65
67
|
"style": attrs.style,
|
|
@@ -86,7 +88,7 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
|
|
|
86
88
|
"position": to,
|
|
87
89
|
"title": toPlace.displayName,
|
|
88
90
|
"description": renderDescription({
|
|
89
|
-
distance
|
|
91
|
+
distance,
|
|
90
92
|
duration: 0,
|
|
91
93
|
tolls: 0
|
|
92
94
|
}),
|
|
@@ -13,7 +13,7 @@ const useADrivingRoute = (props) => {
|
|
|
13
13
|
steps: [],
|
|
14
14
|
trafficJams: void 0
|
|
15
15
|
});
|
|
16
|
-
const amapDriving = new AMap.Driving({});
|
|
16
|
+
const amapDriving = new AMap.Driving({ ferry: 1 });
|
|
17
17
|
const apiMapDrivingRoute = (from, to, waypoints = []) => {
|
|
18
18
|
return googleRoutesProxyUrl && inTaiwan(from) ? googleServiceApiDrivingRoute(from, to, waypoints, googleRoutesProxyUrl) : amapJsApiDrivingRoute(from, to, waypoints, amapDriving);
|
|
19
19
|
};
|
package/dist/v3/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { useMapGeometry } from "./hooks/useMapGeometry";
|
|
|
31
31
|
export { useMapPlace } from "./hooks/useMapPlace";
|
|
32
32
|
export { useMapRecomendPlace } from "./hooks/useMapRecomendPlace";
|
|
33
33
|
export { useWalkingRoute } from "./hooks/useWalkingRoute";
|
|
34
|
+
export * from "./hooks/useMapInChina";
|
|
34
35
|
export * from "./types/global";
|
|
35
36
|
export * from "./types/interface";
|
|
36
37
|
export * from "./utils/patchMiniprogram";
|
package/dist/v3/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import { useMapGeometry } from "./hooks/useMapGeometry.js";
|
|
|
32
32
|
import { useMapPlace } from "./hooks/useMapPlace.js";
|
|
33
33
|
import { useMapRecomendPlace } from "./hooks/useMapRecomendPlace.js";
|
|
34
34
|
import { useWalkingRoute } from "./hooks/useWalkingRoute.js";
|
|
35
|
+
import { inChina, inHongkong, inKorean, inMacau, inTaiwan } from "./hooks/useMapInChina.js";
|
|
35
36
|
import { CenterPlaceStatus } from "./types/interface.js";
|
|
36
37
|
import { MINI_PROGRAM_WEB_VIEW_CLOSE_EVENT, MINI_PROGRAM_WEB_VIEW_CLOSE_TIMEOUT, patchMiniprogramRedirectTo } from "./utils/patchMiniprogram.js";
|
|
37
38
|
export {
|
|
@@ -56,6 +57,11 @@ export {
|
|
|
56
57
|
WalkingLine,
|
|
57
58
|
WalkingRoute,
|
|
58
59
|
WaveCircle,
|
|
60
|
+
inChina,
|
|
61
|
+
inHongkong,
|
|
62
|
+
inKorean,
|
|
63
|
+
inMacau,
|
|
64
|
+
inTaiwan,
|
|
59
65
|
isCoordinatePointEqual,
|
|
60
66
|
patchMiniprogramRedirectTo,
|
|
61
67
|
useBusinessAlarm,
|
package/dist/v3/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.17.0-
|
|
3
|
+
const pkgVersion = "2.17.0-curve3";
|
|
4
4
|
const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
|
|
5
5
|
const enableSessionLogKey = (key) => {
|
|
6
6
|
const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
|