@heycar/heycars-map 0.2.9 → 0.2.11

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 (55) hide show
  1. package/dist/Demo/DemoBusinessTaxiEnd.d.ts +4 -1
  2. package/dist/Demo/DemoBusinessTaxiService.d.ts +2054 -1
  3. package/dist/api/contants.d.ts +2 -0
  4. package/dist/business-components/AddressBox/AddressBox.d.ts +2 -1
  5. package/dist/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -1
  6. package/dist/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
  7. package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +3 -2
  8. package/dist/business-components/DrivingLine/DrivingLine.d.ts +2 -1
  9. package/dist/business-components/DrivingRoute/DrivingRoute.d.ts +2 -1
  10. package/dist/business-components/PassengerCircle/PassengerCircle.d.ts +2 -1
  11. package/dist/business-components/PickupPoints/PickupPoints.d.ts +2 -1
  12. package/dist/business-components/PlaceCircle/PlaceCircle.d.ts +2 -1
  13. package/dist/business-components/StartEndPoint/StartEndPoint.d.ts +2 -1
  14. package/dist/business-components/TaxiCar/TaxiCar.d.ts +2 -1
  15. package/dist/business-components/WalkingLine/WalkingLine.d.ts +2 -1
  16. package/dist/business-components/WalkingRoute/WalkingRoute.d.ts +2 -1
  17. package/dist/business-components/WaveCircle/WaveCircle.d.ts +2 -1
  18. package/dist/components/MapProvider/MapProvider.d.ts +2 -1
  19. package/dist/hooks/useMapAutoComplete.d.ts +3 -3
  20. package/dist/hooks/useMapLog.d.ts +4 -0
  21. package/dist/hooks/useMapPlace.d.ts +3 -3
  22. package/dist/hooks/useMapRecomendPlace.d.ts +6 -6
  23. package/dist/hooks-business/useBusinessMapAutoComplete.d.ts +1 -1
  24. package/dist/hooks-business/useBusinessRecomendPlaceMap.d.ts +2 -2
  25. package/dist/hooks-business/useLagecyMapRecomendPlace.d.ts +2 -2
  26. package/dist/index.cjs +56 -56
  27. package/dist/index.js +1431 -1356
  28. package/dist/types/interface.d.ts +1 -1
  29. package/dist/utils/helper.d.ts +2 -0
  30. package/package.json +2 -2
  31. package/src/App.tsx +3 -3
  32. package/src/Demo/DemoBusinessRecomendPlace.tsx +42 -12
  33. package/src/Demo/DemoBusinessTaxiEnd.tsx +34 -9
  34. package/src/Demo/DemoBusinessTaxiService.tsx +53 -27
  35. package/src/api/contants.ts +3 -0
  36. package/src/business-components/AddressBox/AddressBox.tsx +4 -1
  37. package/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.tsx +8 -3
  38. package/src/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.tsx +21 -11
  39. package/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.tsx +109 -28
  40. package/src/business-components/DrivingLine/DrivingLine.tsx +4 -1
  41. package/src/business-components/DrivingRoute/DrivingRoute.tsx +4 -1
  42. package/src/business-components/PassengerCircle/PassengerCircle.tsx +4 -1
  43. package/src/business-components/PickupPoints/PickupPoints.tsx +3 -1
  44. package/src/business-components/PlaceCircle/PlaceCircle.tsx +4 -1
  45. package/src/business-components/StartEndPoint/StartEndPoint.tsx +9 -6
  46. package/src/business-components/TaxiCar/TaxiCar.tsx +4 -1
  47. package/src/business-components/WalkingLine/WalkingLine.tsx +4 -1
  48. package/src/business-components/WalkingRoute/WalkingRoute.tsx +4 -1
  49. package/src/business-components/WaveCircle/WaveCircle.tsx +4 -1
  50. package/src/components/MapProvider/MapProvider.tsx +4 -1
  51. package/src/hooks/useMapLog.ts +12 -0
  52. package/src/hooks/useMapPlace.ts +8 -3
  53. package/src/types/amap/geocoder.d.ts +2 -0
  54. package/src/types/interface.ts +1 -1
  55. package/src/utils/helper.ts +5 -0
@@ -0,0 +1,2 @@
1
+ import type { Point } from "../types/interface";
2
+ export declare const BEIJIN_POINT: Point;
@@ -1,5 +1,6 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import type { Point } from "../../types/interface";
2
- export interface AddressBoxProps {
3
+ export interface AddressBoxProps extends MapLogProps {
3
4
  type: "box" | "locator";
4
5
  position: Point;
5
6
  title: string;
@@ -2,13 +2,14 @@ import { HeycarMapProps } from "../../components/MapProvider";
2
2
  import type { BusinessRecomendPlaceContext } from "../../hooks-business/useBusinessRecomendPlaceMap";
3
3
  import { UseGeoLocationProps } from "../../hooks/useGeoLocation";
4
4
  import { UseMapDragProps } from "../../hooks/useMapDrag";
5
+ import { MapLogProps } from "../../hooks/useMapLog";
5
6
  import type { UseMapPlaceProps } from "../../hooks/useMapPlace";
6
7
  import { UseMapRecomendPlaceProps } from "../../hooks/useMapRecomendPlace";
7
8
  import type { Point } from "../../types/interface";
8
9
  export interface CenterPlaceSource {
9
10
  source: "default" | "geo" | "drag" | "recomend" | "api";
10
11
  }
11
- export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace"> {
12
+ export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace">, MapLogProps {
12
13
  unavailableTitle: string;
13
14
  recomendDescription: string;
14
15
  noRecomendDescription: string;
@@ -1,6 +1,7 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import type { Place } from "../../types/interface";
2
- export interface BusinessTaxiEndMapProps {
3
- from: Place;
4
- to: Place;
3
+ export interface BusinessTaxiEndMapProps extends MapLogProps {
4
+ from: Partial<Place>;
5
+ to: Partial<Place>;
5
6
  }
6
7
  export declare const BusinessTaxiEndMap: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessTaxiEndMapProps>, 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<BusinessTaxiEndMapProps, Required<BusinessTaxiEndMapProps>>, never, BusinessTaxiEndMapProps, {}>;
@@ -1,13 +1,14 @@
1
1
  import { HeycarMapProps } from "../../components/MapProvider";
2
2
  import { MapMountedProps } from "../../hooks/useMap";
3
+ import { MapLogProps } from "../../hooks/useMapLog";
3
4
  import type { MROP } from "../../hooks/useOverlay";
4
5
  import type { DriverStatus, Place, Point } from "../../types/interface";
5
- export type SectionEndServiceProps = MROP & MapMountedProps & {
6
+ export type SectionEndServiceProps = MROP & MapLogProps & MapMountedProps & {
6
7
  from: Place;
7
8
  to: Place;
8
9
  };
9
10
  export declare const SectionEndService: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<SectionEndServiceProps>, 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<SectionEndServiceProps, Required<SectionEndServiceProps>>, "mapMounted", SectionEndServiceProps, {} | {}>;
10
- export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"> & Required<MROP> & {
11
+ export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"> & Required<MROP> & MapLogProps & {
11
12
  from: Place;
12
13
  to: Place;
13
14
  dispatchingTitle: string;
@@ -1,4 +1,5 @@
1
- export interface DrivingLineProps {
1
+ import { MapLogProps } from "../../hooks/useMapLog";
2
+ export interface DrivingLineProps extends MapLogProps {
2
3
  done?: boolean;
3
4
  path: [number, number][];
4
5
  }
@@ -1,4 +1,5 @@
1
1
  import { UseDrivingRouteProps } from "../../hooks/useDrivingRoute";
2
+ import { MapLogProps } from "../../hooks/useMapLog";
2
3
  import { VNodeChild } from "../../types/helper";
3
4
  import type { Point } from "../../types/interface";
4
5
  export type DrivingRouteRenderProps = {
@@ -7,7 +8,7 @@ export type DrivingRouteRenderProps = {
7
8
  distance: number;
8
9
  duration: number;
9
10
  };
10
- export interface DrivingRouteProps extends UseDrivingRouteProps {
11
+ export interface DrivingRouteProps extends UseDrivingRouteProps, MapLogProps {
11
12
  render?: (props: DrivingRouteRenderProps) => VNodeChild;
12
13
  }
13
14
  export declare const ADrivingRoute: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<DrivingRouteProps>, 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<DrivingRouteProps, Required<DrivingRouteProps>>, never, DrivingRouteProps, {}>;
@@ -1,5 +1,6 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
2
- interface PassengerCircleProps<T> extends MapRegisterOverlayProps<T> {
3
+ interface PassengerCircleProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
3
4
  position: [number, number];
4
5
  size?: "small" | "large";
5
6
  }
@@ -1,5 +1,6 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import type { Place } from "../../types/interface";
2
- export interface PickupPointsProps {
3
+ export interface PickupPointsProps extends MapLogProps {
3
4
  places: Place[];
4
5
  onClick?: (value: Place) => any;
5
6
  }
@@ -1,5 +1,6 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import type { Point } from "../../types/interface";
2
- export interface PlaceCircleProps {
3
+ export interface PlaceCircleProps extends MapLogProps {
3
4
  position: [number, number];
4
5
  label?: string;
5
6
  textAlign?: "left" | "right";
@@ -1,5 +1,6 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
2
- export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
3
+ export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
3
4
  type: "start" | "end";
4
5
  position: [number, number];
5
6
  title?: string;
@@ -1,5 +1,6 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
2
- export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T> {
3
+ export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
3
4
  position: [number, number];
4
5
  angle?: number;
5
6
  title?: string;
@@ -1,4 +1,5 @@
1
- export interface WalkingLineProps {
1
+ import { MapLogProps } from "../../hooks/useMapLog";
2
+ export interface WalkingLineProps extends MapLogProps {
2
3
  path: [number, number][];
3
4
  }
4
5
  export declare const AWalkingLine: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<WalkingLineProps>, 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<WalkingLineProps, Required<WalkingLineProps>>, never, WalkingLineProps, {}>;
@@ -1,10 +1,11 @@
1
+ import { MapLogProps } from "../../hooks/useMapLog";
1
2
  import { UseWalkingRouteProps } from "../../hooks/useWalkingRoute";
2
3
  import { VNodeChild } from "../../types/helper";
3
4
  import type { Point } from "../../types/interface";
4
5
  export type WalkingRouteRenderProps = {
5
6
  path: Point[];
6
7
  };
7
- export interface WalkingRouteProps extends UseWalkingRouteProps {
8
+ export interface WalkingRouteProps extends UseWalkingRouteProps, MapLogProps {
8
9
  render?: (props: WalkingRouteRenderProps) => VNodeChild;
9
10
  }
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, {}>;
@@ -1,4 +1,5 @@
1
- export interface WaveCircleProps {
1
+ import { MapLogProps } from "../../hooks/useMapLog";
2
+ export interface WaveCircleProps extends MapLogProps {
2
3
  position: [number, number];
3
4
  }
4
5
  export declare const AWaveCircle: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<WaveCircleProps>, 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<WaveCircleProps, Required<WaveCircleProps>>, never, WaveCircleProps, {}>;
@@ -1,11 +1,12 @@
1
1
  /// <reference types="google.maps" />
2
2
  import type { SetMap } from "../../hooks/useHeycarMap";
3
3
  import { GmapLoaderProps, UseMapLoaderProps } from "../../hooks/useMapLoader";
4
+ import { MapLogProps } from "../../hooks/useMapLog";
4
5
  import { MapSupplierPayolad } from "../../hooks/useMapSupplier";
5
6
  import { AmapProps } from "../Amap";
6
7
  export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId">;
7
8
  export declare const MapProvider: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<MapProviderProps>, 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<MapProviderProps, Required<MapProviderProps>>, "change", MapProviderProps, {}>;
8
- export interface HeycarMapProps extends Pick<GmapLoaderProps, "fallback" | "loading">, Pick<AmapProps, "center" | "zoom"> {
9
+ export interface HeycarMapProps extends Pick<GmapLoaderProps, "fallback" | "loading">, Pick<AmapProps, "center" | "zoom">, MapLogProps {
9
10
  mapRef?: SetMap<AMap.Map> | SetMap<google.maps.Map>;
10
11
  onDragEnd?: (value: [number, number]) => any;
11
12
  }
@@ -12,7 +12,7 @@ export declare const useAmapAutoComplete: (props: UseMapAutoCompleteProps) => {
12
12
  lat: number;
13
13
  name: string;
14
14
  cityName?: string | undefined;
15
- cityId?: string | undefined;
15
+ countryName?: string | undefined;
16
16
  }[]>;
17
17
  };
18
18
  export declare const useGmapAutoComplete: (props: UseMapAutoCompleteProps) => {
@@ -25,7 +25,7 @@ export declare const useGmapAutoComplete: (props: UseMapAutoCompleteProps) => {
25
25
  lat: number;
26
26
  name: string;
27
27
  cityName?: string | undefined;
28
- cityId?: string | undefined;
28
+ countryName?: string | undefined;
29
29
  }[]>;
30
30
  };
31
31
  export declare const useMapAutoComplete: (props: UseMapAutoCompleteProps) => {
@@ -38,6 +38,6 @@ export declare const useMapAutoComplete: (props: UseMapAutoCompleteProps) => {
38
38
  lat: number;
39
39
  name: string;
40
40
  cityName?: string | undefined;
41
- cityId?: string | undefined;
41
+ countryName?: string | undefined;
42
42
  }[]>;
43
43
  };
@@ -0,0 +1,4 @@
1
+ export interface MapLogProps {
2
+ log?: boolean;
3
+ }
4
+ export declare const useMapLog: <P extends MapLogProps>(props: P, name: string) => void;
@@ -10,7 +10,7 @@ export declare const useAmapPlace: (props: UseMapPlaceProps) => {
10
10
  lat: number;
11
11
  name: string;
12
12
  cityName?: string | undefined;
13
- cityId?: string | undefined;
13
+ countryName?: string | undefined;
14
14
  };
15
15
  updatePlace: () => void;
16
16
  };
@@ -20,7 +20,7 @@ export declare const useGmapPlace: (props: UseMapPlaceProps) => {
20
20
  lat: number;
21
21
  name: string;
22
22
  cityName?: string | undefined;
23
- cityId?: string | undefined;
23
+ countryName?: string | undefined;
24
24
  };
25
25
  updatePlace: () => void;
26
26
  };
@@ -30,7 +30,7 @@ export declare const useMapPlace: (props: UseMapPlaceProps) => {
30
30
  lat: number;
31
31
  name: string;
32
32
  cityName?: string | undefined;
33
- cityId?: string | undefined;
33
+ countryName?: string | undefined;
34
34
  };
35
35
  updatePlace: () => void;
36
36
  };
@@ -15,14 +15,14 @@ export declare const useAmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C
15
15
  lat: number;
16
16
  name: string;
17
17
  cityName?: string | undefined;
18
- cityId?: string | undefined;
18
+ countryName?: string | undefined;
19
19
  };
20
20
  placeCandidates: Ref<{
21
21
  lng: number;
22
22
  lat: number;
23
23
  name: string;
24
24
  cityName?: string | undefined;
25
- cityId?: string | undefined;
25
+ countryName?: string | undefined;
26
26
  }[]>;
27
27
  availableRef: Ref<boolean>;
28
28
  updateRecomandPlace: () => void;
@@ -34,14 +34,14 @@ export declare const useGmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C
34
34
  lat: number;
35
35
  name: string;
36
36
  cityName?: string | undefined;
37
- cityId?: string | undefined;
37
+ countryName?: string | undefined;
38
38
  };
39
39
  placeCandidates: Ref<{
40
40
  lng: number;
41
41
  lat: number;
42
42
  name: string;
43
43
  cityName?: string | undefined;
44
- cityId?: string | undefined;
44
+ countryName?: string | undefined;
45
45
  }[]>;
46
46
  availableRef: Ref<boolean>;
47
47
  updateRecomandPlace: () => void;
@@ -53,14 +53,14 @@ export declare const useMapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>
53
53
  lat: number;
54
54
  name: string;
55
55
  cityName?: string | undefined;
56
- cityId?: string | undefined;
56
+ countryName?: string | undefined;
57
57
  };
58
58
  placeCandidates: Ref<{
59
59
  lng: number;
60
60
  lat: number;
61
61
  name: string;
62
62
  cityName?: string | undefined;
63
- cityId?: string | undefined;
63
+ countryName?: string | undefined;
64
64
  }[]>;
65
65
  availableRef: Ref<boolean>;
66
66
  updateRecomandPlace: () => void;
@@ -10,7 +10,7 @@ export declare const useBusinessMapAutoComplete: (props: UseBusinessMapAutoCompl
10
10
  lat: number;
11
11
  name: string;
12
12
  cityName?: string | undefined;
13
- cityId?: string | undefined;
13
+ countryName?: string | undefined;
14
14
  }[]>;
15
15
  setKeyword: (value: string) => void;
16
16
  setCity: (value: import("..").City) => void;
@@ -12,14 +12,14 @@ export declare const useBusinessRecomendPlaceMap: () => {
12
12
  lat: number;
13
13
  name: string;
14
14
  cityName?: string | undefined;
15
- cityId?: string | undefined;
15
+ countryName?: string | undefined;
16
16
  };
17
17
  placeCandidates: import("vue-demi").Ref<{
18
18
  lng: number;
19
19
  lat: number;
20
20
  name: string;
21
21
  cityName?: string | undefined;
22
- cityId?: string | undefined;
22
+ countryName?: string | undefined;
23
23
  }[]>;
24
24
  panTo: (value: Point) => void;
25
25
  setCenterPlaceByRecomand: (value: Point) => void;
@@ -39,7 +39,7 @@ export declare const useLagecyMapRecomendPlace: (props: UseLagecyMapRecomendPlac
39
39
  lat: number;
40
40
  name: string;
41
41
  cityName?: string | undefined;
42
- cityId?: string | undefined;
42
+ countryName?: string | undefined;
43
43
  };
44
44
  centerPoint: import("vue-demi").ComputedRef<Point>;
45
45
  placeCandidates: import("vue-demi").Ref<{
@@ -47,7 +47,7 @@ export declare const useLagecyMapRecomendPlace: (props: UseLagecyMapRecomendPlac
47
47
  lat: number;
48
48
  name: string;
49
49
  cityName?: string | undefined;
50
- cityId?: string | undefined;
50
+ countryName?: string | undefined;
51
51
  }[]>;
52
52
  setCenterPlaceByRecomand: (point: Point) => void;
53
53
  setCenterByPlace: (place: Place) => void;