@heycar/heycars-map 2.7.0 → 2.7.1
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.
|
@@ -19,7 +19,17 @@ const useAmapGCJ02 = () => {
|
|
|
19
19
|
};
|
|
20
20
|
const toLocalGcj02Points = (points) => points.map(toLocalGcj02);
|
|
21
21
|
const toLocalWgs84 = (point) => {
|
|
22
|
-
|
|
22
|
+
console.error(`高德地图为什么要转 wgs84: ${JSON.stringify(point)}`);
|
|
23
|
+
try {
|
|
24
|
+
if (inChina(point))
|
|
25
|
+
return point;
|
|
26
|
+
return exported.transform(point, exported.GCJ02, exported.WGS1984);
|
|
27
|
+
} catch (err) {
|
|
28
|
+
const error = err;
|
|
29
|
+
console.error(`本地转换WGS84失败: ${error.message}
|
|
30
|
+
${error.stack}`);
|
|
31
|
+
return point;
|
|
32
|
+
}
|
|
23
33
|
};
|
|
24
34
|
const toGcj02Points = async (points) => {
|
|
25
35
|
return toLocalGcj02Points(points);
|
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.7.
|
|
3
|
+
const pkgVersion = "2.7.1";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
|
@@ -19,7 +19,17 @@ const useAmapGCJ02 = () => {
|
|
|
19
19
|
};
|
|
20
20
|
const toLocalGcj02Points = (points) => points.map(toLocalGcj02);
|
|
21
21
|
const toLocalWgs84 = (point) => {
|
|
22
|
-
|
|
22
|
+
console.error(`高德地图为什么要转 wgs84: ${JSON.stringify(point)}`);
|
|
23
|
+
try {
|
|
24
|
+
if (inChina(point))
|
|
25
|
+
return point;
|
|
26
|
+
return exported.transform(point, exported.GCJ02, exported.WGS1984);
|
|
27
|
+
} catch (err) {
|
|
28
|
+
const error = err;
|
|
29
|
+
console.error(`本地转换WGS84失败: ${error.message}
|
|
30
|
+
${error.stack}`);
|
|
31
|
+
return point;
|
|
32
|
+
}
|
|
23
33
|
};
|
|
24
34
|
const toGcj02Points = async (points) => {
|
|
25
35
|
return toLocalGcj02Points(points);
|
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.7.
|
|
3
|
+
const pkgVersion = "2.7.1";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|