@heycar/heycars-map 0.1.6 → 0.1.8

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.
Files changed (43) hide show
  1. package/dist/business-components/PickupPoints/PickupPoints.d.ts +2 -2
  2. package/dist/business-components/WalkingRoute/WalkingRoute.d.ts +13 -0
  3. package/dist/business-components/WalkingRoute/index.d.ts +1 -0
  4. package/dist/components/Demo/HeycarDemo.d.ts +1 -0
  5. package/dist/components/Demo/SearchDemo.d.ts +1 -0
  6. package/dist/components/Demo/country.d.ts +5 -0
  7. package/dist/components/Demo/searchResult.d.ts +8 -0
  8. package/dist/hooks/useGeoLocation.d.ts +8 -4
  9. package/dist/hooks/useMapAutoComplete.d.ts +42 -0
  10. package/dist/hooks/useMapCityBound.d.ts +10 -0
  11. package/dist/hooks/useMapPlace.d.ts +3 -0
  12. package/dist/hooks/useMapRecomendPlace.d.ts +21 -0
  13. package/dist/hooks/useWalkingRoute.d.ts +9 -0
  14. package/dist/hooks-business/useBusinessMapAutoComplete.d.ts +18 -0
  15. package/dist/hooks-business/useBusinessMapRecomendPlace.d.ts +22 -2
  16. package/dist/index.cjs +52 -52
  17. package/dist/index.js +813 -792
  18. package/dist/types/interface.d.ts +14 -0
  19. package/dist/utils/transform.d.ts +1 -0
  20. package/package.json +2 -2
  21. package/src/App.tsx +1 -0
  22. package/src/business-components/PickupPoints/PickupPoints.tsx +5 -4
  23. package/src/business-components/WalkingRoute/WalkingRoute.tsx +48 -0
  24. package/src/business-components/WalkingRoute/index.ts +1 -0
  25. package/src/components/Demo/HeycarDemo.tsx +59 -10
  26. package/src/components/Demo/SearchDemo.tsx +167 -0
  27. package/src/components/Demo/country.ts +4179 -0
  28. package/src/components/Demo/searchResult.ts +8235 -0
  29. package/src/components/GmapAdvancedMarkerView/GmapAdvancedMarkerView.ts +0 -1
  30. package/src/hooks/useDrivingRoute.ts +1 -1
  31. package/src/hooks/useGeoLocation.ts +21 -17
  32. package/src/hooks/useMapAutoComplete.ts +116 -0
  33. package/src/hooks/useMapCityBound.ts +52 -0
  34. package/src/hooks/useMapPlace.ts +14 -11
  35. package/src/hooks/useMapRecomendPlace.ts +7 -9
  36. package/src/hooks/useWalkingRoute.ts +70 -0
  37. package/src/hooks-business/useBusinessMapAutoComplete.ts +16 -0
  38. package/src/hooks-business/useBusinessMapRecomendPlace.ts +47 -14
  39. package/src/types/amap/place.d.ts +1 -1
  40. package/src/types/amap/walking.d.ts +3 -1
  41. package/src/types/interface.ts +16 -0
  42. package/src/utils/transform.ts +13 -0
  43. package/todo.md +3 -0
@@ -1,5 +1,5 @@
1
+ import type { Place } from "../../types/interface";
1
2
  export interface PickupPointsProps {
2
- positions: [number, number][];
3
- labels: string[];
3
+ places: Place[];
4
4
  }
5
5
  export declare const PickupPoints: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<PickupPointsProps>, 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<PickupPointsProps, Required<PickupPointsProps>>, never, PickupPointsProps, {}>;
@@ -0,0 +1,13 @@
1
+ import { UseWalkingRouteProps } from "../../hooks/useWalkingRoute";
2
+ import { VNodeChild } from "../../types/helper";
3
+ import type { Point } from "../../types/interface";
4
+ export type WalkingRouteRenderProps = {
5
+ path: Point[];
6
+ angle?: number;
7
+ };
8
+ export interface WalkingRouteProps extends UseWalkingRouteProps {
9
+ render?: (props: WalkingRouteRenderProps) => VNodeChild;
10
+ }
11
+ export declare const AWalkingRoute: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<WalkingRouteProps>, 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<WalkingRouteProps, Required<WalkingRouteProps>>, never, WalkingRouteProps, {}>;
12
+ export declare const GWalkingRoute: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<WalkingRouteProps>, 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<WalkingRouteProps, Required<WalkingRouteProps>>, never, WalkingRouteProps, {}>;
13
+ export declare const WalkingRoute: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<WalkingRouteProps>, 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<WalkingRouteProps, Required<WalkingRouteProps>>, never, WalkingRouteProps, {}>;
@@ -0,0 +1 @@
1
+ export * from "./WalkingRoute";
@@ -1,2 +1,3 @@
1
1
  export declare const HeycarDemo: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<unknown>, 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<unknown, Required<unknown>>, never, unknown, {}>;
2
2
  export declare const SomePage: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<unknown>, 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<unknown, Required<unknown>>, never, unknown, {}>;
3
+ export declare const SomeHomePage: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<unknown>, 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<unknown, Required<unknown>>, never, unknown, {}>;
@@ -0,0 +1 @@
1
+ export declare const SearchDemo: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<unknown>, 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<unknown, Required<unknown>>, never, unknown, {}>;
@@ -0,0 +1,5 @@
1
+ export declare const countries: Record<string, string>;
2
+ export declare const citiesWithCountry: {
3
+ name: string;
4
+ country: string;
5
+ }[];
@@ -0,0 +1,8 @@
1
+ /// <reference types="google.maps" />
2
+ export type Result = {
3
+ name: string;
4
+ country: string;
5
+ bound: google.maps.LatLngBoundsLiteral | null;
6
+ };
7
+ export declare const searchResult: Result[];
8
+ export declare const breakIdx = 1522;
@@ -5,11 +5,15 @@ export interface UseGeoLocationProps {
5
5
  position: Point;
6
6
  coordinate: GeolocationCoordinates;
7
7
  }) => any;
8
+ onLoad?: (value: {
9
+ position: Point;
10
+ coordinate: GeolocationCoordinates;
11
+ }) => any;
8
12
  }
9
13
  export declare const useGeoLocation: (props: UseGeoLocationProps) => {
10
- errorRef: import("vue-demi").Ref<GeolocationPositionError | undefined>;
11
- positionRef: import("vue-demi").Ref<[number, number]>;
12
- coordinateRef: import("vue-demi").Ref<{
14
+ geoError: import("vue-demi").Ref<GeolocationPositionError | undefined>;
15
+ geoPosition: import("vue-demi").Ref<[number, number]>;
16
+ geoCoordinate: import("vue-demi").Ref<{
13
17
  readonly accuracy: number;
14
18
  readonly altitude: number | null;
15
19
  readonly altitudeAccuracy: number | null;
@@ -18,5 +22,5 @@ export declare const useGeoLocation: (props: UseGeoLocationProps) => {
18
22
  readonly longitude: number;
19
23
  readonly speed: number | null;
20
24
  }>;
21
- loading: import("vue-demi").Ref<boolean>;
25
+ geoLoading: import("vue-demi").Ref<boolean>;
22
26
  };
@@ -0,0 +1,42 @@
1
+ /// <reference types="google.maps" />
2
+ import type { City, MapShallowRef } from "../types/interface";
3
+ export interface UseMapAutoCompleteProps<M = AMap.Map | google.maps.Map> {
4
+ mapRef: MapShallowRef<M>;
5
+ city: City;
6
+ }
7
+ export declare const useAmapAutoComplete: (props: UseMapAutoCompleteProps<AMap.Map>) => {
8
+ setKeyword: (value: string) => void;
9
+ setCity: (value: City) => void;
10
+ autoCompletePlaces: import("vue-demi").Ref<{
11
+ placeId?: string | undefined;
12
+ description: string;
13
+ lng: number;
14
+ lat: number;
15
+ name: string;
16
+ cityName?: string | undefined;
17
+ }[]>;
18
+ };
19
+ export declare const useGmapAutoComplete: (props: UseMapAutoCompleteProps<google.maps.Map>) => {
20
+ setKeyword: (value: string) => void;
21
+ setCity: (value: City) => void;
22
+ autoCompletePlaces: import("vue-demi").Ref<{
23
+ placeId?: string | undefined;
24
+ description: string;
25
+ lng: number;
26
+ lat: number;
27
+ name: string;
28
+ cityName?: string | undefined;
29
+ }[]>;
30
+ };
31
+ export declare const useMapAutoComplete: (props: UseMapAutoCompleteProps) => {
32
+ setKeyword: (value: string) => void;
33
+ setCity: (value: City) => void;
34
+ autoCompletePlaces: import("vue-demi").Ref<{
35
+ placeId?: string | undefined;
36
+ description: string;
37
+ lng: number;
38
+ lat: number;
39
+ name: string;
40
+ cityName?: string | undefined;
41
+ }[]>;
42
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="google.maps" />
2
+ import type { City, MapShallowRef } from "../types/interface";
3
+ export interface UseMapCityBoundProps<M = AMap.Map | google.maps.Map> {
4
+ mapRef: MapShallowRef<M>;
5
+ cityName: string;
6
+ onChange?: (value: City) => any;
7
+ }
8
+ export declare const useGmapBoundCity: (props: UseMapCityBoundProps) => City;
9
+ export declare const useAmapBoundCity: (props: UseMapCityBoundProps) => City;
10
+ export declare const useMapBoundCity: (props: UseMapCityBoundProps) => City;
@@ -11,6 +11,7 @@ export declare const useAmapPlace: (props: UseMapPlaceProps<AMap.Map>) => {
11
11
  lng: number;
12
12
  lat: number;
13
13
  name: string;
14
+ cityName?: string | undefined;
14
15
  };
15
16
  updatePlace: () => void;
16
17
  };
@@ -19,6 +20,7 @@ export declare const useGmapPlace: (props: UseMapPlaceProps<google.maps.Map>) =>
19
20
  lng: number;
20
21
  lat: number;
21
22
  name: string;
23
+ cityName?: string | undefined;
22
24
  };
23
25
  updatePlace: () => void;
24
26
  };
@@ -27,6 +29,7 @@ export declare const useMapPlace: (props: UseMapPlaceProps) => {
27
29
  lng: number;
28
30
  lat: number;
29
31
  name: string;
32
+ cityName?: string | undefined;
30
33
  };
31
34
  updatePlace: () => void;
32
35
  };
@@ -411,7 +411,14 @@ export declare const useAmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<{
411
411
  lng: number;
412
412
  lat: number;
413
413
  name: string;
414
+ cityName?: string | undefined;
414
415
  };
416
+ placeCandidates: Ref<{
417
+ lng: number;
418
+ lat: number;
419
+ name: string;
420
+ cityName?: string | undefined;
421
+ }[]>;
415
422
  updateRecomandPlace: () => void;
416
423
  updatePlace: () => void;
417
424
  };
@@ -420,7 +427,14 @@ export declare const useGmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<g
420
427
  lng: number;
421
428
  lat: number;
422
429
  name: string;
430
+ cityName?: string | undefined;
423
431
  };
432
+ placeCandidates: Ref<{
433
+ lng: number;
434
+ lat: number;
435
+ name: string;
436
+ cityName?: string | undefined;
437
+ }[]>;
424
438
  updateRecomandPlace: () => void;
425
439
  updatePlace: () => void;
426
440
  };
@@ -824,7 +838,14 @@ export declare const useMapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<{
824
838
  lng: number;
825
839
  lat: number;
826
840
  name: string;
841
+ cityName?: string | undefined;
827
842
  };
843
+ placeCandidates: Ref<{
844
+ lng: number;
845
+ lat: number;
846
+ name: string;
847
+ cityName?: string | undefined;
848
+ }[]>;
828
849
  updateRecomandPlace: () => void;
829
850
  updatePlace: () => void;
830
851
  };
@@ -0,0 +1,9 @@
1
+ import { ShallowRef } from "vue-demi";
2
+ import type { Point } from "../types/interface";
3
+ export interface UseWalkingRouteProps {
4
+ from: Point;
5
+ to: Point;
6
+ }
7
+ export declare const useAWalkingRoute: (props: UseWalkingRouteProps) => ShallowRef<Point[]>;
8
+ export declare const useGWalkingRoute: (props: UseWalkingRouteProps) => ShallowRef<Point[]>;
9
+ export declare const useWalkingRoute: (props: UseWalkingRouteProps) => ShallowRef<Point[]>;
@@ -0,0 +1,18 @@
1
+ import type { MapShallowRef } from "../types/interface";
2
+ export declare const x = 1;
3
+ export interface UseBusinessMapAutoCompleteProps {
4
+ mapRef: MapShallowRef;
5
+ defaultCityName: string;
6
+ }
7
+ export declare const useBusinessMapAutoComplete: (props: UseBusinessMapAutoCompleteProps) => {
8
+ autoCompletePlaces: import("vue").Ref<{
9
+ placeId?: string | undefined;
10
+ description: string;
11
+ lng: number;
12
+ lat: number;
13
+ name: string;
14
+ cityName?: string | undefined;
15
+ }[]>;
16
+ setKeyword: (value: string) => void;
17
+ setCity: (value: import("../types/interface").City) => void;
18
+ };
@@ -5,11 +5,13 @@ import type { UseMapPlaceProps } from "../hooks/useMapPlace";
5
5
  import { UseMapRecomendPlaceProps } from "../hooks/useMapRecomendPlace";
6
6
  import type { Point } from "../types/interface";
7
7
  interface CenterPlaceSource {
8
- source: "geo" | "drag" | "recomend";
8
+ source: "default" | "geo" | "drag" | "recomend" | "api";
9
9
  }
10
10
  export interface UseBusinessMapRecomendPlaceProps extends Pick<UseMapRecomendPlaceProps<AMap.Map | google.maps.Map, CenterPlaceSource>, "getRecomendPlace" | "mapRef"> {
11
+ defaultCenterPoint?: Point;
11
12
  recomendPlaceGeoLimit: number;
12
13
  recomendPlaceDragLimit: number;
14
+ onLoadGeoLocation?: UseGeoLocationProps["onLoad"];
13
15
  onChangeByDrag?: UseMapDragProps["onChange"];
14
16
  onChangeGeoLocation?: UseGeoLocationProps["onChange"];
15
17
  onChangePlace?: UseMapPlaceProps["onChange"];
@@ -17,13 +19,31 @@ export interface UseBusinessMapRecomendPlaceProps extends Pick<UseMapRecomendPla
17
19
  }
18
20
  export declare const useBusinessMapRecomendPlace: (props: UseBusinessMapRecomendPlaceProps) => {
19
21
  isDragging: import("vue-demi").Ref<boolean>;
20
- isGeoLoading: import("vue-demi").Ref<boolean>;
22
+ geoLoading: import("vue-demi").Ref<boolean>;
21
23
  geoError: import("vue-demi").Ref<GeolocationPositionError | undefined>;
24
+ geoPosition: import("vue-demi").Ref<[number, number]>;
25
+ geoCoordinate: import("vue-demi").Ref<{
26
+ readonly accuracy: number;
27
+ readonly altitude: number | null;
28
+ readonly altitudeAccuracy: number | null;
29
+ readonly heading: number | null;
30
+ readonly latitude: number;
31
+ readonly longitude: number;
32
+ readonly speed: number | null;
33
+ }>;
22
34
  centerPlace: {
23
35
  lng: number;
24
36
  lat: number;
25
37
  name: string;
38
+ cityName?: string | undefined;
26
39
  };
27
40
  centerPoint: import("vue-demi").ComputedRef<Point>;
41
+ placeCandidates: import("vue-demi").Ref<{
42
+ lng: number;
43
+ lat: number;
44
+ name: string;
45
+ cityName?: string | undefined;
46
+ }[]>;
47
+ setCenterPlaceByRecomand: (point: Point) => void;
28
48
  };
29
49
  export {};