@heycar/heycars-map 2.4.3 → 2.4.5
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/components/Gmap/Gmap.js +1 -1
- package/dist/v2/css/{Gmap-26ef76ca.css → Gmap-90a0d638.css} +3 -0
- package/dist/v2/hooks/useMapGestureZoomCenter.js +7 -0
- package/dist/v2/hooks/useMapGraspRoad.js +4 -4
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/components/Gmap/Gmap.js +1 -1
- package/dist/v3/css/{Gmap-26ef76ca.css → Gmap-90a0d638.css} +3 -0
- package/dist/v3/hooks/useMapGestureZoomCenter.js +7 -0
- package/dist/v3/hooks/useMapGraspRoad.js +4 -4
- 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 "./v3"
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./v3"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../css/Gmap-
|
|
1
|
+
import "../../css/Gmap-90a0d638.css";
|
|
2
2
|
import { computed, shallowRef, watchPostEffect, watch } from "vue-demi";
|
|
3
3
|
import { createElement } from "../../demi-polyfill/demi-polyfill.js";
|
|
4
4
|
import { provideGmap } from "../../hooks/useMap.js";
|
|
@@ -20,4 +20,7 @@ a[title*="Google"]>div>img[alt="Google"], .gmnoprint {
|
|
|
20
20
|
}
|
|
21
21
|
._7anfuo0 .gm-style iframe + div {
|
|
22
22
|
border: none !important;
|
|
23
|
+
}
|
|
24
|
+
._7anfuo0 div[role=alertdialog]:has(a[href="https://developers.google.com/maps/documentation/javascript/error-messages"]) {
|
|
25
|
+
z-index: 2;
|
|
23
26
|
}
|
|
@@ -115,11 +115,18 @@ const useGmapGestureZoomCenter = (props) => {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
+
const disableDefaultBehavior = (e) => e.preventDefault();
|
|
119
|
+
element.addEventListener("touchstart", disableDefaultBehavior, true);
|
|
120
|
+
element.addEventListener("touchmove", disableDefaultBehavior, true);
|
|
121
|
+
element.addEventListener("touchend", disableDefaultBehavior, true);
|
|
118
122
|
element.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
119
123
|
element.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
120
124
|
element.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
121
125
|
const unsubscribeDoubleTap = subscribeDoubleTap(element, handleDoubleTap);
|
|
122
126
|
onCleanup(() => {
|
|
127
|
+
element.removeEventListener("touchstart", disableDefaultBehavior, true);
|
|
128
|
+
element.removeEventListener("touchmove", disableDefaultBehavior, true);
|
|
129
|
+
element.removeEventListener("touchend", disableDefaultBehavior, true);
|
|
123
130
|
element.removeEventListener("touchstart", handleTouchStart);
|
|
124
131
|
element.removeEventListener("touchmove", handleTouchMove);
|
|
125
132
|
element.removeEventListener("touchend", handleTouchEnd);
|
|
@@ -25,12 +25,12 @@ const useAmapGraspRoad = (props) => {
|
|
|
25
25
|
const angle = (_c = apiMapComputeHeading(path[path.length - 2], path[path.length - 1])) != null ? _c : 0;
|
|
26
26
|
return resolve({ path, angle });
|
|
27
27
|
}
|
|
28
|
-
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length
|
|
28
|
+
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length);
|
|
29
29
|
const graspRoadPoints = trackPoints2amapGraspRoadPoints(tracks.slice(-amount));
|
|
30
30
|
amapGraspRoad.driving(graspRoadPoints, (error, result) => {
|
|
31
31
|
var _a2, _b2;
|
|
32
32
|
if (error) {
|
|
33
|
-
console.error(error);
|
|
33
|
+
console.error("高德地图路线纠偏失败!原因如下:\n", error);
|
|
34
34
|
const path2 = tracks.map(lnglat2point);
|
|
35
35
|
const angle2 = (_a2 = apiMapComputeHeading(path2[0], path2[1])) != null ? _a2 : 0;
|
|
36
36
|
return resolve({ path: path2, angle: angle2 });
|
|
@@ -65,12 +65,12 @@ const useGmapGraspRoad = (props) => {
|
|
|
65
65
|
const angle2 = (_b = (_a = tracks[tracks.length - 1]) == null ? void 0 : _a.angle) != null ? _b : 0;
|
|
66
66
|
return { path: path2, angle: angle2 };
|
|
67
67
|
}
|
|
68
|
-
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length
|
|
68
|
+
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length);
|
|
69
69
|
const snapRoadPath = tracks.slice(-amount).map(lnglat2point);
|
|
70
70
|
try {
|
|
71
71
|
result = await apiGoogleSnapRoad({ path: snapRoadPath });
|
|
72
72
|
} catch (error) {
|
|
73
|
-
console.error(error);
|
|
73
|
+
console.error("谷歌地图路线纠偏失败!原因如下:\n", error);
|
|
74
74
|
const path2 = tracks.map(lnglat2point);
|
|
75
75
|
const angle2 = (_c = apiMapComputeHeading(path2[0], path2[1])) != null ? _c : 0;
|
|
76
76
|
return { path: path2, angle: angle2 };
|
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.5";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../css/Gmap-
|
|
1
|
+
import "../../css/Gmap-90a0d638.css";
|
|
2
2
|
import { computed, shallowRef, watchPostEffect, watch } from "vue-demi";
|
|
3
3
|
import { createElement } from "../../demi-polyfill/demi-polyfill.js";
|
|
4
4
|
import { provideGmap } from "../../hooks/useMap.js";
|
|
@@ -20,4 +20,7 @@ a[title*="Google"]>div>img[alt="Google"], .gmnoprint {
|
|
|
20
20
|
}
|
|
21
21
|
._7anfuo0 .gm-style iframe + div {
|
|
22
22
|
border: none !important;
|
|
23
|
+
}
|
|
24
|
+
._7anfuo0 div[role=alertdialog]:has(a[href="https://developers.google.com/maps/documentation/javascript/error-messages"]) {
|
|
25
|
+
z-index: 2;
|
|
23
26
|
}
|
|
@@ -115,11 +115,18 @@ const useGmapGestureZoomCenter = (props) => {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
+
const disableDefaultBehavior = (e) => e.preventDefault();
|
|
119
|
+
element.addEventListener("touchstart", disableDefaultBehavior, true);
|
|
120
|
+
element.addEventListener("touchmove", disableDefaultBehavior, true);
|
|
121
|
+
element.addEventListener("touchend", disableDefaultBehavior, true);
|
|
118
122
|
element.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
119
123
|
element.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
120
124
|
element.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
121
125
|
const unsubscribeDoubleTap = subscribeDoubleTap(element, handleDoubleTap);
|
|
122
126
|
onCleanup(() => {
|
|
127
|
+
element.removeEventListener("touchstart", disableDefaultBehavior, true);
|
|
128
|
+
element.removeEventListener("touchmove", disableDefaultBehavior, true);
|
|
129
|
+
element.removeEventListener("touchend", disableDefaultBehavior, true);
|
|
123
130
|
element.removeEventListener("touchstart", handleTouchStart);
|
|
124
131
|
element.removeEventListener("touchmove", handleTouchMove);
|
|
125
132
|
element.removeEventListener("touchend", handleTouchEnd);
|
|
@@ -25,12 +25,12 @@ const useAmapGraspRoad = (props) => {
|
|
|
25
25
|
const angle = (_c = apiMapComputeHeading(path[path.length - 2], path[path.length - 1])) != null ? _c : 0;
|
|
26
26
|
return resolve({ path, angle });
|
|
27
27
|
}
|
|
28
|
-
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length
|
|
28
|
+
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length);
|
|
29
29
|
const graspRoadPoints = trackPoints2amapGraspRoadPoints(tracks.slice(-amount));
|
|
30
30
|
amapGraspRoad.driving(graspRoadPoints, (error, result) => {
|
|
31
31
|
var _a2, _b2;
|
|
32
32
|
if (error) {
|
|
33
|
-
console.error(error);
|
|
33
|
+
console.error("高德地图路线纠偏失败!原因如下:\n", error);
|
|
34
34
|
const path2 = tracks.map(lnglat2point);
|
|
35
35
|
const angle2 = (_a2 = apiMapComputeHeading(path2[0], path2[1])) != null ? _a2 : 0;
|
|
36
36
|
return resolve({ path: path2, angle: angle2 });
|
|
@@ -65,12 +65,12 @@ const useGmapGraspRoad = (props) => {
|
|
|
65
65
|
const angle2 = (_b = (_a = tracks[tracks.length - 1]) == null ? void 0 : _a.angle) != null ? _b : 0;
|
|
66
66
|
return { path: path2, angle: angle2 };
|
|
67
67
|
}
|
|
68
|
-
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length
|
|
68
|
+
const amount = Math.min(GRASP_ROAD_INPUT_MAX_AMOUNT, tracks.length);
|
|
69
69
|
const snapRoadPath = tracks.slice(-amount).map(lnglat2point);
|
|
70
70
|
try {
|
|
71
71
|
result = await apiGoogleSnapRoad({ path: snapRoadPath });
|
|
72
72
|
} catch (error) {
|
|
73
|
-
console.error(error);
|
|
73
|
+
console.error("谷歌地图路线纠偏失败!原因如下:\n", error);
|
|
74
74
|
const path2 = tracks.map(lnglat2point);
|
|
75
75
|
const angle2 = (_c = apiMapComputeHeading(path2[0], path2[1])) != null ? _c : 0;
|
|
76
76
|
return { path: path2, angle: angle2 };
|
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.5";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|