@heycar/heycars-map 0.6.2 → 0.6.4
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/Gmap/Gmap.css.d.ts +8 -0
- package/dist/components/Gmap/Gmap.d.ts +3 -2
- package/dist/hooks/useMapGestureZoomCenter.d.ts +9 -0
- package/dist/hooks/useMapTouchStartCenter.d.ts +10 -0
- package/dist/hooks/useMapWheelZoomCenter.d.ts +1 -0
- package/dist/hooks/useResizeObserver.d.ts +1 -1
- package/dist/index.cjs +135 -96
- package/dist/index.js +136 -97
- package/dist/style.css +7 -0
- package/dist/utils/easeAnimate.d.ts +12 -0
- package/package.json +2 -1
- package/todo.md +14 -0
|
@@ -4,9 +4,10 @@ import { UseResizeObserverProps } from "../../hooks/useResizeObserver";
|
|
|
4
4
|
import type { MapEventHandler } from "../../types/mapHelper";
|
|
5
5
|
export interface GmapProps extends google.maps.MapOptions {
|
|
6
6
|
mapRef?: SetMap<google.maps.Map>;
|
|
7
|
+
touchZoomCenter?: boolean;
|
|
7
8
|
onDragStart?: MapEventHandler<google.maps.Map>;
|
|
8
9
|
onDragEnd?: MapEventHandler<google.maps.Map>;
|
|
9
|
-
|
|
10
|
+
onZoom_changed?: MapEventHandler<google.maps.Map>;
|
|
10
11
|
onResize?: UseResizeObserverProps["onChange"];
|
|
11
12
|
}
|
|
12
|
-
export declare const Gmap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<GmapProps>, 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<GmapProps, Required<GmapProps>>, "resize" | "dragStart" | "dragEnd" | "
|
|
13
|
+
export declare const Gmap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<GmapProps>, 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<GmapProps, Required<GmapProps>>, "resize" | "dragStart" | "dragEnd" | "zoom_changed", GmapProps, {}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import { Ref, ShallowRef } from "vue-demi";
|
|
3
|
+
interface UseMapGestureZoomCenterProps {
|
|
4
|
+
elementRef: ShallowRef<HTMLDivElement | undefined>;
|
|
5
|
+
mapRef: ShallowRef<google.maps.Map | undefined>;
|
|
6
|
+
enableRef: Ref<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export declare const useGmapGestureZoomCenter: (props: UseMapGestureZoomCenterProps) => void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import { ShallowRef } from "vue-demi";
|
|
3
|
+
interface UseGmapTouchStartCenterProps {
|
|
4
|
+
mapRef: ShallowRef<google.maps.Map | undefined>;
|
|
5
|
+
elementRef: ShallowRef<HTMLDivElement | undefined>;
|
|
6
|
+
}
|
|
7
|
+
export declare const useGmapTouchStartCenter: (props: UseGmapTouchStartCenterProps) => {
|
|
8
|
+
touchstartCenterRef: import("vue-demi").Ref<[number, number] | undefined>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -5,4 +5,5 @@ interface UseWheelZoomCenterProps<M = AMap.Map | google.maps.Map> {
|
|
|
5
5
|
enableRef?: Ref<boolean>;
|
|
6
6
|
}
|
|
7
7
|
export declare const useAmapWheelZoomCenter: (props: UseWheelZoomCenterProps<AMap.Map>) => void;
|
|
8
|
+
export declare const useGmapWheelZoomCenter: (props: UseWheelZoomCenterProps<google.maps.Map>) => void;
|
|
8
9
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -1043,7 +1043,7 @@ function watchPostEffectForGMapEvent(targetRef, props, emit, propertyNames) {
|
|
|
1043
1043
|
for (const name of propertyNames) {
|
|
1044
1044
|
const emitEventName = property2emitEventName(name);
|
|
1045
1045
|
const eventName = property2mapEventName(name);
|
|
1046
|
-
const handler = (e) => emit(emitEventName, e);
|
|
1046
|
+
const handler = (e) => emit(emitEventName, { ...e, target });
|
|
1047
1047
|
const listener = target.addListener(eventName, handler);
|
|
1048
1048
|
cleanList.push(() => google.maps.event.removeListener(listener));
|
|
1049
1049
|
}
|
|
@@ -1977,6 +1977,25 @@ const useMapEventSource = () => {
|
|
|
1977
1977
|
};
|
|
1978
1978
|
return { executeMapApi };
|
|
1979
1979
|
};
|
|
1980
|
+
const useGmapTouchStartCenter = (props) => {
|
|
1981
|
+
const { mapRef, elementRef } = props;
|
|
1982
|
+
const touchstartCenterRef = Vue.ref(void 0);
|
|
1983
|
+
Vue.watchEffect((onCleanup) => {
|
|
1984
|
+
const map = mapRef.value;
|
|
1985
|
+
const element = elementRef.value;
|
|
1986
|
+
if (!map || !element)
|
|
1987
|
+
return;
|
|
1988
|
+
const handleTouchStart = () => {
|
|
1989
|
+
const center = map.getCenter();
|
|
1990
|
+
const lng = center == null ? void 0 : center.lng();
|
|
1991
|
+
const lat = center == null ? void 0 : center.lat();
|
|
1992
|
+
touchstartCenterRef.value = lng && lat ? [lng, lat] : void 0;
|
|
1993
|
+
};
|
|
1994
|
+
element.addEventListener("touchstart", handleTouchStart);
|
|
1995
|
+
onCleanup(() => element.removeEventListener("touchstart", handleTouchStart));
|
|
1996
|
+
});
|
|
1997
|
+
return { touchstartCenterRef };
|
|
1998
|
+
};
|
|
1980
1999
|
const useResizeObserver = (props) => {
|
|
1981
2000
|
const { elementRef, onChange } = props;
|
|
1982
2001
|
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
@@ -1997,27 +2016,109 @@ const useResizeObserver = (props) => {
|
|
|
1997
2016
|
});
|
|
1998
2017
|
};
|
|
1999
2018
|
const Gmap_css_ts_vanilla = "";
|
|
2019
|
+
function _defineProperty(obj, key, value) {
|
|
2020
|
+
if (key in obj) {
|
|
2021
|
+
Object.defineProperty(obj, key, {
|
|
2022
|
+
value,
|
|
2023
|
+
enumerable: true,
|
|
2024
|
+
configurable: true,
|
|
2025
|
+
writable: true
|
|
2026
|
+
});
|
|
2027
|
+
} else {
|
|
2028
|
+
obj[key] = value;
|
|
2029
|
+
}
|
|
2030
|
+
return obj;
|
|
2031
|
+
}
|
|
2032
|
+
function ownKeys(object, enumerableOnly) {
|
|
2033
|
+
var keys2 = Object.keys(object);
|
|
2034
|
+
if (Object.getOwnPropertySymbols) {
|
|
2035
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2036
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2037
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2038
|
+
})), keys2.push.apply(keys2, symbols);
|
|
2039
|
+
}
|
|
2040
|
+
return keys2;
|
|
2041
|
+
}
|
|
2042
|
+
function _objectSpread2(target) {
|
|
2043
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2044
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
2045
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2046
|
+
_defineProperty(target, key, source[key]);
|
|
2047
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2048
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
return target;
|
|
2052
|
+
}
|
|
2053
|
+
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
2054
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
2055
|
+
var _selections$key;
|
|
2056
|
+
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
2057
|
+
return false;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
return true;
|
|
2061
|
+
};
|
|
2062
|
+
var createRuntimeFn = (config) => (options) => {
|
|
2063
|
+
var className = config.defaultClassName;
|
|
2064
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
2065
|
+
for (var variantName in selections) {
|
|
2066
|
+
var _selections$variantNa;
|
|
2067
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
2068
|
+
if (variantSelection != null) {
|
|
2069
|
+
var selection = variantSelection;
|
|
2070
|
+
if (typeof selection === "boolean") {
|
|
2071
|
+
selection = selection === true ? "true" : "false";
|
|
2072
|
+
}
|
|
2073
|
+
var selectionClassName = (
|
|
2074
|
+
// @ts-expect-error
|
|
2075
|
+
config.variantClassNames[variantName][selection]
|
|
2076
|
+
);
|
|
2077
|
+
if (selectionClassName) {
|
|
2078
|
+
className += " " + selectionClassName;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
2083
|
+
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
2084
|
+
className += " " + compoundClassName;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
return className;
|
|
2088
|
+
};
|
|
2000
2089
|
var gmap = "_7anfuo0";
|
|
2090
|
+
createRuntimeFn({ defaultClassName: "", variantClassNames: { enable: { true: "_7anfuo1", false: "_7anfuo2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2001
2091
|
const Gmap = defineSetup(function Gmap2(props, { slots, emit }) {
|
|
2002
2092
|
const setMap = props.mapRef;
|
|
2003
2093
|
const { onResize } = props;
|
|
2004
2094
|
const options = Vue.computed(() => {
|
|
2005
|
-
const { mapRef: mapRef2, onDragStart, onDragEnd,
|
|
2095
|
+
const { mapRef: mapRef2, onDragStart, onDragEnd, onZoom_changed, touchZoomCenter, ...options2 } = props;
|
|
2006
2096
|
return options2;
|
|
2007
2097
|
});
|
|
2008
2098
|
const defaultOptions = options.value;
|
|
2009
2099
|
const elementRef = Vue.shallowRef();
|
|
2010
2100
|
const mapRef = Vue.shallowRef();
|
|
2011
2101
|
const { executeMapApi } = useMapEventSource();
|
|
2012
|
-
const
|
|
2102
|
+
const { touchstartCenterRef } = useGmapTouchStartCenter({ mapRef, elementRef });
|
|
2103
|
+
const handleDrag = (name) => {
|
|
2104
|
+
emit(name, { target: mapRef.value });
|
|
2105
|
+
};
|
|
2106
|
+
const handleZoom = (name) => {
|
|
2107
|
+
var _a;
|
|
2108
|
+
emit(name, { target: mapRef.value });
|
|
2109
|
+
const center = touchstartCenterRef.value;
|
|
2110
|
+
if (center)
|
|
2111
|
+
(_a = mapRef.value) == null ? void 0 : _a.setCenter(vec2lnglat(center));
|
|
2112
|
+
};
|
|
2013
2113
|
provideGmap(mapRef);
|
|
2014
2114
|
useResizeObserver({ elementRef, onChange: onResize });
|
|
2015
2115
|
Vue.watchPostEffect(() => {
|
|
2016
|
-
|
|
2116
|
+
const element = elementRef.value;
|
|
2117
|
+
if (mapRef.value || !element)
|
|
2017
2118
|
return;
|
|
2018
2119
|
let map;
|
|
2019
2120
|
executeMapApi(() => {
|
|
2020
|
-
map = new google.maps.Map(
|
|
2121
|
+
map = new google.maps.Map(element, { ...defaultOptions });
|
|
2021
2122
|
window.GlobalGmap = map;
|
|
2022
2123
|
});
|
|
2023
2124
|
mapRef.value = map;
|
|
@@ -2032,11 +2133,8 @@ const Gmap = defineSetup(function Gmap2(props, { slots, emit }) {
|
|
|
2032
2133
|
});
|
|
2033
2134
|
}
|
|
2034
2135
|
);
|
|
2035
|
-
watchPostEffectForGMapEvent(mapRef, props, handleDrag, [
|
|
2036
|
-
|
|
2037
|
-
"onDragEnd",
|
|
2038
|
-
"onZoom_change"
|
|
2039
|
-
]);
|
|
2136
|
+
watchPostEffectForGMapEvent(mapRef, props, handleDrag, ["onDragStart", "onDragEnd"]);
|
|
2137
|
+
watchPostEffectForGMapEvent(mapRef, props, handleZoom, ["onZoom_changed"]);
|
|
2040
2138
|
return () => {
|
|
2041
2139
|
var _a;
|
|
2042
2140
|
return Vue.h("div", { ref: elementRef, class: gmap }, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
@@ -2115,12 +2213,14 @@ const HeycarMap = defineLagecySetup(function HeycarMap2(props, {
|
|
|
2115
2213
|
"attrs": {
|
|
2116
2214
|
"mapRef": setMap,
|
|
2117
2215
|
"mapId": gmapId,
|
|
2118
|
-
"center": center ? vec2lnglat(center) : void 0,
|
|
2216
|
+
"center": center ? vec2lnglat(center.map(Number)) : void 0,
|
|
2119
2217
|
"zoom": zoom,
|
|
2120
2218
|
"disableDefaultUI": true,
|
|
2219
|
+
"clickableIcons": false,
|
|
2121
2220
|
"disableDoubleClickZoom": touchEnable,
|
|
2122
2221
|
"gestureHandling": touchEnable ? "auto" : "none",
|
|
2123
|
-
"keyboardShortcuts": touchEnable
|
|
2222
|
+
"keyboardShortcuts": touchEnable,
|
|
2223
|
+
"touchZoomCenter": touchZoomCenter
|
|
2124
2224
|
},
|
|
2125
2225
|
"on": {
|
|
2126
2226
|
"dragEnd": gmapHandleDargEnd,
|
|
@@ -2269,11 +2369,11 @@ const GDrivingLine = defineSetup(function GDrivingLine2(props) {
|
|
|
2269
2369
|
const pathRef = Vue.computed(() => props.path.map(vec2lnglat));
|
|
2270
2370
|
return () => {
|
|
2271
2371
|
const vw = window.innerWidth * 0.01;
|
|
2272
|
-
const repeat =
|
|
2273
|
-
const strokeWidth = 1.25 * vw;
|
|
2274
|
-
const borderWidth = 0.175 * vw;
|
|
2275
|
-
const dirStrokeWeight = 0.375 * vw;
|
|
2276
|
-
const outlineWidth = 0.
|
|
2372
|
+
const repeat = 10 * vw;
|
|
2373
|
+
const strokeWidth = 1.25 * vw * 0.65;
|
|
2374
|
+
const borderWidth = 0.175 * vw * 0.65;
|
|
2375
|
+
const dirStrokeWeight = 0.375 * vw * 0.65;
|
|
2376
|
+
const outlineWidth = 0.45 * vw * 0.65;
|
|
2277
2377
|
const strokeColorInner = props.done ? "#96B2CA" : "#487BF4";
|
|
2278
2378
|
const strokeColorOuter = props.done ? "#7693AF" : "#4175F1";
|
|
2279
2379
|
const strokeColorBorder = props.done ? "#7693AF" : "#6C95F5";
|
|
@@ -2310,7 +2410,7 @@ const GDrivingLine = defineSetup(function GDrivingLine2(props) {
|
|
|
2310
2410
|
path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,
|
|
2311
2411
|
strokeColor: "white",
|
|
2312
2412
|
strokeWeight: dirStrokeWeight,
|
|
2313
|
-
scale:
|
|
2413
|
+
scale: 0.7
|
|
2314
2414
|
},
|
|
2315
2415
|
repeat: `${repeat}px`
|
|
2316
2416
|
}]
|
|
@@ -2539,7 +2639,7 @@ const spaceLog = (logKey, ...args) => {
|
|
|
2539
2639
|
return;
|
|
2540
2640
|
console.log(logKey, ...args);
|
|
2541
2641
|
};
|
|
2542
|
-
const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 20;
|
|
2642
|
+
const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1 = 20;
|
|
2543
2643
|
const useAmapFitView = (props) => {
|
|
2544
2644
|
const { mapRef, autoFitTimeout } = props;
|
|
2545
2645
|
const overlayGroup = /* @__PURE__ */ new Set();
|
|
@@ -2661,7 +2761,7 @@ const useGmapFitView = (props) => {
|
|
|
2661
2761
|
setFitView();
|
|
2662
2762
|
}, autoFitTimeout);
|
|
2663
2763
|
};
|
|
2664
|
-
const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT);
|
|
2764
|
+
const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1);
|
|
2665
2765
|
watchPostEffectForGMapEvent(mapRef, {}, handleMoveEnd, [
|
|
2666
2766
|
"onDragEnd"
|
|
2667
2767
|
]);
|
|
@@ -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MSAxNy4wNzUgMCAxMSAwUzAgNC45MDEgMCAxMC45NDdjMCAzLjkxOCAyLjA2OCA3LjM1NSA1LjE3NyA5LjI5QzExLjc1IDIzLjI3NyA5LjA2IDI3IDExIDI3eiIgc3Ryb2tlPSIjRkZGIiBmaWxsPSJ1cmwoI3ByZWZpeF9fYSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMS4yMTUpIi8+PHRleHQgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
|
|
2761
2861
|
const StartEndPoint_css_ts_vanilla = "";
|
|
2762
|
-
function _defineProperty(obj, key, value) {
|
|
2763
|
-
if (key in obj) {
|
|
2764
|
-
Object.defineProperty(obj, key, {
|
|
2765
|
-
value,
|
|
2766
|
-
enumerable: true,
|
|
2767
|
-
configurable: true,
|
|
2768
|
-
writable: true
|
|
2769
|
-
});
|
|
2770
|
-
} else {
|
|
2771
|
-
obj[key] = value;
|
|
2772
|
-
}
|
|
2773
|
-
return obj;
|
|
2774
|
-
}
|
|
2775
|
-
function ownKeys(object, enumerableOnly) {
|
|
2776
|
-
var keys2 = Object.keys(object);
|
|
2777
|
-
if (Object.getOwnPropertySymbols) {
|
|
2778
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2779
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2780
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2781
|
-
})), keys2.push.apply(keys2, symbols);
|
|
2782
|
-
}
|
|
2783
|
-
return keys2;
|
|
2784
|
-
}
|
|
2785
|
-
function _objectSpread2(target) {
|
|
2786
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2787
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
2788
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2789
|
-
_defineProperty(target, key, source[key]);
|
|
2790
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2791
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2792
|
-
});
|
|
2793
|
-
}
|
|
2794
|
-
return target;
|
|
2795
|
-
}
|
|
2796
|
-
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
2797
|
-
for (var key of Object.keys(compoundCheck)) {
|
|
2798
|
-
var _selections$key;
|
|
2799
|
-
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
2800
|
-
return false;
|
|
2801
|
-
}
|
|
2802
|
-
}
|
|
2803
|
-
return true;
|
|
2804
|
-
};
|
|
2805
|
-
var createRuntimeFn = (config) => (options) => {
|
|
2806
|
-
var className = config.defaultClassName;
|
|
2807
|
-
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
2808
|
-
for (var variantName in selections) {
|
|
2809
|
-
var _selections$variantNa;
|
|
2810
|
-
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
2811
|
-
if (variantSelection != null) {
|
|
2812
|
-
var selection = variantSelection;
|
|
2813
|
-
if (typeof selection === "boolean") {
|
|
2814
|
-
selection = selection === true ? "true" : "false";
|
|
2815
|
-
}
|
|
2816
|
-
var selectionClassName = (
|
|
2817
|
-
// @ts-expect-error
|
|
2818
|
-
config.variantClassNames[variantName][selection]
|
|
2819
|
-
);
|
|
2820
|
-
if (selectionClassName) {
|
|
2821
|
-
className += " " + selectionClassName;
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
2826
|
-
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
2827
|
-
className += " " + compoundClassName;
|
|
2828
|
-
}
|
|
2829
|
-
}
|
|
2830
|
-
return className;
|
|
2831
|
-
};
|
|
2832
2862
|
var pointIcon = createRuntimeFn({ defaultClassName: "", variantClassNames: { type: { start: "_4a4ovk6", end: "_4a4ovk7" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2833
2863
|
var pointInfoBox = "_4a4ovk1";
|
|
2834
2864
|
var pointInfoBoxDescription = "_4a4ovk4";
|
|
@@ -3109,6 +3139,7 @@ const useGeoLocation = (props) => {
|
|
|
3109
3139
|
loading.value = true;
|
|
3110
3140
|
const watchId = singleGeoWatch.watchPosition(
|
|
3111
3141
|
async (position) => {
|
|
3142
|
+
console.log("watchPosition success position = ", position);
|
|
3112
3143
|
const coordinate = position.coords;
|
|
3113
3144
|
const wgsPoint = [position.coords.longitude, position.coords.latitude];
|
|
3114
3145
|
const point = await toGcj02(wgsPoint);
|
|
@@ -3122,6 +3153,7 @@ const useGeoLocation = (props) => {
|
|
|
3122
3153
|
onChange == null ? void 0 : onChange({ position: point, coordinate });
|
|
3123
3154
|
},
|
|
3124
3155
|
(error) => {
|
|
3156
|
+
console.log("watchPosition error = ", error);
|
|
3125
3157
|
loading.value = false;
|
|
3126
3158
|
errorRef.value = error;
|
|
3127
3159
|
const position = props == null ? void 0 : props.geoDefaultPosition;
|
|
@@ -3488,6 +3520,7 @@ const useMapRecomendPlace = (props) => {
|
|
|
3488
3520
|
const { supplier } = useMapSupplier();
|
|
3489
3521
|
return supplier === "gmap" ? useGmapRecomendPlace(props) : useAmapRecomendPlace(props);
|
|
3490
3522
|
};
|
|
3523
|
+
const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 50;
|
|
3491
3524
|
const DEFAULT_ZOOM$1 = 13;
|
|
3492
3525
|
const useAmapZoom = (props) => {
|
|
3493
3526
|
var _a, _b, _c;
|
|
@@ -3517,13 +3550,16 @@ const useGmapZoom = (props) => {
|
|
|
3517
3550
|
zoomRef.value = v;
|
|
3518
3551
|
(_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v);
|
|
3519
3552
|
};
|
|
3520
|
-
const handleZoomChange = (
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3553
|
+
const handleZoomChange = debounce(
|
|
3554
|
+
(_, { target }) => {
|
|
3555
|
+
const zoom = target.getZoom();
|
|
3556
|
+
zoomRef.value = zoom;
|
|
3557
|
+
onChange == null ? void 0 : onChange(zoom);
|
|
3558
|
+
},
|
|
3559
|
+
GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT
|
|
3560
|
+
);
|
|
3525
3561
|
watchPostEffectForGMapEvent(mapRef, {}, handleZoomChange, [
|
|
3526
|
-
"
|
|
3562
|
+
"onZoom_changed"
|
|
3527
3563
|
]);
|
|
3528
3564
|
return { zoomRef, setZoom };
|
|
3529
3565
|
};
|
|
@@ -3939,12 +3975,14 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
3939
3975
|
} = useGeoLocation({
|
|
3940
3976
|
geoDefaultPosition,
|
|
3941
3977
|
onLoad: async (value) => {
|
|
3978
|
+
console.log("useGeoLocation onLoad value = ", value);
|
|
3942
3979
|
await readyPromise;
|
|
3943
3980
|
centerSource.source = "geo";
|
|
3944
3981
|
updatePlace(value.position);
|
|
3945
3982
|
emit("loadGeoLocation", value);
|
|
3946
3983
|
},
|
|
3947
3984
|
onLoadDefault: async (value) => {
|
|
3985
|
+
console.log("useGeoLocation onLoadDefault value = ", value);
|
|
3948
3986
|
await readyPromise;
|
|
3949
3987
|
const place = await defaultCenterPlacePromise;
|
|
3950
3988
|
centerSource.source = "geo";
|
|
@@ -4038,6 +4076,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
4038
4076
|
} = props;
|
|
4039
4077
|
const title = geoLoading.value ? geoLoadingTitle : !availableRef.value ? unavailableTitle : centerPlace.name;
|
|
4040
4078
|
const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
|
|
4079
|
+
console.log("BusinessRecomendPlaceMap render geoLoading, isFirstWorkflowRecomendLoadingRef = ", geoLoading.value, isFirstWorkflowRecomendLoadingRef.value);
|
|
4041
4080
|
return Vue.h(HeycarMap, {
|
|
4042
4081
|
"attrs": {
|
|
4043
4082
|
"center": centerPoint.value,
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import Vue, { defineComponent, h, computed, inject, provide, watch, onMounted, onUnmounted, watchPostEffect, shallowRef,
|
|
7
|
+
import Vue, { defineComponent, h, computed, inject, provide, watch, onMounted, onUnmounted, watchPostEffect, shallowRef, ref, watchEffect, reactive, toRefs, toRef } from "vue";
|
|
8
8
|
const style = "";
|
|
9
9
|
Vue.util.warn;
|
|
10
10
|
const imgAddressLocator = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjYiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSItMzkuNzE5JSIgeTE9IjUwJSIgeDI9IjEyNi4wOTMlIiB5Mj0iNTAlIiBpZD0icHJlZml4X19hIj48c3RvcCBzdG9wLWNvbG9yPSIjNzlBRkZGIiBvZmZzZXQ9IjAlIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzVDOERGRiIgb2Zmc2V0PSIzMi4zNDIlIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzUwN0ZGRiIgb2Zmc2V0PSI3NC44NTMlIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzQ0NzFGRiIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTEuNSAyNGgzdjE0LjVhMS41IDEuNSAwIDAxLTMgMFYyNHoiIGZpbGw9IiM0QzgwRkYiLz48Zz48Y2lyY2xlIGZpbGw9InVybCgjcHJlZml4X19hKSIgY3g9IjEzIiBjeT0iMTMiIHI9IjEzIi8+PGNpcmNsZSBmaWxsPSIjRkZGIiBjeD0iMTMiIGN5PSIxMyIgcj0iNCIvPjwvZz48L2c+PC9zdmc+";
|
|
@@ -1041,7 +1041,7 @@ function watchPostEffectForGMapEvent(targetRef, props, emit, propertyNames) {
|
|
|
1041
1041
|
for (const name of propertyNames) {
|
|
1042
1042
|
const emitEventName = property2emitEventName(name);
|
|
1043
1043
|
const eventName = property2mapEventName(name);
|
|
1044
|
-
const handler = (e) => emit(emitEventName, e);
|
|
1044
|
+
const handler = (e) => emit(emitEventName, { ...e, target });
|
|
1045
1045
|
const listener = target.addListener(eventName, handler);
|
|
1046
1046
|
cleanList.push(() => google.maps.event.removeListener(listener));
|
|
1047
1047
|
}
|
|
@@ -1975,6 +1975,25 @@ const useMapEventSource = () => {
|
|
|
1975
1975
|
};
|
|
1976
1976
|
return { executeMapApi };
|
|
1977
1977
|
};
|
|
1978
|
+
const useGmapTouchStartCenter = (props) => {
|
|
1979
|
+
const { mapRef, elementRef } = props;
|
|
1980
|
+
const touchstartCenterRef = ref(void 0);
|
|
1981
|
+
watchEffect((onCleanup) => {
|
|
1982
|
+
const map = mapRef.value;
|
|
1983
|
+
const element = elementRef.value;
|
|
1984
|
+
if (!map || !element)
|
|
1985
|
+
return;
|
|
1986
|
+
const handleTouchStart = () => {
|
|
1987
|
+
const center = map.getCenter();
|
|
1988
|
+
const lng = center == null ? void 0 : center.lng();
|
|
1989
|
+
const lat = center == null ? void 0 : center.lat();
|
|
1990
|
+
touchstartCenterRef.value = lng && lat ? [lng, lat] : void 0;
|
|
1991
|
+
};
|
|
1992
|
+
element.addEventListener("touchstart", handleTouchStart);
|
|
1993
|
+
onCleanup(() => element.removeEventListener("touchstart", handleTouchStart));
|
|
1994
|
+
});
|
|
1995
|
+
return { touchstartCenterRef };
|
|
1996
|
+
};
|
|
1978
1997
|
const useResizeObserver = (props) => {
|
|
1979
1998
|
const { elementRef, onChange } = props;
|
|
1980
1999
|
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
@@ -1995,27 +2014,109 @@ const useResizeObserver = (props) => {
|
|
|
1995
2014
|
});
|
|
1996
2015
|
};
|
|
1997
2016
|
const Gmap_css_ts_vanilla = "";
|
|
2017
|
+
function _defineProperty(obj, key, value) {
|
|
2018
|
+
if (key in obj) {
|
|
2019
|
+
Object.defineProperty(obj, key, {
|
|
2020
|
+
value,
|
|
2021
|
+
enumerable: true,
|
|
2022
|
+
configurable: true,
|
|
2023
|
+
writable: true
|
|
2024
|
+
});
|
|
2025
|
+
} else {
|
|
2026
|
+
obj[key] = value;
|
|
2027
|
+
}
|
|
2028
|
+
return obj;
|
|
2029
|
+
}
|
|
2030
|
+
function ownKeys(object, enumerableOnly) {
|
|
2031
|
+
var keys2 = Object.keys(object);
|
|
2032
|
+
if (Object.getOwnPropertySymbols) {
|
|
2033
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2034
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2035
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2036
|
+
})), keys2.push.apply(keys2, symbols);
|
|
2037
|
+
}
|
|
2038
|
+
return keys2;
|
|
2039
|
+
}
|
|
2040
|
+
function _objectSpread2(target) {
|
|
2041
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2042
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
2043
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2044
|
+
_defineProperty(target, key, source[key]);
|
|
2045
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2046
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
return target;
|
|
2050
|
+
}
|
|
2051
|
+
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
2052
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
2053
|
+
var _selections$key;
|
|
2054
|
+
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
2055
|
+
return false;
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
return true;
|
|
2059
|
+
};
|
|
2060
|
+
var createRuntimeFn = (config) => (options) => {
|
|
2061
|
+
var className = config.defaultClassName;
|
|
2062
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
2063
|
+
for (var variantName in selections) {
|
|
2064
|
+
var _selections$variantNa;
|
|
2065
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
2066
|
+
if (variantSelection != null) {
|
|
2067
|
+
var selection = variantSelection;
|
|
2068
|
+
if (typeof selection === "boolean") {
|
|
2069
|
+
selection = selection === true ? "true" : "false";
|
|
2070
|
+
}
|
|
2071
|
+
var selectionClassName = (
|
|
2072
|
+
// @ts-expect-error
|
|
2073
|
+
config.variantClassNames[variantName][selection]
|
|
2074
|
+
);
|
|
2075
|
+
if (selectionClassName) {
|
|
2076
|
+
className += " " + selectionClassName;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
2081
|
+
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
2082
|
+
className += " " + compoundClassName;
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
return className;
|
|
2086
|
+
};
|
|
1998
2087
|
var gmap = "_7anfuo0";
|
|
2088
|
+
createRuntimeFn({ defaultClassName: "", variantClassNames: { enable: { true: "_7anfuo1", false: "_7anfuo2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
1999
2089
|
const Gmap = defineSetup(function Gmap2(props, { slots, emit }) {
|
|
2000
2090
|
const setMap = props.mapRef;
|
|
2001
2091
|
const { onResize } = props;
|
|
2002
2092
|
const options = computed(() => {
|
|
2003
|
-
const { mapRef: mapRef2, onDragStart, onDragEnd,
|
|
2093
|
+
const { mapRef: mapRef2, onDragStart, onDragEnd, onZoom_changed, touchZoomCenter, ...options2 } = props;
|
|
2004
2094
|
return options2;
|
|
2005
2095
|
});
|
|
2006
2096
|
const defaultOptions = options.value;
|
|
2007
2097
|
const elementRef = shallowRef();
|
|
2008
2098
|
const mapRef = shallowRef();
|
|
2009
2099
|
const { executeMapApi } = useMapEventSource();
|
|
2010
|
-
const
|
|
2100
|
+
const { touchstartCenterRef } = useGmapTouchStartCenter({ mapRef, elementRef });
|
|
2101
|
+
const handleDrag = (name) => {
|
|
2102
|
+
emit(name, { target: mapRef.value });
|
|
2103
|
+
};
|
|
2104
|
+
const handleZoom = (name) => {
|
|
2105
|
+
var _a;
|
|
2106
|
+
emit(name, { target: mapRef.value });
|
|
2107
|
+
const center = touchstartCenterRef.value;
|
|
2108
|
+
if (center)
|
|
2109
|
+
(_a = mapRef.value) == null ? void 0 : _a.setCenter(vec2lnglat(center));
|
|
2110
|
+
};
|
|
2011
2111
|
provideGmap(mapRef);
|
|
2012
2112
|
useResizeObserver({ elementRef, onChange: onResize });
|
|
2013
2113
|
watchPostEffect(() => {
|
|
2014
|
-
|
|
2114
|
+
const element = elementRef.value;
|
|
2115
|
+
if (mapRef.value || !element)
|
|
2015
2116
|
return;
|
|
2016
2117
|
let map;
|
|
2017
2118
|
executeMapApi(() => {
|
|
2018
|
-
map = new google.maps.Map(
|
|
2119
|
+
map = new google.maps.Map(element, { ...defaultOptions });
|
|
2019
2120
|
window.GlobalGmap = map;
|
|
2020
2121
|
});
|
|
2021
2122
|
mapRef.value = map;
|
|
@@ -2030,11 +2131,8 @@ const Gmap = defineSetup(function Gmap2(props, { slots, emit }) {
|
|
|
2030
2131
|
});
|
|
2031
2132
|
}
|
|
2032
2133
|
);
|
|
2033
|
-
watchPostEffectForGMapEvent(mapRef, props, handleDrag, [
|
|
2034
|
-
|
|
2035
|
-
"onDragEnd",
|
|
2036
|
-
"onZoom_change"
|
|
2037
|
-
]);
|
|
2134
|
+
watchPostEffectForGMapEvent(mapRef, props, handleDrag, ["onDragStart", "onDragEnd"]);
|
|
2135
|
+
watchPostEffectForGMapEvent(mapRef, props, handleZoom, ["onZoom_changed"]);
|
|
2038
2136
|
return () => {
|
|
2039
2137
|
var _a;
|
|
2040
2138
|
return h("div", { ref: elementRef, class: gmap }, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
@@ -2113,12 +2211,14 @@ const HeycarMap = defineLagecySetup(function HeycarMap2(props, {
|
|
|
2113
2211
|
"attrs": {
|
|
2114
2212
|
"mapRef": setMap,
|
|
2115
2213
|
"mapId": gmapId,
|
|
2116
|
-
"center": center ? vec2lnglat(center) : void 0,
|
|
2214
|
+
"center": center ? vec2lnglat(center.map(Number)) : void 0,
|
|
2117
2215
|
"zoom": zoom,
|
|
2118
2216
|
"disableDefaultUI": true,
|
|
2217
|
+
"clickableIcons": false,
|
|
2119
2218
|
"disableDoubleClickZoom": touchEnable,
|
|
2120
2219
|
"gestureHandling": touchEnable ? "auto" : "none",
|
|
2121
|
-
"keyboardShortcuts": touchEnable
|
|
2220
|
+
"keyboardShortcuts": touchEnable,
|
|
2221
|
+
"touchZoomCenter": touchZoomCenter
|
|
2122
2222
|
},
|
|
2123
2223
|
"on": {
|
|
2124
2224
|
"dragEnd": gmapHandleDargEnd,
|
|
@@ -2267,11 +2367,11 @@ const GDrivingLine = defineSetup(function GDrivingLine2(props) {
|
|
|
2267
2367
|
const pathRef = computed(() => props.path.map(vec2lnglat));
|
|
2268
2368
|
return () => {
|
|
2269
2369
|
const vw = window.innerWidth * 0.01;
|
|
2270
|
-
const repeat =
|
|
2271
|
-
const strokeWidth = 1.25 * vw;
|
|
2272
|
-
const borderWidth = 0.175 * vw;
|
|
2273
|
-
const dirStrokeWeight = 0.375 * vw;
|
|
2274
|
-
const outlineWidth = 0.
|
|
2370
|
+
const repeat = 10 * vw;
|
|
2371
|
+
const strokeWidth = 1.25 * vw * 0.65;
|
|
2372
|
+
const borderWidth = 0.175 * vw * 0.65;
|
|
2373
|
+
const dirStrokeWeight = 0.375 * vw * 0.65;
|
|
2374
|
+
const outlineWidth = 0.45 * vw * 0.65;
|
|
2275
2375
|
const strokeColorInner = props.done ? "#96B2CA" : "#487BF4";
|
|
2276
2376
|
const strokeColorOuter = props.done ? "#7693AF" : "#4175F1";
|
|
2277
2377
|
const strokeColorBorder = props.done ? "#7693AF" : "#6C95F5";
|
|
@@ -2308,7 +2408,7 @@ const GDrivingLine = defineSetup(function GDrivingLine2(props) {
|
|
|
2308
2408
|
path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,
|
|
2309
2409
|
strokeColor: "white",
|
|
2310
2410
|
strokeWeight: dirStrokeWeight,
|
|
2311
|
-
scale:
|
|
2411
|
+
scale: 0.7
|
|
2312
2412
|
},
|
|
2313
2413
|
repeat: `${repeat}px`
|
|
2314
2414
|
}]
|
|
@@ -2537,7 +2637,7 @@ const spaceLog = (logKey, ...args) => {
|
|
|
2537
2637
|
return;
|
|
2538
2638
|
console.log(logKey, ...args);
|
|
2539
2639
|
};
|
|
2540
|
-
const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 20;
|
|
2640
|
+
const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1 = 20;
|
|
2541
2641
|
const useAmapFitView = (props) => {
|
|
2542
2642
|
const { mapRef, autoFitTimeout } = props;
|
|
2543
2643
|
const overlayGroup = /* @__PURE__ */ new Set();
|
|
@@ -2659,7 +2759,7 @@ const useGmapFitView = (props) => {
|
|
|
2659
2759
|
setFitView();
|
|
2660
2760
|
}, autoFitTimeout);
|
|
2661
2761
|
};
|
|
2662
|
-
const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT);
|
|
2762
|
+
const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1);
|
|
2663
2763
|
watchPostEffectForGMapEvent(mapRef, {}, handleMoveEnd, [
|
|
2664
2764
|
"onDragEnd"
|
|
2665
2765
|
]);
|
|
@@ -2757,76 +2857,6 @@ const ZINDEX_PASSENGER_LAYER = 20;
|
|
|
2757
2857
|
const imgEndPoint = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSI3Mi4zMzklIiB5MT0iNTAlIiB4Mj0iMCUiIHkyPSI1MCUiIGlkPSJwcmVmaXhfX2EiPjxzdG9wIHN0b3AtY29sb3I9IiNGRjg0NDciIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkY4QjRBIiBvZmZzZXQ9IjUwLjU5NiUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZBOTVBIiBvZmZzZXQ9IjEwMCUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiAzMC4yMTVjMi4xMzQgMCAzLjg2My0uODkzIDMuODYzLTEuOTk1IDAtMS4xLTEuNzMtMS45OTQtMy44NjMtMS45OT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IxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTIgMzAuMjE1YzEuOTUgMCAzLjUzMi0uODE2IDMuNTMyLTEuODIzIDAtMS4wMDctMS41ODEtMS44MjMtMy41MzItMS44MjMtMS45NSAwLTMuNTMyLjgxNi0zLjUzMiAxLjgyMyAwIDEuMDA3IDEuNTgxIDEuODIzIDMuNTMyIDEuODIzeiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0iIzQzNDg1QSIvPjxwYXRoIGQ9Ik0xMSAyN2MyLjEyOCAwLS45LTMuNzQyIDUuNjIxLTYuNjQxIDMuMjIxLTEuOTEgNS4zNzktNS40MSA1LjM3OS05LjQxMkMyMiA0LjkwMSAxNy4wNzUgMCAxMSAwUzAgNC45MDEgMCAxMC45NDdjMCAzLjkxOCAyLjA2OCA3LjM1NSA1LjE3NyA5LjI5QzExLjc1IDIzLjI3NyA5LjA2IDI3IDExIDI3eiIgc3Ryb2tlPSIjRkZGIiBmaWxsPSJ1cmwoI3ByZWZpeF9fYSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMS4yMTUpIi8+PHRleHQgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
|
|
2759
2859
|
const StartEndPoint_css_ts_vanilla = "";
|
|
2760
|
-
function _defineProperty(obj, key, value) {
|
|
2761
|
-
if (key in obj) {
|
|
2762
|
-
Object.defineProperty(obj, key, {
|
|
2763
|
-
value,
|
|
2764
|
-
enumerable: true,
|
|
2765
|
-
configurable: true,
|
|
2766
|
-
writable: true
|
|
2767
|
-
});
|
|
2768
|
-
} else {
|
|
2769
|
-
obj[key] = value;
|
|
2770
|
-
}
|
|
2771
|
-
return obj;
|
|
2772
|
-
}
|
|
2773
|
-
function ownKeys(object, enumerableOnly) {
|
|
2774
|
-
var keys2 = Object.keys(object);
|
|
2775
|
-
if (Object.getOwnPropertySymbols) {
|
|
2776
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2777
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2778
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2779
|
-
})), keys2.push.apply(keys2, symbols);
|
|
2780
|
-
}
|
|
2781
|
-
return keys2;
|
|
2782
|
-
}
|
|
2783
|
-
function _objectSpread2(target) {
|
|
2784
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2785
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
2786
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2787
|
-
_defineProperty(target, key, source[key]);
|
|
2788
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2789
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2790
|
-
});
|
|
2791
|
-
}
|
|
2792
|
-
return target;
|
|
2793
|
-
}
|
|
2794
|
-
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
2795
|
-
for (var key of Object.keys(compoundCheck)) {
|
|
2796
|
-
var _selections$key;
|
|
2797
|
-
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
2798
|
-
return false;
|
|
2799
|
-
}
|
|
2800
|
-
}
|
|
2801
|
-
return true;
|
|
2802
|
-
};
|
|
2803
|
-
var createRuntimeFn = (config) => (options) => {
|
|
2804
|
-
var className = config.defaultClassName;
|
|
2805
|
-
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
2806
|
-
for (var variantName in selections) {
|
|
2807
|
-
var _selections$variantNa;
|
|
2808
|
-
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
2809
|
-
if (variantSelection != null) {
|
|
2810
|
-
var selection = variantSelection;
|
|
2811
|
-
if (typeof selection === "boolean") {
|
|
2812
|
-
selection = selection === true ? "true" : "false";
|
|
2813
|
-
}
|
|
2814
|
-
var selectionClassName = (
|
|
2815
|
-
// @ts-expect-error
|
|
2816
|
-
config.variantClassNames[variantName][selection]
|
|
2817
|
-
);
|
|
2818
|
-
if (selectionClassName) {
|
|
2819
|
-
className += " " + selectionClassName;
|
|
2820
|
-
}
|
|
2821
|
-
}
|
|
2822
|
-
}
|
|
2823
|
-
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
2824
|
-
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
2825
|
-
className += " " + compoundClassName;
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
return className;
|
|
2829
|
-
};
|
|
2830
2860
|
var pointIcon = createRuntimeFn({ defaultClassName: "", variantClassNames: { type: { start: "_4a4ovk6", end: "_4a4ovk7" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2831
2861
|
var pointInfoBox = "_4a4ovk1";
|
|
2832
2862
|
var pointInfoBoxDescription = "_4a4ovk4";
|
|
@@ -3107,6 +3137,7 @@ const useGeoLocation = (props) => {
|
|
|
3107
3137
|
loading.value = true;
|
|
3108
3138
|
const watchId = singleGeoWatch.watchPosition(
|
|
3109
3139
|
async (position) => {
|
|
3140
|
+
console.log("watchPosition success position = ", position);
|
|
3110
3141
|
const coordinate = position.coords;
|
|
3111
3142
|
const wgsPoint = [position.coords.longitude, position.coords.latitude];
|
|
3112
3143
|
const point = await toGcj02(wgsPoint);
|
|
@@ -3120,6 +3151,7 @@ const useGeoLocation = (props) => {
|
|
|
3120
3151
|
onChange == null ? void 0 : onChange({ position: point, coordinate });
|
|
3121
3152
|
},
|
|
3122
3153
|
(error) => {
|
|
3154
|
+
console.log("watchPosition error = ", error);
|
|
3123
3155
|
loading.value = false;
|
|
3124
3156
|
errorRef.value = error;
|
|
3125
3157
|
const position = props == null ? void 0 : props.geoDefaultPosition;
|
|
@@ -3486,6 +3518,7 @@ const useMapRecomendPlace = (props) => {
|
|
|
3486
3518
|
const { supplier } = useMapSupplier();
|
|
3487
3519
|
return supplier === "gmap" ? useGmapRecomendPlace(props) : useAmapRecomendPlace(props);
|
|
3488
3520
|
};
|
|
3521
|
+
const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 50;
|
|
3489
3522
|
const DEFAULT_ZOOM$1 = 13;
|
|
3490
3523
|
const useAmapZoom = (props) => {
|
|
3491
3524
|
var _a, _b, _c;
|
|
@@ -3515,13 +3548,16 @@ const useGmapZoom = (props) => {
|
|
|
3515
3548
|
zoomRef.value = v;
|
|
3516
3549
|
(_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v);
|
|
3517
3550
|
};
|
|
3518
|
-
const handleZoomChange = (
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3551
|
+
const handleZoomChange = debounce(
|
|
3552
|
+
(_, { target }) => {
|
|
3553
|
+
const zoom = target.getZoom();
|
|
3554
|
+
zoomRef.value = zoom;
|
|
3555
|
+
onChange == null ? void 0 : onChange(zoom);
|
|
3556
|
+
},
|
|
3557
|
+
GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT
|
|
3558
|
+
);
|
|
3523
3559
|
watchPostEffectForGMapEvent(mapRef, {}, handleZoomChange, [
|
|
3524
|
-
"
|
|
3560
|
+
"onZoom_changed"
|
|
3525
3561
|
]);
|
|
3526
3562
|
return { zoomRef, setZoom };
|
|
3527
3563
|
};
|
|
@@ -3937,12 +3973,14 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
3937
3973
|
} = useGeoLocation({
|
|
3938
3974
|
geoDefaultPosition,
|
|
3939
3975
|
onLoad: async (value) => {
|
|
3976
|
+
console.log("useGeoLocation onLoad value = ", value);
|
|
3940
3977
|
await readyPromise;
|
|
3941
3978
|
centerSource.source = "geo";
|
|
3942
3979
|
updatePlace(value.position);
|
|
3943
3980
|
emit("loadGeoLocation", value);
|
|
3944
3981
|
},
|
|
3945
3982
|
onLoadDefault: async (value) => {
|
|
3983
|
+
console.log("useGeoLocation onLoadDefault value = ", value);
|
|
3946
3984
|
await readyPromise;
|
|
3947
3985
|
const place = await defaultCenterPlacePromise;
|
|
3948
3986
|
centerSource.source = "geo";
|
|
@@ -4036,6 +4074,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
4036
4074
|
} = props;
|
|
4037
4075
|
const title = geoLoading.value ? geoLoadingTitle : !availableRef.value ? unavailableTitle : centerPlace.name;
|
|
4038
4076
|
const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
|
|
4077
|
+
console.log("BusinessRecomendPlaceMap render geoLoading, isFirstWorkflowRecomendLoadingRef = ", geoLoading.value, isFirstWorkflowRecomendLoadingRef.value);
|
|
4039
4078
|
return h(HeycarMap, {
|
|
4040
4079
|
"attrs": {
|
|
4041
4080
|
"center": centerPoint.value,
|
package/dist/style.css
CHANGED
|
@@ -116,10 +116,16 @@
|
|
|
116
116
|
width: inherit;
|
|
117
117
|
}
|
|
118
118
|
._7anfuo1 {
|
|
119
|
+
touch-action: none;
|
|
120
|
+
}
|
|
121
|
+
._7anfuo3 {
|
|
119
122
|
position: relative;
|
|
120
123
|
}
|
|
121
124
|
a[title*="Google"]>div>img[alt="Google"], .gmnoprint {
|
|
122
125
|
display: none;
|
|
126
|
+
}
|
|
127
|
+
._7anfuo0 [class*="marker-view"] {
|
|
128
|
+
will-change: unset !important;
|
|
123
129
|
}._4a4ovk0 {
|
|
124
130
|
margin-bottom: -0.4vw;
|
|
125
131
|
display: flex;
|
|
@@ -201,6 +207,7 @@ a[title*="Google"]>div>img[alt="Google"], .gmnoprint {
|
|
|
201
207
|
}
|
|
202
208
|
.fhyw85 {
|
|
203
209
|
margin-bottom: -2.265vw;
|
|
210
|
+
width: max-content;
|
|
204
211
|
}
|
|
205
212
|
.fhyw86 {
|
|
206
213
|
margin-right: calc(50% - 2.265vw);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface EaseAnimatieRenderProps {
|
|
2
|
+
value: number[];
|
|
3
|
+
delta: number[];
|
|
4
|
+
}
|
|
5
|
+
export interface EaseAnimatieProps {
|
|
6
|
+
from: number[];
|
|
7
|
+
to: number[];
|
|
8
|
+
duration: number;
|
|
9
|
+
render: (props: EaseAnimatieRenderProps) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const easeAnimate: (props: EaseAnimatieProps) => void;
|
|
12
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heycar/heycars-map",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite -c vite.config.dev.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@amap/amap-jsapi-types": "^0.0.13",
|
|
27
27
|
"@googlemaps/js-api-loader": "^1.15.1",
|
|
28
28
|
"@googlemaps/typescript-guards": "^2.0.3",
|
|
29
|
+
"@use-gesture/vanilla": "^10.2.26",
|
|
29
30
|
"fast-equals": "^3.0.3",
|
|
30
31
|
"lodash-es": "^4.17.21",
|
|
31
32
|
"vue-demi": "^0.13.11"
|
package/todo.md
CHANGED
|
@@ -5,6 +5,11 @@ https://dawchihliou.github.io/articles/building-custom-google-maps-marker-react-
|
|
|
5
5
|
4. map 的两个 slot loading 和 error slot 没有生效
|
|
6
6
|
5. 企业微信如果关闭定位,会不停的跳 geoError 事件
|
|
7
7
|
|
|
8
|
+
二期:
|
|
9
|
+
|
|
10
|
+
1. 绿区数据格式约定
|
|
11
|
+
2. map loading 设计稿
|
|
12
|
+
|
|
8
13
|
缩放问题
|
|
9
14
|
|
|
10
15
|
- 4867
|
|
@@ -106,3 +111,12 @@ https://dawchihliou.github.io/articles/building-custom-google-maps-marker-react-
|
|
|
106
111
|
|
|
107
112
|
- 5500
|
|
108
113
|
- 5524
|
|
114
|
+
|
|
115
|
+
0.6.3
|
|
116
|
+
|
|
117
|
+
- 5623
|
|
118
|
+
- 5625
|
|
119
|
+
- 5550
|
|
120
|
+
- 5546
|
|
121
|
+
- 5541
|
|
122
|
+
- 5540
|