@heycar/heycars-map 0.9.1 → 0.9.3
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/index.cjs +331 -312
- package/dist/index.js +331 -312
- package/dist/src/Demo/DemoBusinessTaxiEnd.d.ts +12 -2
- package/dist/src/api/contants.d.ts +3 -0
- package/dist/src/business-components/StartEndPoint/StartEndPoint.d.ts +1 -0
- package/dist/src/components/Amap/Amap.d.ts +1 -1
- package/dist/src/hooks/useMapGeometry.d.ts +3 -0
- package/dist/src/hooks/useMapLoader.d.ts +1 -1
- package/dist/src/hooks/useMapPlace.d.ts +3 -0
- package/dist/src/hooks/useMapRecomendPlace.d.ts +8 -50
- package/dist/src/hooks/useMapZoom.d.ts +2 -2
- package/dist/src/utils/helper.d.ts +4 -3
- package/dist/src/utils/transform.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export declare const DemoBusinessTaxiEnd: import("vue").DefineComponent<{}, unknown, {
|
|
2
|
-
from: {
|
|
3
|
-
|
|
2
|
+
from: {
|
|
3
|
+
lat: number;
|
|
4
|
+
lng: number;
|
|
5
|
+
name: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
to: {
|
|
9
|
+
lat: number;
|
|
10
|
+
lng: number;
|
|
11
|
+
name: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
4
14
|
contentHeight: number;
|
|
5
15
|
}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Point } from "../types/interface";
|
|
2
2
|
export declare const MAX_ANIMATION_DISTANCE_VW = 100;
|
|
3
|
+
export declare const MIN_ANIMATION_DURATION = 400;
|
|
4
|
+
export declare const ANIMATION_DURATION_FOR_100VW = 800;
|
|
5
|
+
export declare const ANIMATION_DURATION_PER_ZOOM = 400;
|
|
3
6
|
export declare const BEIJIN_POINT: Point;
|
|
4
7
|
export declare const ZINDEX_BUBBLE_LAYER = 50;
|
|
5
8
|
export declare const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
2
2
|
import type { Point } from "../../types/interface";
|
|
3
3
|
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
|
|
4
|
+
language: "en" | "zh";
|
|
4
5
|
type: "start" | "end";
|
|
5
6
|
position: [number, number];
|
|
6
7
|
title?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SetMap } from "../../hooks/useHeycarMap";
|
|
2
2
|
import type { MapEventHandler } from "../../types/mapHelper";
|
|
3
|
-
import type
|
|
3
|
+
import { type VectorMapForeign } from "../../utils/transform";
|
|
4
4
|
export interface AmapProps extends Omit<AMap.MapOptions, "vectorMapForeign"> {
|
|
5
5
|
vectorMapForeign?: VectorMapForeign;
|
|
6
6
|
mapRef?: SetMap<AMap.Map>;
|
|
@@ -2,12 +2,15 @@ import type { Point } from "../types/interface";
|
|
|
2
2
|
export declare const useAmapGeometry: () => {
|
|
3
3
|
apiMapDistance: (from: Point, to: Point) => number | undefined;
|
|
4
4
|
apiMapDistanceToLine: (from: Point, line: Point[]) => number | undefined;
|
|
5
|
+
apiMapIsPointInRing: (point: Point, path: Point[]) => undefined | boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const useGmapGeometry: () => {
|
|
7
8
|
apiMapDistance: (from: Point, to: Point) => number | undefined;
|
|
8
9
|
apiMapDistanceToLine: (from: Point, line: Point[]) => 0 | undefined;
|
|
10
|
+
apiMapIsPointInRing: (point: Point, path: Point[]) => undefined | boolean;
|
|
9
11
|
};
|
|
10
12
|
export declare const useMapGeometry: () => {
|
|
11
13
|
apiMapDistance: (from: Point, to: Point) => number | undefined;
|
|
12
14
|
apiMapDistanceToLine: (from: Point, line: Point[]) => number | undefined;
|
|
15
|
+
apiMapIsPointInRing: (point: Point, path: Point[]) => undefined | boolean;
|
|
13
16
|
};
|
|
@@ -60,7 +60,7 @@ export interface UseMapLoaderProps {
|
|
|
60
60
|
amapSecret?: string;
|
|
61
61
|
amapServiceHost?: string;
|
|
62
62
|
supplier: MapSupplier;
|
|
63
|
-
language
|
|
63
|
+
language: "en" | "zh";
|
|
64
64
|
onChange?: (status: Status) => any;
|
|
65
65
|
}
|
|
66
66
|
export declare const useMapLoader: (props: UseMapLoaderProps) => UseMapLoaderOutput;
|
|
@@ -14,6 +14,7 @@ export declare const useAmapPlace: (props: UseMapPlaceProps) => {
|
|
|
14
14
|
};
|
|
15
15
|
updatePlace: (value: Point) => void;
|
|
16
16
|
setPlace: (value: Place) => void;
|
|
17
|
+
getPlaceByRegeo: ([lng, lat]: Point) => Promise<Place>;
|
|
17
18
|
};
|
|
18
19
|
export declare const useGmapPlace: (props: UseMapPlaceProps) => {
|
|
19
20
|
place: {
|
|
@@ -24,6 +25,7 @@ export declare const useGmapPlace: (props: UseMapPlaceProps) => {
|
|
|
24
25
|
};
|
|
25
26
|
updatePlace: (value: Point) => void;
|
|
26
27
|
setPlace: (value: Place) => void;
|
|
28
|
+
getPlaceByRegeo: ([lng, lat]: Point) => Promise<Place>;
|
|
27
29
|
};
|
|
28
30
|
export declare const useMapPlace: (props: UseMapPlaceProps) => {
|
|
29
31
|
place: {
|
|
@@ -34,4 +36,5 @@ export declare const useMapPlace: (props: UseMapPlaceProps) => {
|
|
|
34
36
|
};
|
|
35
37
|
updatePlace: (value: Point) => void;
|
|
36
38
|
setPlace: (value: Place) => void;
|
|
39
|
+
getPlaceByRegeo: ([lng, lat]: Point) => Promise<Place>;
|
|
37
40
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Ref } from "vue-demi";
|
|
2
1
|
import type { Place, Point, RecommendZonePlaces, Zone } from "../types/interface";
|
|
3
2
|
import { UseMapPlaceProps } from "./useMapPlace";
|
|
4
3
|
interface ValueOfOnChangeRecommendPlace {
|
|
5
4
|
place: Place;
|
|
6
5
|
inputPlace: Place;
|
|
7
6
|
isInZone: boolean;
|
|
7
|
+
isSameZone: boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface UseMapRecomendPlaceProps<C = Record<string, any>> {
|
|
10
|
-
|
|
10
|
+
defaultPoint: Point;
|
|
11
11
|
context?: C;
|
|
12
12
|
emptyPlaceName: string;
|
|
13
13
|
getLimit: (context?: C) => number;
|
|
@@ -15,67 +15,25 @@ export interface UseMapRecomendPlaceProps<C = Record<string, any>> {
|
|
|
15
15
|
onChangePlace?: UseMapPlaceProps["onChange"];
|
|
16
16
|
onChange?: (place: ValueOfOnChangeRecommendPlace) => any;
|
|
17
17
|
}
|
|
18
|
-
export declare const useAmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>) => {
|
|
19
|
-
zoneRef: Ref<Zone | undefined>;
|
|
20
|
-
recomendPlace: {
|
|
21
|
-
lng: number;
|
|
22
|
-
lat: number;
|
|
23
|
-
name: string;
|
|
24
|
-
displayName: string;
|
|
25
|
-
};
|
|
26
|
-
placeCandidates: Ref<{
|
|
27
|
-
lng: number;
|
|
28
|
-
lat: number;
|
|
29
|
-
name: string;
|
|
30
|
-
displayName: string;
|
|
31
|
-
}[]>;
|
|
32
|
-
availableRef: Ref<boolean>;
|
|
33
|
-
isElectedRef: import("vue-demi").ComputedRef<boolean>;
|
|
34
|
-
updateRecommendPlace: (place: Place) => void;
|
|
35
|
-
updatePlaceCandidates: (place: Place) => Promise<ValueOfOnChangeRecommendPlace>;
|
|
36
|
-
updatePlace: (value: Point) => void;
|
|
37
|
-
setPlaceCandidatesAndZone: ({ zone, places: inputPlaceCandidates, }: RecommendZonePlaces) => void;
|
|
38
|
-
};
|
|
39
|
-
export declare const useGmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>) => {
|
|
40
|
-
zoneRef: Ref<Zone | undefined>;
|
|
41
|
-
recomendPlace: {
|
|
42
|
-
lng: number;
|
|
43
|
-
lat: number;
|
|
44
|
-
name: string;
|
|
45
|
-
displayName: string;
|
|
46
|
-
};
|
|
47
|
-
placeCandidates: Ref<{
|
|
48
|
-
lng: number;
|
|
49
|
-
lat: number;
|
|
50
|
-
name: string;
|
|
51
|
-
displayName: string;
|
|
52
|
-
}[]>;
|
|
53
|
-
availableRef: Ref<boolean>;
|
|
54
|
-
isElectedRef: import("vue-demi").ComputedRef<boolean>;
|
|
55
|
-
updateRecommendPlace: (place: Place) => void;
|
|
56
|
-
updatePlaceCandidates: (place: Place) => Promise<ValueOfOnChangeRecommendPlace>;
|
|
57
|
-
updatePlace: (value: Point) => void;
|
|
58
|
-
setPlaceCandidatesAndZone: ({ zone, places }: RecommendZonePlaces) => void;
|
|
59
|
-
};
|
|
60
18
|
export declare const useMapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>) => {
|
|
61
|
-
zoneRef: Ref<Zone | undefined>;
|
|
19
|
+
zoneRef: import("vue-demi").Ref<Zone | undefined>;
|
|
62
20
|
recomendPlace: {
|
|
63
21
|
lng: number;
|
|
64
22
|
lat: number;
|
|
65
23
|
name: string;
|
|
66
24
|
displayName: string;
|
|
67
25
|
};
|
|
68
|
-
placeCandidates: Ref<{
|
|
26
|
+
placeCandidates: import("vue-demi").Ref<{
|
|
69
27
|
lng: number;
|
|
70
28
|
lat: number;
|
|
71
29
|
name: string;
|
|
72
30
|
displayName: string;
|
|
73
31
|
}[]>;
|
|
74
|
-
availableRef: Ref<boolean>;
|
|
32
|
+
availableRef: import("vue-demi").Ref<boolean>;
|
|
75
33
|
isElectedRef: import("vue-demi").ComputedRef<boolean>;
|
|
76
|
-
updateRecommendPlace: (place: Place) => void
|
|
34
|
+
updateRecommendPlace: (place: Place) => Promise<void>;
|
|
77
35
|
updatePlaceCandidates: (place: Place) => Promise<ValueOfOnChangeRecommendPlace>;
|
|
78
|
-
updatePlace: (
|
|
79
|
-
setPlaceCandidatesAndZone: ({ zone, places }: RecommendZonePlaces) => void;
|
|
36
|
+
updatePlace: (point: Point) => Promise<void>;
|
|
37
|
+
setPlaceCandidatesAndZone: ({ zone, places: inputPlaceCandidates, }: RecommendZonePlaces) => void;
|
|
80
38
|
};
|
|
81
39
|
export {};
|
|
@@ -7,7 +7,7 @@ export interface UseMapZoomProps<M = AMap.Map | google.maps.Map> {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const useAmapZoom: (props: UseMapZoomProps<AMap.Map>) => {
|
|
9
9
|
zoomRef: import("vue-demi").Ref<number>;
|
|
10
|
-
setZoom: (v: number) => void;
|
|
10
|
+
setZoom: (v: number, immediate?: boolean) => void;
|
|
11
11
|
};
|
|
12
12
|
export declare const useGmapZoom: (props: UseMapZoomProps<google.maps.Map>) => {
|
|
13
13
|
zoomRef: import("vue-demi").Ref<number>;
|
|
@@ -15,5 +15,5 @@ export declare const useGmapZoom: (props: UseMapZoomProps<google.maps.Map>) => {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const useMapZoom: (props: UseMapZoomProps) => {
|
|
17
17
|
zoomRef: import("vue-demi").Ref<number>;
|
|
18
|
-
setZoom: (v: number) => void;
|
|
18
|
+
setZoom: (v: number, immediate?: boolean) => void;
|
|
19
19
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Place } from "../types/interface";
|
|
1
|
+
import type { Place, Point, Zone } from "../types/interface";
|
|
2
2
|
export declare const isPlace: (place: Partial<Place>) => place is Place;
|
|
3
3
|
export declare const sleep: (milliSeconds: number) => Promise<unknown>;
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
4
|
+
export declare function assertPoint(point: unknown): asserts point is Point;
|
|
5
|
+
export declare function assertAngle(angle: unknown): asserts angle is number | undefined;
|
|
6
|
+
export declare function assertZone(zone: any): asserts zone is Zone;
|
|
6
7
|
export declare const isLatLngLiteral: (value: any) => boolean;
|
|
7
8
|
interface Defered<T> extends Promise<T> {
|
|
8
9
|
state: "pending" | "fulfilled" | "rejected";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
import type { Place, Point } from "../types/interface";
|
|
2
|
+
import type { Place, Point, Zone } from "../types/interface";
|
|
3
3
|
import type { WxGetLocationSuccessResponse } from "../types/wx";
|
|
4
4
|
export declare const vec2lnglat: ([lng, lat]: [number, number]) => google.maps.LatLngLiteral;
|
|
5
5
|
export interface AsteriskItem {
|
|
@@ -19,10 +19,13 @@ export declare const pipeOnlyLastEffect: <P extends any[], R>(fn: (...arg: P) =>
|
|
|
19
19
|
export declare const isPlaceEqual: (p1: Place, p2?: Place) => boolean;
|
|
20
20
|
export declare const isPointEqual: (p1: Point, p2?: Point) => boolean;
|
|
21
21
|
export declare const isGeoPositionEqual: (p1: GeolocationPosition, p2?: GeolocationPosition) => boolean;
|
|
22
|
+
export declare const isZoneEqual: (z1: Zone, z2?: Zone) => boolean;
|
|
22
23
|
interface AmapPlaceName2DisplayNameOptions extends AMap.AddressComponent {
|
|
23
24
|
isChina: boolean;
|
|
24
25
|
}
|
|
25
26
|
export declare const amapPlaceName2DisplayName: (name: string, options: AmapPlaceName2DisplayNameOptions) => string;
|
|
27
|
+
export declare const distanceVw2animationDuration: (distance: number) => number;
|
|
28
|
+
export declare const deltaZoom2animationDuration: (deltaZoom: number) => number;
|
|
26
29
|
export declare const toPlaceType: (maybePlace: {
|
|
27
30
|
displayName?: string;
|
|
28
31
|
name: string;
|