@heycar/heycars-map 0.9.27-google4 → 0.9.27-google6
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/business-components/PlaceCircle/PlaceCircle.js +1 -1
- package/dist/components/AmapMarker/AmapMarker.js +2 -0
- package/dist/components/AmapPolygon/AmapPolygon.d.ts +2 -0
- package/dist/components/AmapPolygon/AmapPolygon.js +7 -6
- package/dist/components/AmapPolygon/index.js +3 -2
- package/dist/css/{PlaceCircle-2369f992.css → PlaceCircle-3c051f4e.css} +0 -1
- package/dist/utils/log.js +1 -1
- package/dist/utils/transform.js +10 -8
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import { useMapOverlay } from "../../hooks/useOverlay.js";
|
|
|
4
4
|
import { defineSetup } from "../../types/helper.js";
|
|
5
5
|
import { watchNoneImmediatePostEffectForMapProperty, watchPostEffectForAMapEvent } from "../../utils/compare.js";
|
|
6
6
|
import { referenceCount } from "../../utils/referenceCount.js";
|
|
7
|
+
import { useAmapFixBugOverlayDrag } from "../AmapPolygon/AmapPolygon.js";
|
|
7
8
|
import { shallowRef, onMounted, onUnmounted, watchPostEffect } from "vue";
|
|
8
9
|
const AmapMarker = defineSetup(function AmapMarker2(props, { emit }) {
|
|
9
10
|
const { registerOverlay } = props;
|
|
@@ -21,6 +22,7 @@ const AmapMarker = defineSetup(function AmapMarker2(props, { emit }) {
|
|
|
21
22
|
(_b = markerRef.value) == null ? void 0 : _b.destroy();
|
|
22
23
|
markerRef.value = void 0;
|
|
23
24
|
});
|
|
25
|
+
useAmapFixBugOverlayDrag(markerRef);
|
|
24
26
|
watchPostEffect((onCleanup) => {
|
|
25
27
|
var _a;
|
|
26
28
|
const map = mapRef == null ? void 0 : mapRef.value;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ShallowRef } from "vue-demi";
|
|
1
2
|
import type { AMapEvent } from "../../types/mapHelper";
|
|
2
3
|
export interface AmapPolygonProps extends AMap.PolygonOptions {
|
|
3
4
|
onTouchStart?: (e: AMapEvent<AMap.Polygon>) => void;
|
|
@@ -5,3 +6,4 @@ export interface AmapPolygonProps extends AMap.PolygonOptions {
|
|
|
5
6
|
onTouchEnd?: (e: AMapEvent<AMap.Polygon>) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare const AmapPolygon: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<AmapPolygonProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<AmapPolygonProps, Required<AmapPolygonProps>>, "touchStart" | "touchMove" | "touchEnd", AmapPolygonProps>;
|
|
9
|
+
export declare const useAmapFixBugOverlayDrag: (overlayRef?: ShallowRef<AMap.Polygon | AMap.Marker | undefined>) => void;
|
|
@@ -19,7 +19,7 @@ const AmapPolygon = defineSetup(function AmapPolygon2(props) {
|
|
|
19
19
|
(_b = polygonRef.value) == null ? void 0 : _b.destroy();
|
|
20
20
|
polygonRef.value = void 0;
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
useAmapFixBugOverlayDrag(polygonRef);
|
|
23
23
|
watchPostEffect((onCleanup) => {
|
|
24
24
|
var _a;
|
|
25
25
|
const map = mapRef == null ? void 0 : mapRef.value;
|
|
@@ -48,7 +48,7 @@ const AmapPolygon = defineSetup(function AmapPolygon2(props) {
|
|
|
48
48
|
);
|
|
49
49
|
return () => null;
|
|
50
50
|
});
|
|
51
|
-
const
|
|
51
|
+
const useAmapFixBugOverlayDrag = (overlayRef) => {
|
|
52
52
|
let dragStatus = "UNSTARTED";
|
|
53
53
|
const onTouchStart = () => {
|
|
54
54
|
dragStatus = "WAITING_DRAG_START";
|
|
@@ -70,21 +70,22 @@ const useAmapFixBugPolygonDrag = (polygonRef) => {
|
|
|
70
70
|
amap == null ? void 0 : amap.emit("dragend", { type: "dragend", target: amap, lnglat, pixel, originEvent });
|
|
71
71
|
};
|
|
72
72
|
watchPostEffectForAMapEvent(
|
|
73
|
-
|
|
73
|
+
overlayRef,
|
|
74
74
|
{},
|
|
75
75
|
onTouchStart,
|
|
76
76
|
["onTouchStart"]
|
|
77
77
|
);
|
|
78
78
|
watchPostEffectForAMapEvent(
|
|
79
|
-
|
|
79
|
+
overlayRef,
|
|
80
80
|
{},
|
|
81
81
|
onTouchMove,
|
|
82
82
|
["onTouchMove"]
|
|
83
83
|
);
|
|
84
|
-
watchPostEffectForAMapEvent(
|
|
84
|
+
watchPostEffectForAMapEvent(overlayRef, {}, onTouchEnd, [
|
|
85
85
|
"onTouchEnd"
|
|
86
86
|
]);
|
|
87
87
|
};
|
|
88
88
|
export {
|
|
89
|
-
AmapPolygon
|
|
89
|
+
AmapPolygon,
|
|
90
|
+
useAmapFixBugOverlayDrag
|
|
90
91
|
};
|
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-google6";
|
|
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,22 @@ 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
|
-
for (const item of [province, city, district
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
for (const item of [province, city, district]) {
|
|
94
|
+
const replacedName2 = result.replace(item, "");
|
|
95
|
+
if (!replacedName2.trim())
|
|
96
|
+
return result;
|
|
97
|
+
result = replacedName2;
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
if (result.length < 20)
|
|
100
|
+
return result;
|
|
101
|
+
const replacedName = result.replace(township, "");
|
|
102
|
+
return replacedName.trim() ? replacedName : result;
|
|
101
103
|
}
|
|
102
104
|
const NOT_ONLY_NUMBERS_REGEX = /[^\d\s-]/;
|
|
103
105
|
function amapPlaceName2DisplayNameOutChina(name, options) {
|