@heycar/heycars-map 0.2.10 → 0.2.12
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/Demo/DemoBusinessTaxiService.d.ts +2054 -1
- package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +1 -1
- package/dist/business-components/DrivingLine/DrivingLine.d.ts +2 -1
- package/dist/business-components/DrivingRoute/DrivingRoute.d.ts +2 -1
- package/dist/business-components/PlaceCircle/PlaceCircle.d.ts +2 -1
- package/dist/business-components/StartEndPoint/StartEndPoint.d.ts +2 -1
- package/dist/business-components/TaxiCar/TaxiCar.d.ts +2 -1
- package/dist/business-components/WalkingLine/WalkingLine.d.ts +2 -1
- package/dist/business-components/WalkingRoute/WalkingRoute.d.ts +2 -1
- package/dist/business-components/WaveCircle/WaveCircle.d.ts +2 -1
- package/dist/hooks-business/useBusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/index.cjs +38 -38
- package/dist/index.js +1424 -1364
- package/package.json +1 -1
- package/src/App.tsx +3 -3
- package/src/Demo/DemoBusinessRecomendPlace.tsx +9 -30
- package/src/Demo/DemoBusinessTaxiService.tsx +53 -27
- package/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.tsx +7 -3
- package/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.tsx +106 -28
- package/src/business-components/DrivingLine/DrivingLine.tsx +4 -1
- package/src/business-components/DrivingRoute/DrivingRoute.tsx +4 -1
- package/src/business-components/PlaceCircle/PlaceCircle.tsx +4 -1
- package/src/business-components/StartEndPoint/StartEndPoint.tsx +9 -6
- package/src/business-components/TaxiCar/TaxiCar.tsx +4 -1
- package/src/business-components/WalkingLine/WalkingLine.tsx +4 -1
- package/src/business-components/WalkingRoute/WalkingRoute.tsx +4 -1
- package/src/business-components/WaveCircle/WaveCircle.tsx +4 -1
- package/src/hooks-business/useBusinessRecomendPlaceMap.ts +5 -5
- package/todo.md +1 -3
|
@@ -3,22 +3,24 @@ import imgEndPoint from "../../assets/icons/svg/end-point.svg";
|
|
|
3
3
|
import imgStartPoint from "../../assets/icons/svg/start-point.svg";
|
|
4
4
|
import { AmapMarker } from "../../components/AmapMarker";
|
|
5
5
|
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView/GmapAdvancedMarkerView";
|
|
6
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
6
7
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
7
8
|
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
8
|
-
import { createElement,
|
|
9
|
+
import { createElement, defineSetup } from "../../types/helper";
|
|
9
10
|
import { createDom } from "../../utils/dom";
|
|
10
11
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform";
|
|
11
12
|
import * as css from "./StartEndPoint.css";
|
|
12
13
|
|
|
13
|
-
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T
|
|
14
|
+
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
14
15
|
type: "start" | "end";
|
|
15
16
|
position: [number, number];
|
|
16
17
|
title?: string;
|
|
17
18
|
description?: string;
|
|
18
19
|
}
|
|
19
|
-
export const AStartEndPoint =
|
|
20
|
+
export const AStartEndPoint = defineSetup(function AStartEndPoint(
|
|
20
21
|
props: StartEndPointProps<AmapOverlay>
|
|
21
22
|
) {
|
|
23
|
+
useMapLog(props, "AStartEndPoint");
|
|
22
24
|
const contentRef = computed(() => {
|
|
23
25
|
const icon = props.type === "start" ? imgStartPoint : imgEndPoint;
|
|
24
26
|
const descriptionRow = !props.description
|
|
@@ -57,11 +59,12 @@ export const AStartEndPoint = defineLagecySetup(function AStartEndPoint(
|
|
|
57
59
|
anchor={"bottom-center"}
|
|
58
60
|
/>
|
|
59
61
|
);
|
|
60
|
-
})
|
|
62
|
+
});
|
|
61
63
|
|
|
62
|
-
export const GStartEndPoint =
|
|
64
|
+
export const GStartEndPoint = defineSetup(function GStartEndPoint(
|
|
63
65
|
props: StartEndPointProps<GmapOverlay>
|
|
64
66
|
) {
|
|
67
|
+
useMapLog(props, "GStartEndPoint");
|
|
65
68
|
const contentRef = computed(() => {
|
|
66
69
|
const icon = props.type === "start" ? imgStartPoint : imgEndPoint;
|
|
67
70
|
const descriptionRow = !props.description
|
|
@@ -105,7 +108,7 @@ export const GStartEndPoint = defineLagecySetup(function GStartEndPoint(
|
|
|
105
108
|
/>
|
|
106
109
|
);
|
|
107
110
|
};
|
|
108
|
-
})
|
|
111
|
+
});
|
|
109
112
|
|
|
110
113
|
export const StartEndPoint = defineSetup(function StartEndPoint(
|
|
111
114
|
props: StartEndPointProps<AmapOverlay> | StartEndPointProps<GmapOverlay>
|
|
@@ -2,6 +2,7 @@ import { computed } from "vue-demi";
|
|
|
2
2
|
import imgTaxicar from "../../assets/icons/svg/taxi-car.svg";
|
|
3
3
|
import { AmapMarker } from "../../components/AmapMarker";
|
|
4
4
|
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView/GmapAdvancedMarkerView";
|
|
5
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
5
6
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
6
7
|
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
7
8
|
import { createElement, defineSetup } from "../../types/helper";
|
|
@@ -9,12 +10,13 @@ import { createDom } from "../../utils/dom";
|
|
|
9
10
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform";
|
|
10
11
|
import * as css from "./TaxiCar.css";
|
|
11
12
|
|
|
12
|
-
export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T
|
|
13
|
+
export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
13
14
|
position: [number, number];
|
|
14
15
|
angle?: number;
|
|
15
16
|
title?: string;
|
|
16
17
|
}
|
|
17
18
|
export const ATaxiCar = defineSetup(function ATaxiCar(props: TaxiCarProps<AmapOverlay>) {
|
|
19
|
+
useMapLog(props, "ATaxiCar");
|
|
18
20
|
const contentRef = computed(() => {
|
|
19
21
|
const titleRow = !props.title
|
|
20
22
|
? ""
|
|
@@ -45,6 +47,7 @@ export const ATaxiCar = defineSetup(function ATaxiCar(props: TaxiCarProps<AmapOv
|
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
export const GTaxiCar = defineSetup(function GTaxiCar(props: TaxiCarProps<GmapOverlay>) {
|
|
50
|
+
useMapLog(props, "GTaxiCar");
|
|
48
51
|
const contentRef = computed(() => {
|
|
49
52
|
const titleRow = !props.title
|
|
50
53
|
? ""
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { computed } from "vue-demi";
|
|
2
2
|
import { AmapPolyline } from "../../components/AmapPolyline";
|
|
3
3
|
import { GmapPolyline } from "../../components/GmapPolyline";
|
|
4
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
4
5
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
5
6
|
import { createElement, defineSetup } from "../../types/helper";
|
|
6
7
|
import { vec2lnglat } from "../../utils/transform";
|
|
7
8
|
|
|
8
|
-
export interface WalkingLineProps {
|
|
9
|
+
export interface WalkingLineProps extends MapLogProps {
|
|
9
10
|
path: [number, number][];
|
|
10
11
|
}
|
|
11
12
|
export const AWalkingLine = defineSetup(function AWalkingLine(props: WalkingLineProps) {
|
|
13
|
+
useMapLog(props, "AWalkingLine");
|
|
12
14
|
return () => {
|
|
13
15
|
const { path } = props;
|
|
14
16
|
if (path.length === 0) return null;
|
|
@@ -30,6 +32,7 @@ export const AWalkingLine = defineSetup(function AWalkingLine(props: WalkingLine
|
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
export const GWalkingLine = defineSetup(function GWalkingLine(props: WalkingLineProps) {
|
|
35
|
+
useMapLog(props, "GWalkingLine");
|
|
33
36
|
const pathRef = computed(() => props.path.map(vec2lnglat));
|
|
34
37
|
return () => {
|
|
35
38
|
const path = pathRef.value;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { reactive, VNodeData } from "vue-demi";
|
|
2
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
2
3
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
3
4
|
import {
|
|
4
5
|
useAWalkingRoute,
|
|
@@ -11,13 +12,14 @@ import type { Point } from "../../types/interface";
|
|
|
11
12
|
export type WalkingRouteRenderProps = {
|
|
12
13
|
path: Point[];
|
|
13
14
|
};
|
|
14
|
-
export interface WalkingRouteProps extends UseWalkingRouteProps {
|
|
15
|
+
export interface WalkingRouteProps extends UseWalkingRouteProps, MapLogProps {
|
|
15
16
|
render?: (props: WalkingRouteRenderProps) => VNodeChild;
|
|
16
17
|
}
|
|
17
18
|
export const AWalkingRoute = defineSetup(function WalkingRoute(
|
|
18
19
|
props: WalkingRouteProps,
|
|
19
20
|
{ slots }
|
|
20
21
|
) {
|
|
22
|
+
useMapLog(props, "AWalkingRoute");
|
|
21
23
|
const path = useAWalkingRoute(props);
|
|
22
24
|
return () => <div>{slots.render?.(reactive({ path }))}</div>;
|
|
23
25
|
});
|
|
@@ -26,6 +28,7 @@ export const GWalkingRoute = defineSetup(function WalkingRoute(
|
|
|
26
28
|
props: WalkingRouteProps,
|
|
27
29
|
{ slots }
|
|
28
30
|
) {
|
|
31
|
+
useMapLog(props, "GWalkingRoute");
|
|
29
32
|
const path = useGWalkingRoute(props);
|
|
30
33
|
return () => <div>{slots.render?.(reactive({ path }))}</div>;
|
|
31
34
|
});
|
|
@@ -2,16 +2,18 @@ import { computed } from "vue-demi";
|
|
|
2
2
|
import imgWaveCircle from "../../assets/icons/svg/wave-circle.svg";
|
|
3
3
|
import { AmapMarker } from "../../components/AmapMarker";
|
|
4
4
|
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView";
|
|
5
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
5
6
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
6
7
|
import { createElement, defineSetup } from "../../types/helper";
|
|
7
8
|
import { createDom } from "../../utils/dom";
|
|
8
9
|
import { vec2lnglat } from "../../utils/transform";
|
|
9
10
|
import * as css from "./WaveCircle.css";
|
|
10
11
|
|
|
11
|
-
export interface WaveCircleProps {
|
|
12
|
+
export interface WaveCircleProps extends MapLogProps {
|
|
12
13
|
position: [number, number];
|
|
13
14
|
}
|
|
14
15
|
export const AWaveCircle = defineSetup(function AWaveCircle(props: WaveCircleProps) {
|
|
16
|
+
useMapLog(props, "AWaveCircle");
|
|
15
17
|
const contentRef = computed(() => `<img src="${imgWaveCircle}" class="${css.waveCircle}">`);
|
|
16
18
|
const contentAnotherRef = computed(
|
|
17
19
|
() => `<img src="${imgWaveCircle}" class="${css.waveCircle} ${css.secondCircle}">`
|
|
@@ -29,6 +31,7 @@ export const AWaveCircle = defineSetup(function AWaveCircle(props: WaveCirclePro
|
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
export const GWaveCircle = defineSetup(function AWaveCircle(props: WaveCircleProps) {
|
|
34
|
+
useMapLog(props, "GWaveCircle");
|
|
32
35
|
const contentRef = computed(() =>
|
|
33
36
|
createDom("img", { class: css.waveCircle, src: imgWaveCircle })
|
|
34
37
|
);
|
|
@@ -3,7 +3,7 @@ import { useMapGeometry } from "../hooks/useMapGeometry";
|
|
|
3
3
|
import type { Place, Point } from "../types/interface";
|
|
4
4
|
|
|
5
5
|
export interface BusinessRecomendPlaceContext {
|
|
6
|
-
|
|
6
|
+
panToGeoPositionByRecomend: (value: Point) => void;
|
|
7
7
|
setCenterPlaceByRecomand: (value: Point) => void;
|
|
8
8
|
onChangeCenterPlace: (value: Place) => void;
|
|
9
9
|
onChangeRecomendPlaces: (value: Place[]) => void;
|
|
@@ -18,11 +18,11 @@ export const useBusinessRecomendPlaceMap = () => {
|
|
|
18
18
|
});
|
|
19
19
|
const placeCandidates = ref<Place[]>([]);
|
|
20
20
|
const { apiMapDistance } = useMapGeometry();
|
|
21
|
-
const
|
|
21
|
+
const panToGeoPositionByRecomend = (value: Point) => mapContext.panToGeoPositionByRecomend(value);
|
|
22
22
|
const setCenterPlaceByRecomand = (value: Point) => mapContext.setCenterPlaceByRecomand(value);
|
|
23
23
|
const mapContext: BusinessRecomendPlaceContext = {
|
|
24
|
-
|
|
25
|
-
throw new Error("MyError:
|
|
24
|
+
panToGeoPositionByRecomend: () => {
|
|
25
|
+
throw new Error("MyError: panToGeoPositionByRecomend used before assigned");
|
|
26
26
|
},
|
|
27
27
|
setCenterPlaceByRecomand: () => {
|
|
28
28
|
throw new Error("MyError: setCenterPlaceByRecomand used before assigned");
|
|
@@ -38,7 +38,7 @@ export const useBusinessRecomendPlaceMap = () => {
|
|
|
38
38
|
mapContext,
|
|
39
39
|
centerPlace,
|
|
40
40
|
placeCandidates,
|
|
41
|
-
|
|
41
|
+
panToGeoPositionByRecomend,
|
|
42
42
|
setCenterPlaceByRecomand,
|
|
43
43
|
apiMapDistance,
|
|
44
44
|
};
|
package/todo.md
CHANGED
|
@@ -26,6 +26,4 @@ https://dawchihliou.github.io/articles/building-custom-google-maps-marker-react-
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
1.
|
|
30
|
-
2. getRecomend 接口需要增加一个返回参数,表示当前地区是否可以提供服务
|
|
31
|
-
3. 孙明 刚才传入 complted 状态,地图未显示
|
|
29
|
+
1. 定位失败的视觉稿文字提示
|