@heycar/heycars-map 0.9.27-google5 → 0.9.27-google7
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/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/hooks/useMapLoader.js +3 -1
- package/dist/utils/log.js +1 -1
- package/dist/utils/transform.js +9 -6
- 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
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../chunks/index.fbc1adc8.js";
|
|
2
2
|
import { watchPostEffectForDeepOption } from "../utils/compare.js";
|
|
3
|
+
import { createRunOnce } from "../utils/helper.js";
|
|
3
4
|
import { shallowRef, computed } from "vue";
|
|
4
5
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
5
6
|
var distExports = {};
|
|
@@ -604,6 +605,7 @@ const useAmapLoader = (props) => {
|
|
|
604
605
|
);
|
|
605
606
|
return { statusRef, readyPromise };
|
|
606
607
|
};
|
|
608
|
+
const createGmapLoaderOnce = createRunOnce((opts) => new Loader(opts));
|
|
607
609
|
const useGmapLoader = (props) => {
|
|
608
610
|
const { onChange } = props;
|
|
609
611
|
let resolveLoader;
|
|
@@ -624,7 +626,7 @@ const useGmapLoader = (props) => {
|
|
|
624
626
|
() => optionsRef.value,
|
|
625
627
|
(options) => {
|
|
626
628
|
const language = navigator.language;
|
|
627
|
-
const loader =
|
|
629
|
+
const loader = createGmapLoaderOnce({ ...options, language });
|
|
628
630
|
const setStatusAndExecuteCallback = (status) => {
|
|
629
631
|
statusRef.value = status;
|
|
630
632
|
if (status === "SUCCESS")
|
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-google7";
|
|
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
|
@@ -90,13 +90,16 @@ function amapPlaceName2DisplayNameInChina(name, options) {
|
|
|
90
90
|
if (neighborhood)
|
|
91
91
|
return neighborhood;
|
|
92
92
|
let result = name;
|
|
93
|
-
for (const item of [province, city, district
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
return
|
|
97
|
-
result =
|
|
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
|
-
|
|
99
|
+
if (result.length < 20)
|
|
100
|
+
return result;
|
|
101
|
+
const replacedName = result.replace(township, "");
|
|
102
|
+
return replacedName.trim() ? replacedName : result;
|
|
100
103
|
}
|
|
101
104
|
const NOT_ONLY_NUMBERS_REGEX = /[^\d\s-]/;
|
|
102
105
|
function amapPlaceName2DisplayNameOutChina(name, options) {
|