@heycar/heycars-map 2.4.4 → 2.4.6
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/v2/hooks/useMapGestureZoomCenter.js +0 -4
- package/dist/v2/hooks/useMapGraspRoad.js +4 -4
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/hooks/useMapGestureZoomCenter.js +0 -4
- package/dist/v3/hooks/useMapGraspRoad.js +4 -4
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
|
@@ -116,17 +116,13 @@ const useGmapGestureZoomCenter = (props) => {
|
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
118
|
const disableDefaultBehavior = (e) => e.preventDefault();
|
|
119
|
-
element.addEventListener("touchstart", disableDefaultBehavior, true);
|
|
120
119
|
element.addEventListener("touchmove", disableDefaultBehavior, true);
|
|
121
|
-
element.addEventListener("touchend", disableDefaultBehavior, true);
|
|
122
120
|
element.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
123
121
|
element.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
124
122
|
element.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
125
123
|
const unsubscribeDoubleTap = subscribeDoubleTap(element, handleDoubleTap);
|
|
126
124
|
onCleanup(() => {
|
|
127
|
-
element.removeEventListener("touchstart", disableDefaultBehavior, true);
|
|
128
125
|
element.removeEventListener("touchmove", disableDefaultBehavior, true);
|
|
129
|
-
element.removeEventListener("touchend", disableDefaultBehavior, true);
|
|
130
126
|
element.removeEventListener("touchstart", handleTouchStart);
|
|
131
127
|
element.removeEventListener("touchmove", handleTouchMove);
|
|
132
128
|
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.6";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
|
@@ -116,17 +116,13 @@ const useGmapGestureZoomCenter = (props) => {
|
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
118
|
const disableDefaultBehavior = (e) => e.preventDefault();
|
|
119
|
-
element.addEventListener("touchstart", disableDefaultBehavior, true);
|
|
120
119
|
element.addEventListener("touchmove", disableDefaultBehavior, true);
|
|
121
|
-
element.addEventListener("touchend", disableDefaultBehavior, true);
|
|
122
120
|
element.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
123
121
|
element.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
124
122
|
element.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
125
123
|
const unsubscribeDoubleTap = subscribeDoubleTap(element, handleDoubleTap);
|
|
126
124
|
onCleanup(() => {
|
|
127
|
-
element.removeEventListener("touchstart", disableDefaultBehavior, true);
|
|
128
125
|
element.removeEventListener("touchmove", disableDefaultBehavior, true);
|
|
129
|
-
element.removeEventListener("touchend", disableDefaultBehavior, true);
|
|
130
126
|
element.removeEventListener("touchstart", handleTouchStart);
|
|
131
127
|
element.removeEventListener("touchmove", handleTouchMove);
|
|
132
128
|
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.6";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|