@heycar/heycars-map 0.9.27-google4 → 0.9.27-google5
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/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 = "0.9.27-
|
|
3
|
+
const pkgVersion = "0.9.27-google5";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
package/dist/utils/transform.js
CHANGED
|
@@ -77,7 +77,6 @@ const isGeoPositionEqual = (p1, p2) => {
|
|
|
77
77
|
const isZoneEqual = (z1, z2) => {
|
|
78
78
|
return z1.path.every((point, idx) => isPointEqual(point, z2 == null ? void 0 : z2.path[idx]));
|
|
79
79
|
};
|
|
80
|
-
const ILLEGAL_DISPLAY_NAME_WITHOUT_STREET_NUMBER_REGEX = /(?:^\s*$|\(\)|())/;
|
|
81
80
|
const amapPlaceName2DisplayName = (name, options) => {
|
|
82
81
|
const { isChina } = options;
|
|
83
82
|
if (!name)
|
|
@@ -85,19 +84,19 @@ const amapPlaceName2DisplayName = (name, options) => {
|
|
|
85
84
|
return isChina ? amapPlaceName2DisplayNameInChina(name, options) : amapPlaceName2DisplayNameOutChina(name, options);
|
|
86
85
|
};
|
|
87
86
|
function amapPlaceName2DisplayNameInChina(name, options) {
|
|
88
|
-
const { province, city, district, township, building, neighborhood
|
|
87
|
+
const { province, city, district, township, building, neighborhood } = options;
|
|
89
88
|
if (building)
|
|
90
89
|
return building;
|
|
91
90
|
if (neighborhood)
|
|
92
91
|
return neighborhood;
|
|
93
92
|
let result = name;
|
|
94
93
|
for (const item of [province, city, district, township]) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
const replacedName = result.replace(item, "");
|
|
95
|
+
if (replacedName.length < 20)
|
|
96
|
+
return replacedName;
|
|
97
|
+
result = replacedName;
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
return ILLEGAL_DISPLAY_NAME_WITHOUT_STREET_NUMBER_REGEX.test(resultWithoutStreetNumber) ? result : resultWithoutStreetNumber;
|
|
99
|
+
return result;
|
|
101
100
|
}
|
|
102
101
|
const NOT_ONLY_NUMBERS_REGEX = /[^\d\s-]/;
|
|
103
102
|
function amapPlaceName2DisplayNameOutChina(name, options) {
|