@heycar/heycars-map 0.1.7 → 0.1.9
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/business-components/WalkingRoute/WalkingRoute.d.ts +13 -0
- package/dist/business-components/WalkingRoute/index.d.ts +1 -0
- package/dist/components/Demo/HeycarDemo.d.ts +1 -0
- package/dist/components/Demo/SearchDemo.d.ts +1 -0
- package/dist/components/Demo/country.d.ts +5 -0
- package/dist/components/Demo/searchResult.d.ts +8 -0
- package/dist/hooks/useGeoLocation.d.ts +8 -4
- package/dist/hooks/useMapAutoComplete.d.ts +42 -0
- package/dist/hooks/useMapCityBound.d.ts +10 -0
- package/dist/hooks/useMapPlace.d.ts +3 -0
- package/dist/hooks/useMapRecomendPlace.d.ts +6 -0
- package/dist/hooks/useWalkingRoute.d.ts +9 -0
- package/dist/hooks-business/useBusinessMapAutoComplete.d.ts +17 -0
- package/dist/hooks-business/useBusinessMapRecomendPlace.d.ts +17 -2
- package/dist/index.cjs +52 -52
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1223 -987
- package/dist/types/interface.d.ts +14 -0
- package/dist/utils/transform.d.ts +1 -0
- package/package.json +1 -1
- package/src/App.tsx +1 -0
- package/src/business-components/WalkingRoute/WalkingRoute.tsx +48 -0
- package/src/business-components/WalkingRoute/index.ts +1 -0
- package/src/components/Demo/HeycarDemo.tsx +65 -19
- package/src/components/Demo/SearchDemo.tsx +167 -0
- package/src/components/Demo/country.ts +4179 -0
- package/src/components/Demo/searchResult.ts +8235 -0
- package/src/hooks/useDrivingRoute.ts +1 -1
- package/src/hooks/useGeoLocation.ts +37 -24
- package/src/hooks/useMapAutoComplete.ts +116 -0
- package/src/hooks/useMapCityBound.ts +52 -0
- package/src/hooks/useMapPlace.ts +14 -5
- package/src/hooks/useWalkingRoute.ts +70 -0
- package/src/hooks-business/useBusinessMapAutoComplete.ts +15 -0
- package/src/hooks-business/useBusinessMapRecomendPlace.ts +45 -13
- package/src/index.ts +3 -1
- package/src/types/amap/place.d.ts +1 -1
- package/src/types/amap/walking.d.ts +3 -1
- package/src/types/interface.ts +16 -0
- package/src/utils/transform.ts +13 -0
- package/todo.md +3 -0
|
@@ -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, {}>;
|
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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,11 +411,13 @@ 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
|
};
|
|
415
416
|
placeCandidates: Ref<{
|
|
416
417
|
lng: number;
|
|
417
418
|
lat: number;
|
|
418
419
|
name: string;
|
|
420
|
+
cityName?: string | undefined;
|
|
419
421
|
}[]>;
|
|
420
422
|
updateRecomandPlace: () => void;
|
|
421
423
|
updatePlace: () => void;
|
|
@@ -425,11 +427,13 @@ export declare const useGmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<g
|
|
|
425
427
|
lng: number;
|
|
426
428
|
lat: number;
|
|
427
429
|
name: string;
|
|
430
|
+
cityName?: string | undefined;
|
|
428
431
|
};
|
|
429
432
|
placeCandidates: Ref<{
|
|
430
433
|
lng: number;
|
|
431
434
|
lat: number;
|
|
432
435
|
name: string;
|
|
436
|
+
cityName?: string | undefined;
|
|
433
437
|
}[]>;
|
|
434
438
|
updateRecomandPlace: () => void;
|
|
435
439
|
updatePlace: () => void;
|
|
@@ -834,11 +838,13 @@ export declare const useMapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<{
|
|
|
834
838
|
lng: number;
|
|
835
839
|
lat: number;
|
|
836
840
|
name: string;
|
|
841
|
+
cityName?: string | undefined;
|
|
837
842
|
};
|
|
838
843
|
placeCandidates: Ref<{
|
|
839
844
|
lng: number;
|
|
840
845
|
lat: number;
|
|
841
846
|
name: string;
|
|
847
|
+
cityName?: string | undefined;
|
|
842
848
|
}[]>;
|
|
843
849
|
updateRecomandPlace: () => void;
|
|
844
850
|
updatePlace: () => void;
|
|
@@ -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,17 @@
|
|
|
1
|
+
import type { MapShallowRef } from "../types/interface";
|
|
2
|
+
export interface UseBusinessMapAutoCompleteProps {
|
|
3
|
+
mapRef: MapShallowRef;
|
|
4
|
+
defaultCityName: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const useBusinessMapAutoComplete: (props: UseBusinessMapAutoCompleteProps) => {
|
|
7
|
+
autoCompletePlaces: import("vue").Ref<{
|
|
8
|
+
placeId?: string | undefined;
|
|
9
|
+
description: string;
|
|
10
|
+
lng: number;
|
|
11
|
+
lat: number;
|
|
12
|
+
name: string;
|
|
13
|
+
cityName?: string | undefined;
|
|
14
|
+
}[]>;
|
|
15
|
+
setKeyword: (value: string) => void;
|
|
16
|
+
setCity: (value: import("../types/interface").City) => void;
|
|
17
|
+
};
|
|
@@ -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,18 +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
|
-
|
|
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>;
|
|
28
41
|
placeCandidates: import("vue-demi").Ref<{
|
|
29
42
|
lng: number;
|
|
30
43
|
lat: number;
|
|
31
44
|
name: string;
|
|
45
|
+
cityName?: string | undefined;
|
|
32
46
|
}[]>;
|
|
47
|
+
setCenterPlaceByRecomand: (point: Point) => void;
|
|
33
48
|
};
|
|
34
49
|
export {};
|