@heycar/heycars-map 2.4.2 → 2.4.3
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/v2/api/geometry.d.ts +1 -1
- package/dist/v2/api/geometry.js +5 -2
- package/dist/v2/business-components/GreenZone/GreenZone.js +14 -2
- package/dist/v2/components/GmapPolygon/GmapPolygon.js +4 -1
- package/dist/v2/components/GmapPolyline/GmapPolyline.js +4 -1
- package/dist/v2/hooks/useMapLoader.js +1 -1
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/api/geometry.d.ts +1 -1
- package/dist/v3/api/geometry.js +5 -2
- package/dist/v3/business-components/GreenZone/GreenZone.js +14 -2
- package/dist/v3/components/GmapPolygon/GmapPolygon.js +4 -1
- package/dist/v3/components/GmapPolyline/GmapPolyline.js +4 -1
- package/dist/v3/hooks/useMapLoader.js +1 -1
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
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"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CoordinatePoint } from "../types/interface";
|
|
2
|
-
export declare function isCoordinatePointEqual(
|
|
2
|
+
export declare function isCoordinatePointEqual(input1: CoordinatePoint, input2?: CoordinatePoint): boolean;
|
package/dist/v2/api/geometry.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { e as exported } from "../chunks/gcoord.esm-bundler.3f2f1369.js";
|
|
2
|
+
import { toCoordinatePointType } from "../utils/typeChecking.js";
|
|
2
3
|
const GCOORD_ACCURCY_RANGE = 1e-6;
|
|
3
|
-
function isCoordinatePointEqual(
|
|
4
|
-
if (!
|
|
4
|
+
function isCoordinatePointEqual(input1, input2) {
|
|
5
|
+
if (!input2)
|
|
5
6
|
return false;
|
|
7
|
+
const p1 = toCoordinatePointType(input1);
|
|
8
|
+
const p2 = toCoordinatePointType(input2);
|
|
6
9
|
if (p1.type === p2.type)
|
|
7
10
|
return p1.lng === p2.lng && p1.lat === p2.lat;
|
|
8
11
|
const { lng: x1, lat: y1 } = p1.type === "gcj02" ? p1 : p2;
|
|
@@ -12,6 +12,15 @@ const GREEN_ZONE_FILL_COLOR = "#C7E5FB";
|
|
|
12
12
|
const GREEN_ZONE_FILL_OPACITY = 0.5;
|
|
13
13
|
const GREEN_ZONE_STROKE_COLOR = "#4BA7FF";
|
|
14
14
|
const GREEN_ZONE_STROKE_WEIGHT_VW = 1;
|
|
15
|
+
const toClosedPath = (path) => {
|
|
16
|
+
const first = path[0];
|
|
17
|
+
if (!first)
|
|
18
|
+
return path;
|
|
19
|
+
const last = path.slice(-1)[0];
|
|
20
|
+
if (first.lng === last.lng && first.lat === last.lat)
|
|
21
|
+
return path;
|
|
22
|
+
return [...path, first];
|
|
23
|
+
};
|
|
15
24
|
const AGreenZone = defineSetup("AGreenZone", function(props) {
|
|
16
25
|
const strokeWeight = GREEN_ZONE_STROKE_WEIGHT_VW * globalThis.innerWidth / 100;
|
|
17
26
|
return () => {
|
|
@@ -39,6 +48,7 @@ const GGreenZone = defineSetup("GGreenZone", function(props) {
|
|
|
39
48
|
};
|
|
40
49
|
return () => {
|
|
41
50
|
const path = pathRef.value;
|
|
51
|
+
const closedPath = toClosedPath(path);
|
|
42
52
|
return h("div", [h(GmapPolygon, {
|
|
43
53
|
"attrs": {
|
|
44
54
|
"registerOverlay": props.registerOverlay,
|
|
@@ -52,14 +62,16 @@ const GGreenZone = defineSetup("GGreenZone", function(props) {
|
|
|
52
62
|
}
|
|
53
63
|
}), h(GmapPolyline, {
|
|
54
64
|
"attrs": {
|
|
55
|
-
"path":
|
|
65
|
+
"path": closedPath,
|
|
56
66
|
"strokeColor": GREEN_ZONE_STROKE_COLOR,
|
|
57
67
|
"strokeWeight": GREEN_ZONE_STROKE_WEIGHT_VW,
|
|
68
|
+
"strokeOpacity": 0,
|
|
58
69
|
"icons": [{
|
|
59
70
|
icon: lineSymbol,
|
|
60
71
|
offset: "0",
|
|
61
72
|
repeat: "20px"
|
|
62
|
-
}]
|
|
73
|
+
}],
|
|
74
|
+
"zIndex": ZINDEX_GREEN_ZONE
|
|
63
75
|
}
|
|
64
76
|
})]);
|
|
65
77
|
};
|
|
@@ -24,7 +24,10 @@ const GmapPolygon = defineSetup("GmapPolygon", function(props) {
|
|
|
24
24
|
(_a = polygonRef.value) == null ? void 0 : _a.setMap(map);
|
|
25
25
|
});
|
|
26
26
|
watchNoneImmediatePostEffectForDeepOption(
|
|
27
|
-
() =>
|
|
27
|
+
() => {
|
|
28
|
+
const { registerOverlay: registerOverlay2, ...restProps } = props;
|
|
29
|
+
return restProps;
|
|
30
|
+
},
|
|
28
31
|
(props2) => {
|
|
29
32
|
var _a;
|
|
30
33
|
(_a = polygonRef.value) == null ? void 0 : _a.setOptions({ ...props2 });
|
|
@@ -24,7 +24,10 @@ const GmapPolyline = defineSetup("GmapPolyline", function(props) {
|
|
|
24
24
|
(_a = polylineRef.value) == null ? void 0 : _a.setMap(map);
|
|
25
25
|
});
|
|
26
26
|
watchNoneImmediatePostEffectForDeepOption(
|
|
27
|
-
() =>
|
|
27
|
+
() => {
|
|
28
|
+
const { registerOverlay: registerOverlay2, ...restProps } = props;
|
|
29
|
+
return restProps;
|
|
30
|
+
},
|
|
28
31
|
(props2) => {
|
|
29
32
|
var _a;
|
|
30
33
|
(_a = polylineRef.value) == null ? void 0 : _a.setOptions({ ...props2 });
|
|
@@ -691,7 +691,7 @@ const useGmapLoader = (props) => {
|
|
|
691
691
|
statusRef.value = "SUCCESS";
|
|
692
692
|
resolveLoader();
|
|
693
693
|
onSuccess == null ? void 0 : onSuccess();
|
|
694
|
-
|
|
694
|
+
onDownloadOptimizeEndOnce(Date.now() - startTime);
|
|
695
695
|
},
|
|
696
696
|
() => {
|
|
697
697
|
if (signal == null ? void 0 : signal.aborted)
|
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.4.
|
|
3
|
+
const pkgVersion = "2.4.3";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CoordinatePoint } from "../types/interface";
|
|
2
|
-
export declare function isCoordinatePointEqual(
|
|
2
|
+
export declare function isCoordinatePointEqual(input1: CoordinatePoint, input2?: CoordinatePoint): boolean;
|
package/dist/v3/api/geometry.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { e as exported } from "../chunks/gcoord.esm-bundler.3f2f1369.js";
|
|
2
|
+
import { toCoordinatePointType } from "../utils/typeChecking.js";
|
|
2
3
|
const GCOORD_ACCURCY_RANGE = 1e-6;
|
|
3
|
-
function isCoordinatePointEqual(
|
|
4
|
-
if (!
|
|
4
|
+
function isCoordinatePointEqual(input1, input2) {
|
|
5
|
+
if (!input2)
|
|
5
6
|
return false;
|
|
7
|
+
const p1 = toCoordinatePointType(input1);
|
|
8
|
+
const p2 = toCoordinatePointType(input2);
|
|
6
9
|
if (p1.type === p2.type)
|
|
7
10
|
return p1.lng === p2.lng && p1.lat === p2.lat;
|
|
8
11
|
const { lng: x1, lat: y1 } = p1.type === "gcj02" ? p1 : p2;
|
|
@@ -12,6 +12,15 @@ const GREEN_ZONE_FILL_COLOR = "#C7E5FB";
|
|
|
12
12
|
const GREEN_ZONE_FILL_OPACITY = 0.5;
|
|
13
13
|
const GREEN_ZONE_STROKE_COLOR = "#4BA7FF";
|
|
14
14
|
const GREEN_ZONE_STROKE_WEIGHT_VW = 1;
|
|
15
|
+
const toClosedPath = (path) => {
|
|
16
|
+
const first = path[0];
|
|
17
|
+
if (!first)
|
|
18
|
+
return path;
|
|
19
|
+
const last = path.slice(-1)[0];
|
|
20
|
+
if (first.lng === last.lng && first.lat === last.lat)
|
|
21
|
+
return path;
|
|
22
|
+
return [...path, first];
|
|
23
|
+
};
|
|
15
24
|
const AGreenZone = defineSetup("AGreenZone", function(props) {
|
|
16
25
|
const strokeWeight = GREEN_ZONE_STROKE_WEIGHT_VW * globalThis.innerWidth / 100;
|
|
17
26
|
return () => {
|
|
@@ -37,6 +46,7 @@ const GGreenZone = defineSetup("GGreenZone", function(props) {
|
|
|
37
46
|
};
|
|
38
47
|
return () => {
|
|
39
48
|
const path = pathRef.value;
|
|
49
|
+
const closedPath = toClosedPath(path);
|
|
40
50
|
return createVNode("div", null, [createVNode(GmapPolygon, {
|
|
41
51
|
"registerOverlay": props.registerOverlay,
|
|
42
52
|
"paths": path,
|
|
@@ -47,14 +57,16 @@ const GGreenZone = defineSetup("GGreenZone", function(props) {
|
|
|
47
57
|
"fillOpacity": GREEN_ZONE_FILL_OPACITY,
|
|
48
58
|
"zIndex": ZINDEX_GREEN_ZONE
|
|
49
59
|
}, null), createVNode(GmapPolyline, {
|
|
50
|
-
"path":
|
|
60
|
+
"path": closedPath,
|
|
51
61
|
"strokeColor": GREEN_ZONE_STROKE_COLOR,
|
|
52
62
|
"strokeWeight": GREEN_ZONE_STROKE_WEIGHT_VW,
|
|
63
|
+
"strokeOpacity": 0,
|
|
53
64
|
"icons": [{
|
|
54
65
|
icon: lineSymbol,
|
|
55
66
|
offset: "0",
|
|
56
67
|
repeat: "20px"
|
|
57
|
-
}]
|
|
68
|
+
}],
|
|
69
|
+
"zIndex": ZINDEX_GREEN_ZONE
|
|
58
70
|
}, null)]);
|
|
59
71
|
};
|
|
60
72
|
});
|
|
@@ -24,7 +24,10 @@ const GmapPolygon = defineSetup("GmapPolygon", function(props) {
|
|
|
24
24
|
(_a = polygonRef.value) == null ? void 0 : _a.setMap(map);
|
|
25
25
|
});
|
|
26
26
|
watchNoneImmediatePostEffectForDeepOption(
|
|
27
|
-
() =>
|
|
27
|
+
() => {
|
|
28
|
+
const { registerOverlay: registerOverlay2, ...restProps } = props;
|
|
29
|
+
return restProps;
|
|
30
|
+
},
|
|
28
31
|
(props2) => {
|
|
29
32
|
var _a;
|
|
30
33
|
(_a = polygonRef.value) == null ? void 0 : _a.setOptions({ ...props2 });
|
|
@@ -24,7 +24,10 @@ const GmapPolyline = defineSetup("GmapPolyline", function(props) {
|
|
|
24
24
|
(_a = polylineRef.value) == null ? void 0 : _a.setMap(map);
|
|
25
25
|
});
|
|
26
26
|
watchNoneImmediatePostEffectForDeepOption(
|
|
27
|
-
() =>
|
|
27
|
+
() => {
|
|
28
|
+
const { registerOverlay: registerOverlay2, ...restProps } = props;
|
|
29
|
+
return restProps;
|
|
30
|
+
},
|
|
28
31
|
(props2) => {
|
|
29
32
|
var _a;
|
|
30
33
|
(_a = polylineRef.value) == null ? void 0 : _a.setOptions({ ...props2 });
|
|
@@ -691,7 +691,7 @@ const useGmapLoader = (props) => {
|
|
|
691
691
|
statusRef.value = "SUCCESS";
|
|
692
692
|
resolveLoader();
|
|
693
693
|
onSuccess == null ? void 0 : onSuccess();
|
|
694
|
-
|
|
694
|
+
onDownloadOptimizeEndOnce(Date.now() - startTime);
|
|
695
695
|
},
|
|
696
696
|
() => {
|
|
697
697
|
if (signal == null ? void 0 : signal.aborted)
|
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.4.
|
|
3
|
+
const pkgVersion = "2.4.3";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|