@heycar/heycars-map 0.6.3 → 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.
@@ -1,2 +1,10 @@
1
1
  export declare const gmap: string;
2
+ export declare const noneTouchAction: import("@vanilla-extract/recipes").RuntimeFn<{
3
+ enable: {
4
+ true: {
5
+ touchAction: "none";
6
+ };
7
+ false: {};
8
+ };
9
+ }>;
2
10
  export declare const gmapLayout: string;
@@ -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
- onZoom_change?: MapEventHandler<google.maps.Map>;
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" | "zoom_change", GmapProps, {}>;
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 {};
@@ -1,6 +1,6 @@
1
1
  import { ShallowRef } from "vue-demi";
2
2
  export interface UseResizeObserverProps {
3
- elementRef: ShallowRef<HTMLDivElement>;
3
+ elementRef: ShallowRef<HTMLDivElement | undefined>;
4
4
  onChange?: (props: {
5
5
  width: number;
6
6
  height: number;
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, onZoom_change, ...options2 } = props;
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 handleDrag = (name) => emit(name, { target: mapRef.value });
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
- if (mapRef.value || !elementRef.value)
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(elementRef.value, { ...defaultOptions });
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
- "onDragStart",
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,13 +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,
2121
2219
  "clickableIcons": false,
2122
2220
  "disableDoubleClickZoom": touchEnable,
2123
2221
  "gestureHandling": touchEnable ? "auto" : "none",
2124
- "keyboardShortcuts": touchEnable
2222
+ "keyboardShortcuts": touchEnable,
2223
+ "touchZoomCenter": touchZoomCenter
2125
2224
  },
2126
2225
  "on": {
2127
2226
  "dragEnd": gmapHandleDargEnd,
@@ -2540,7 +2639,7 @@ const spaceLog = (logKey, ...args) => {
2540
2639
  return;
2541
2640
  console.log(logKey, ...args);
2542
2641
  };
2543
- const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 20;
2642
+ const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1 = 20;
2544
2643
  const useAmapFitView = (props) => {
2545
2644
  const { mapRef, autoFitTimeout } = props;
2546
2645
  const overlayGroup = /* @__PURE__ */ new Set();
@@ -2662,7 +2761,7 @@ const useGmapFitView = (props) => {
2662
2761
  setFitView();
2663
2762
  }, autoFitTimeout);
2664
2763
  };
2665
- const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT);
2764
+ const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1);
2666
2765
  watchPostEffectForGMapEvent(mapRef, {}, handleMoveEnd, [
2667
2766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QxMkMyMiA0LjkwMSAxNy4wNzUgMCAxMSAwUzAgNC45MDEgMCAxMC45NDdjMCAzLjkxOCAyLjA2OCA3LjM1NSA1LjE3NyA5LjI5QzExLjc1IDIzLjI3NyA5LjA2IDI3IDExIDI3eiIgc3Ryb2tlPSIjRkZGIiBmaWxsPSJ1cmwoI3ByZWZpeF9fYSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMS4yMTUpIi8+PHRleHQgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
2762
2861
  const StartEndPoint_css_ts_vanilla = "";
2763
- function _defineProperty(obj, key, value) {
2764
- if (key in obj) {
2765
- Object.defineProperty(obj, key, {
2766
- value,
2767
- enumerable: true,
2768
- configurable: true,
2769
- writable: true
2770
- });
2771
- } else {
2772
- obj[key] = value;
2773
- }
2774
- return obj;
2775
- }
2776
- function ownKeys(object, enumerableOnly) {
2777
- var keys2 = Object.keys(object);
2778
- if (Object.getOwnPropertySymbols) {
2779
- var symbols = Object.getOwnPropertySymbols(object);
2780
- enumerableOnly && (symbols = symbols.filter(function(sym) {
2781
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2782
- })), keys2.push.apply(keys2, symbols);
2783
- }
2784
- return keys2;
2785
- }
2786
- function _objectSpread2(target) {
2787
- for (var i = 1; i < arguments.length; i++) {
2788
- var source = null != arguments[i] ? arguments[i] : {};
2789
- i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
2790
- _defineProperty(target, key, source[key]);
2791
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
2792
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2793
- });
2794
- }
2795
- return target;
2796
- }
2797
- var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
2798
- for (var key of Object.keys(compoundCheck)) {
2799
- var _selections$key;
2800
- if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
2801
- return false;
2802
- }
2803
- }
2804
- return true;
2805
- };
2806
- var createRuntimeFn = (config) => (options) => {
2807
- var className = config.defaultClassName;
2808
- var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
2809
- for (var variantName in selections) {
2810
- var _selections$variantNa;
2811
- var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
2812
- if (variantSelection != null) {
2813
- var selection = variantSelection;
2814
- if (typeof selection === "boolean") {
2815
- selection = selection === true ? "true" : "false";
2816
- }
2817
- var selectionClassName = (
2818
- // @ts-expect-error
2819
- config.variantClassNames[variantName][selection]
2820
- );
2821
- if (selectionClassName) {
2822
- className += " " + selectionClassName;
2823
- }
2824
- }
2825
- }
2826
- for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
2827
- if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
2828
- className += " " + compoundClassName;
2829
- }
2830
- }
2831
- return className;
2832
- };
2833
2862
  var pointIcon = createRuntimeFn({ defaultClassName: "", variantClassNames: { type: { start: "_4a4ovk6", end: "_4a4ovk7" } }, defaultVariants: {}, compoundVariants: [] });
2834
2863
  var pointInfoBox = "_4a4ovk1";
2835
2864
  var pointInfoBoxDescription = "_4a4ovk4";
@@ -3110,6 +3139,7 @@ const useGeoLocation = (props) => {
3110
3139
  loading.value = true;
3111
3140
  const watchId = singleGeoWatch.watchPosition(
3112
3141
  async (position) => {
3142
+ console.log("watchPosition success position = ", position);
3113
3143
  const coordinate = position.coords;
3114
3144
  const wgsPoint = [position.coords.longitude, position.coords.latitude];
3115
3145
  const point = await toGcj02(wgsPoint);
@@ -3123,6 +3153,7 @@ const useGeoLocation = (props) => {
3123
3153
  onChange == null ? void 0 : onChange({ position: point, coordinate });
3124
3154
  },
3125
3155
  (error) => {
3156
+ console.log("watchPosition error = ", error);
3126
3157
  loading.value = false;
3127
3158
  errorRef.value = error;
3128
3159
  const position = props == null ? void 0 : props.geoDefaultPosition;
@@ -3489,6 +3520,7 @@ const useMapRecomendPlace = (props) => {
3489
3520
  const { supplier } = useMapSupplier();
3490
3521
  return supplier === "gmap" ? useGmapRecomendPlace(props) : useAmapRecomendPlace(props);
3491
3522
  };
3523
+ const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 50;
3492
3524
  const DEFAULT_ZOOM$1 = 13;
3493
3525
  const useAmapZoom = (props) => {
3494
3526
  var _a, _b, _c;
@@ -3518,13 +3550,16 @@ const useGmapZoom = (props) => {
3518
3550
  zoomRef.value = v;
3519
3551
  (_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v);
3520
3552
  };
3521
- const handleZoomChange = (_, { target }) => {
3522
- const zoom = target.getZoom();
3523
- zoomRef.value = zoom;
3524
- onChange == null ? void 0 : onChange(zoom);
3525
- };
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
+ );
3526
3561
  watchPostEffectForGMapEvent(mapRef, {}, handleZoomChange, [
3527
- "onZoom_change"
3562
+ "onZoom_changed"
3528
3563
  ]);
3529
3564
  return { zoomRef, setZoom };
3530
3565
  };
@@ -3940,12 +3975,14 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
3940
3975
  } = useGeoLocation({
3941
3976
  geoDefaultPosition,
3942
3977
  onLoad: async (value) => {
3978
+ console.log("useGeoLocation onLoad value = ", value);
3943
3979
  await readyPromise;
3944
3980
  centerSource.source = "geo";
3945
3981
  updatePlace(value.position);
3946
3982
  emit("loadGeoLocation", value);
3947
3983
  },
3948
3984
  onLoadDefault: async (value) => {
3985
+ console.log("useGeoLocation onLoadDefault value = ", value);
3949
3986
  await readyPromise;
3950
3987
  const place = await defaultCenterPlacePromise;
3951
3988
  centerSource.source = "geo";
@@ -4039,6 +4076,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
4039
4076
  } = props;
4040
4077
  const title = geoLoading.value ? geoLoadingTitle : !availableRef.value ? unavailableTitle : centerPlace.name;
4041
4078
  const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
4079
+ console.log("BusinessRecomendPlaceMap render geoLoading, isFirstWorkflowRecomendLoadingRef = ", geoLoading.value, isFirstWorkflowRecomendLoadingRef.value);
4042
4080
  return Vue.h(HeycarMap, {
4043
4081
  "attrs": {
4044
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, reactive, toRefs, ref, toRef, watchEffect } from "vue";
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, onZoom_change, ...options2 } = props;
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 handleDrag = (name) => emit(name, { target: mapRef.value });
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
- if (mapRef.value || !elementRef.value)
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(elementRef.value, { ...defaultOptions });
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
- "onDragStart",
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,13 +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,
2119
2217
  "clickableIcons": false,
2120
2218
  "disableDoubleClickZoom": touchEnable,
2121
2219
  "gestureHandling": touchEnable ? "auto" : "none",
2122
- "keyboardShortcuts": touchEnable
2220
+ "keyboardShortcuts": touchEnable,
2221
+ "touchZoomCenter": touchZoomCenter
2123
2222
  },
2124
2223
  "on": {
2125
2224
  "dragEnd": gmapHandleDargEnd,
@@ -2538,7 +2637,7 @@ const spaceLog = (logKey, ...args) => {
2538
2637
  return;
2539
2638
  console.log(logKey, ...args);
2540
2639
  };
2541
- const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 20;
2640
+ const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1 = 20;
2542
2641
  const useAmapFitView = (props) => {
2543
2642
  const { mapRef, autoFitTimeout } = props;
2544
2643
  const overlayGroup = /* @__PURE__ */ new Set();
@@ -2660,7 +2759,7 @@ const useGmapFitView = (props) => {
2660
2759
  setFitView();
2661
2760
  }, autoFitTimeout);
2662
2761
  };
2663
- const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT);
2762
+ const handleZoomChange = debounce(handleMoveEnd, GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT$1);
2664
2763
  watchPostEffectForGMapEvent(mapRef, {}, handleMoveEnd, [
2665
2764
  "onDragEnd"
2666
2765
  ]);
@@ -2758,76 +2857,6 @@ const ZINDEX_PASSENGER_LAYER = 20;
2758
2857
  const imgEndPoint = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSI3Mi4zMzklIiB5MT0iNTAlIiB4Mj0iMC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W1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
2760
2859
  const StartEndPoint_css_ts_vanilla = "";
2761
- function _defineProperty(obj, key, value) {
2762
- if (key in obj) {
2763
- Object.defineProperty(obj, key, {
2764
- value,
2765
- enumerable: true,
2766
- configurable: true,
2767
- writable: true
2768
- });
2769
- } else {
2770
- obj[key] = value;
2771
- }
2772
- return obj;
2773
- }
2774
- function ownKeys(object, enumerableOnly) {
2775
- var keys2 = Object.keys(object);
2776
- if (Object.getOwnPropertySymbols) {
2777
- var symbols = Object.getOwnPropertySymbols(object);
2778
- enumerableOnly && (symbols = symbols.filter(function(sym) {
2779
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2780
- })), keys2.push.apply(keys2, symbols);
2781
- }
2782
- return keys2;
2783
- }
2784
- function _objectSpread2(target) {
2785
- for (var i = 1; i < arguments.length; i++) {
2786
- var source = null != arguments[i] ? arguments[i] : {};
2787
- i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
2788
- _defineProperty(target, key, source[key]);
2789
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
2790
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2791
- });
2792
- }
2793
- return target;
2794
- }
2795
- var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
2796
- for (var key of Object.keys(compoundCheck)) {
2797
- var _selections$key;
2798
- if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
2799
- return false;
2800
- }
2801
- }
2802
- return true;
2803
- };
2804
- var createRuntimeFn = (config) => (options) => {
2805
- var className = config.defaultClassName;
2806
- var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
2807
- for (var variantName in selections) {
2808
- var _selections$variantNa;
2809
- var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
2810
- if (variantSelection != null) {
2811
- var selection = variantSelection;
2812
- if (typeof selection === "boolean") {
2813
- selection = selection === true ? "true" : "false";
2814
- }
2815
- var selectionClassName = (
2816
- // @ts-expect-error
2817
- config.variantClassNames[variantName][selection]
2818
- );
2819
- if (selectionClassName) {
2820
- className += " " + selectionClassName;
2821
- }
2822
- }
2823
- }
2824
- for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
2825
- if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
2826
- className += " " + compoundClassName;
2827
- }
2828
- }
2829
- return className;
2830
- };
2831
2860
  var pointIcon = createRuntimeFn({ defaultClassName: "", variantClassNames: { type: { start: "_4a4ovk6", end: "_4a4ovk7" } }, defaultVariants: {}, compoundVariants: [] });
2832
2861
  var pointInfoBox = "_4a4ovk1";
2833
2862
  var pointInfoBoxDescription = "_4a4ovk4";
@@ -3108,6 +3137,7 @@ const useGeoLocation = (props) => {
3108
3137
  loading.value = true;
3109
3138
  const watchId = singleGeoWatch.watchPosition(
3110
3139
  async (position) => {
3140
+ console.log("watchPosition success position = ", position);
3111
3141
  const coordinate = position.coords;
3112
3142
  const wgsPoint = [position.coords.longitude, position.coords.latitude];
3113
3143
  const point = await toGcj02(wgsPoint);
@@ -3121,6 +3151,7 @@ const useGeoLocation = (props) => {
3121
3151
  onChange == null ? void 0 : onChange({ position: point, coordinate });
3122
3152
  },
3123
3153
  (error) => {
3154
+ console.log("watchPosition error = ", error);
3124
3155
  loading.value = false;
3125
3156
  errorRef.value = error;
3126
3157
  const position = props == null ? void 0 : props.geoDefaultPosition;
@@ -3487,6 +3518,7 @@ const useMapRecomendPlace = (props) => {
3487
3518
  const { supplier } = useMapSupplier();
3488
3519
  return supplier === "gmap" ? useGmapRecomendPlace(props) : useAmapRecomendPlace(props);
3489
3520
  };
3521
+ const GOOGLE_MAP_ZOOM_CHANGE_DEBOUNCE_TIMEOUT = 50;
3490
3522
  const DEFAULT_ZOOM$1 = 13;
3491
3523
  const useAmapZoom = (props) => {
3492
3524
  var _a, _b, _c;
@@ -3516,13 +3548,16 @@ const useGmapZoom = (props) => {
3516
3548
  zoomRef.value = v;
3517
3549
  (_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v);
3518
3550
  };
3519
- const handleZoomChange = (_, { target }) => {
3520
- const zoom = target.getZoom();
3521
- zoomRef.value = zoom;
3522
- onChange == null ? void 0 : onChange(zoom);
3523
- };
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
+ );
3524
3559
  watchPostEffectForGMapEvent(mapRef, {}, handleZoomChange, [
3525
- "onZoom_change"
3560
+ "onZoom_changed"
3526
3561
  ]);
3527
3562
  return { zoomRef, setZoom };
3528
3563
  };
@@ -3938,12 +3973,14 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
3938
3973
  } = useGeoLocation({
3939
3974
  geoDefaultPosition,
3940
3975
  onLoad: async (value) => {
3976
+ console.log("useGeoLocation onLoad value = ", value);
3941
3977
  await readyPromise;
3942
3978
  centerSource.source = "geo";
3943
3979
  updatePlace(value.position);
3944
3980
  emit("loadGeoLocation", value);
3945
3981
  },
3946
3982
  onLoadDefault: async (value) => {
3983
+ console.log("useGeoLocation onLoadDefault value = ", value);
3947
3984
  await readyPromise;
3948
3985
  const place = await defaultCenterPlacePromise;
3949
3986
  centerSource.source = "geo";
@@ -4037,6 +4074,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
4037
4074
  } = props;
4038
4075
  const title = geoLoading.value ? geoLoadingTitle : !availableRef.value ? unavailableTitle : centerPlace.name;
4039
4076
  const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
4077
+ console.log("BusinessRecomendPlaceMap render geoLoading, isFirstWorkflowRecomendLoadingRef = ", geoLoading.value, isFirstWorkflowRecomendLoadingRef.value);
4040
4078
  return h(HeycarMap, {
4041
4079
  "attrs": {
4042
4080
  "center": centerPoint.value,
package/dist/style.css CHANGED
@@ -116,6 +116,9 @@
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 {
@@ -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",
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