@heycar/heycars-map 0.2.8 → 0.2.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/Demo/Demo.d.ts +2 -0
- package/dist/Demo/DemoBusinessQuoting.d.ts +1 -0
- package/dist/Demo/DemoBusinessRecomendPlace.d.ts +1 -0
- package/dist/Demo/DemoBusinessTaxiEnd.d.ts +1 -0
- package/dist/Demo/DemoBusinessTaxiService.d.ts +1 -0
- package/dist/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +3 -2
- package/dist/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +6 -0
- package/dist/business-components/BusinessTaxiEndMap/index.d.ts +1 -0
- package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +6 -0
- package/dist/hooks/useMapRecomendPlace.d.ts +4 -1
- package/dist/index.cjs +27 -27
- package/dist/index.d.ts +1 -0
- package/dist/index.js +611 -550
- package/package.json +1 -1
- package/src/App.tsx +21 -7
- package/src/{components/Demo → Demo/CityBound}/SearchDemo.tsx +2 -2
- package/src/{components/Demo → Demo}/Demo.tsx +13 -13
- package/src/Demo/DemoBusinessQuoting.tsx +18 -0
- package/src/Demo/DemoBusinessRecomendPlace.tsx +66 -0
- package/src/Demo/DemoBusinessTaxiEnd.tsx +13 -0
- package/src/{components/Demo → Demo}/DemoBusinessTaxiService.tsx +6 -26
- package/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.tsx +47 -38
- package/src/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.tsx +33 -0
- package/src/business-components/BusinessTaxiEndMap/index.ts +1 -0
- package/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.tsx +2 -2
- package/src/hooks/useMapGeometry.ts +4 -4
- package/src/hooks/useMapRecomendPlace.ts +34 -3
- package/src/index.ts +1 -0
- package/todo.md +6 -0
- package/dist/components/Demo/BusinessDemo.d.ts +0 -2
- package/dist/components/Demo/Demo.d.ts +0 -2
- package/dist/components/Demo/DemoBusinessQuoting.d.ts +0 -1
- package/dist/components/Demo/DemoBusinessTaxiService.d.ts +0 -2
- package/dist/components/Demo/Hello.d.ts +0 -17
- package/dist/components/Demo/HeycarDemo.d.ts +0 -3
- package/dist/components/Demo/index.d.ts +0 -1
- package/src/components/Demo/BusinessDemo.tsx +0 -117
- package/src/components/Demo/DemoBusinessQuoting.tsx +0 -38
- package/src/components/Demo/Hello.tsx +0 -15
- package/src/components/Demo/HeycarDemo.tsx +0 -104
- package/src/components/Demo/TemplateDemo.vue +0 -11
- package/src/components/Demo/index.ts +0 -1
- /package/dist/{components/Demo → Demo/CityBound}/SearchDemo.d.ts +0 -0
- /package/dist/{components/Demo → Demo/CityBound}/country.d.ts +0 -0
- /package/dist/{components/Demo → Demo/CityBound}/searchResult.d.ts +0 -0
- /package/dist/{components/Demo → Demo}/Demo.css.d.ts +0 -0
- /package/src/{components/Demo → Demo/CityBound}/country.ts +0 -0
- /package/src/{components/Demo → Demo/CityBound}/searchResult.ts +0 -0
- /package/src/{components/Demo → Demo}/Demo.css.ts +0 -0
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { APlaceCircle, GPlaceCircle } from "../../business-components/PlaceCircle";
|
|
2
|
-
import { GWaveCircle } from "../../business-components/WaveCircle";
|
|
3
|
-
import { defineSetup } from "../../types/helper";
|
|
4
|
-
import { Amap } from "../Amap";
|
|
5
|
-
import { AmapLoader } from "../AmapLoader";
|
|
6
|
-
import { Gmap } from "../Gmap";
|
|
7
|
-
import { GmapLoader } from "../GmapLoader";
|
|
8
|
-
import * as css from "./Demo.css";
|
|
9
|
-
|
|
10
|
-
const gmapApiKey = import.meta.env.VITE_GMAP_API_KEY;
|
|
11
|
-
const gmapId = import.meta.env.VITE_GMAP_MAP_ID;
|
|
12
|
-
const amapApiKey = import.meta.env.VITE_AMAP_API_KEY;
|
|
13
|
-
const amapApiSecret = import.meta.env.VITE_AMAP_API_SECRET;
|
|
14
|
-
|
|
15
|
-
export const ABusinessDemo = defineSetup(function ABusinessDemo() {
|
|
16
|
-
return () => (
|
|
17
|
-
<AmapLoader
|
|
18
|
-
apiKey={amapApiKey}
|
|
19
|
-
apiSecret={amapApiSecret}
|
|
20
|
-
loading={() => <div>loading</div>}
|
|
21
|
-
fallback={() => <div>error</div>}
|
|
22
|
-
plugins={["AMap.AutoComplete"]}
|
|
23
|
-
>
|
|
24
|
-
<Amap class={css.demo} center={[0, 0]} zoom={3}>
|
|
25
|
-
{/* <APassengerCircle position={[0, 0]} /> */}
|
|
26
|
-
{/* <AAddressBox position={[0, 0]} title={"Martyrs Lawn"} description={"您将在此处上车"} /> */}
|
|
27
|
-
<APlaceCircle position={[0, 0]} label={"Kenkey Hut"} />
|
|
28
|
-
{/* <AAddressLocator position={[0, 0]} /> */}
|
|
29
|
-
{/* <AmapMarker position={[0, 0]} /> */}
|
|
30
|
-
{/* <AStartEndPoint
|
|
31
|
-
type="end"
|
|
32
|
-
position={[0, 0]}
|
|
33
|
-
title="2月14日 11:00 用车"
|
|
34
|
-
description={"全程 *4.12公里* 约行驶 *22分钟*"}
|
|
35
|
-
/> */}
|
|
36
|
-
{/* <ATaxiCar position={[0, 0]} angle={90} title="距离终点 *4.2公里* 预计 *25分钟*" /> */}
|
|
37
|
-
{/* <ADrivingLine
|
|
38
|
-
path={[
|
|
39
|
-
[-5, -5],
|
|
40
|
-
[-4, -3],
|
|
41
|
-
[-3, -4],
|
|
42
|
-
[-2, -1],
|
|
43
|
-
[-1, -2],
|
|
44
|
-
[0, 1],
|
|
45
|
-
[1, 0],
|
|
46
|
-
[2, 2],
|
|
47
|
-
]}
|
|
48
|
-
/> */}
|
|
49
|
-
{/* <AWalkingLine
|
|
50
|
-
path={[
|
|
51
|
-
[-5, -5],
|
|
52
|
-
[-4, -3],
|
|
53
|
-
[-3, -4],
|
|
54
|
-
[-2, -1],
|
|
55
|
-
[-1, -2],
|
|
56
|
-
[0, 1],
|
|
57
|
-
[1, 0],
|
|
58
|
-
[2, 2],
|
|
59
|
-
]}
|
|
60
|
-
/> */}
|
|
61
|
-
{/* <AWaveCircle position={[0, 0]} /> */}
|
|
62
|
-
</Amap>
|
|
63
|
-
</AmapLoader>
|
|
64
|
-
);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
export const GBusinessDemo = defineSetup(function GBusinessDemo() {
|
|
68
|
-
return () => (
|
|
69
|
-
<GmapLoader
|
|
70
|
-
version="beta"
|
|
71
|
-
apiKey={gmapApiKey}
|
|
72
|
-
loading={() => <div>loading</div>}
|
|
73
|
-
fallback={() => <div>error</div>}
|
|
74
|
-
libraries={["places", "marker"]}
|
|
75
|
-
>
|
|
76
|
-
<Gmap class={css.demo} center={{ lat: 0, lng: 0 }} zoom={3} mapId={gmapId}>
|
|
77
|
-
{/* {/* <GmapMarker position={{ lat: 0, lng: 0 }} /> */}
|
|
78
|
-
{/* <GPassengerCircle position={[0, 0]} /> */}
|
|
79
|
-
{/* <GAddressLocator position={[0, 0]} /> */}
|
|
80
|
-
<GPlaceCircle position={[0, 0]} />
|
|
81
|
-
{/* <GAddressBox position={[0, 0]} title={"当前区域暂未开通服务"} /> */}
|
|
82
|
-
{/* <GStartEndPoint
|
|
83
|
-
type="start"
|
|
84
|
-
position={[0, 0]}
|
|
85
|
-
title="Webster Dental Plaza"
|
|
86
|
-
description={"全程 *4.12公里* 约行驶 *22分钟*"}
|
|
87
|
-
/> */}
|
|
88
|
-
{/* <GTaxiCar position={[0, 0]} /> */}
|
|
89
|
-
{/* <GDrivingLine
|
|
90
|
-
path={[
|
|
91
|
-
[-5, -5],
|
|
92
|
-
[-4, -3],
|
|
93
|
-
[-3, -4],
|
|
94
|
-
[-2, -1],
|
|
95
|
-
[-1, -2],
|
|
96
|
-
[0, 1],
|
|
97
|
-
[1, 0],
|
|
98
|
-
[2, 2],
|
|
99
|
-
]}
|
|
100
|
-
/> */}
|
|
101
|
-
{/* <GWalkingLine
|
|
102
|
-
path={[
|
|
103
|
-
[-5, -5],
|
|
104
|
-
[-4, -3],
|
|
105
|
-
[-3, -4],
|
|
106
|
-
[-2, -1],
|
|
107
|
-
[-1, -2],
|
|
108
|
-
[0, 1],
|
|
109
|
-
[1, 0],
|
|
110
|
-
[2, 2],
|
|
111
|
-
]}
|
|
112
|
-
/> */}
|
|
113
|
-
<GWaveCircle position={[0, 0]} />
|
|
114
|
-
</Gmap>
|
|
115
|
-
</GmapLoader>
|
|
116
|
-
);
|
|
117
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { BusinessQuotingMap } from "../../business-components/BusinessQuotingMap";
|
|
2
|
-
import { useBusinessQuotingMap } from "../../hooks-business/useBusinessQuotingMap";
|
|
3
|
-
import { defineSetup } from "../../types/helper";
|
|
4
|
-
import { MapProvider } from "../MapProvider/MapProvider";
|
|
5
|
-
import * as css from "./Demo.css";
|
|
6
|
-
|
|
7
|
-
const gmapApiKey = import.meta.env.VITE_GMAP_API_KEY;
|
|
8
|
-
const gmapId = import.meta.env.VITE_GMAP_MAP_ID;
|
|
9
|
-
const amapApiKey = import.meta.env.VITE_AMAP_API_KEY;
|
|
10
|
-
const amapApiSecret = import.meta.env.VITE_AMAP_API_SECRET;
|
|
11
|
-
|
|
12
|
-
export const DemoBusinessQuoting = defineSetup(function DemoBusinessTaxiService() {
|
|
13
|
-
return () => (
|
|
14
|
-
<MapProvider
|
|
15
|
-
amapKey={amapApiKey}
|
|
16
|
-
amapSecret={amapApiSecret}
|
|
17
|
-
gmapId={gmapId}
|
|
18
|
-
gmapKey={gmapApiKey}
|
|
19
|
-
supplier={"amap"}
|
|
20
|
-
>
|
|
21
|
-
<SomeQuotingPage />
|
|
22
|
-
</MapProvider>
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const SomeQuotingPage = defineSetup(function SomeQuotingPage() {
|
|
27
|
-
const { setMap, registerFitVeiw } = useBusinessQuotingMap();
|
|
28
|
-
return () => (
|
|
29
|
-
<BusinessQuotingMap
|
|
30
|
-
class={css.demo}
|
|
31
|
-
from={{ lng: 121.4, lat: 31.2, name: "from place name" }}
|
|
32
|
-
to={{ lng: 121.5, lat: 31.4, name: "to place name" }}
|
|
33
|
-
renderDescription={({ distance, duration }) => `全程 *${distance}公里* 约行驶 *${duration}*`}
|
|
34
|
-
mapRef={setMap}
|
|
35
|
-
registerOverlay={registerFitVeiw}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineSetup } from "../../types/helper";
|
|
2
|
-
|
|
3
|
-
export const Hello = defineSetup(function Hello(props: {
|
|
4
|
-
className?: string;
|
|
5
|
-
qyc: number;
|
|
6
|
-
style: any;
|
|
7
|
-
}) {
|
|
8
|
-
return () => (
|
|
9
|
-
<section>
|
|
10
|
-
<span class={props.className} style={props.style}>
|
|
11
|
-
hello
|
|
12
|
-
</span>
|
|
13
|
-
</section>
|
|
14
|
-
);
|
|
15
|
-
});
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue-demi";
|
|
2
|
-
import {
|
|
3
|
-
BusinessRecomendPlaceMap,
|
|
4
|
-
BusinessRecomendPlaceMapProps,
|
|
5
|
-
} from "../../business-components/BusinessRecomendPlaceMap";
|
|
6
|
-
import { useBusinessMapAutoComplete } from "../../hooks-business/useBusinessMapAutoComplete";
|
|
7
|
-
import { useBusinessRecomendPlaceMap } from "../../hooks-business/useBusinessRecomendPlaceMap";
|
|
8
|
-
|
|
9
|
-
import { defineSetup } from "../../types/helper";
|
|
10
|
-
import { HeycarMap, MapProvider } from "../MapProvider/MapProvider";
|
|
11
|
-
import * as css from "./Demo.css";
|
|
12
|
-
|
|
13
|
-
const gmapApiKey = import.meta.env.VITE_GMAP_API_KEY;
|
|
14
|
-
const gmapId = import.meta.env.VITE_GMAP_MAP_ID;
|
|
15
|
-
const amapApiKey = import.meta.env.VITE_AMAP_API_KEY;
|
|
16
|
-
const amapApiSecret = import.meta.env.VITE_AMAP_API_SECRET;
|
|
17
|
-
|
|
18
|
-
export const HeycarDemo = defineSetup(function HeycarDemo() {
|
|
19
|
-
return () => (
|
|
20
|
-
<MapProvider
|
|
21
|
-
amapKey={amapApiKey}
|
|
22
|
-
amapSecret={amapApiSecret}
|
|
23
|
-
gmapId={gmapId}
|
|
24
|
-
gmapKey={gmapApiKey}
|
|
25
|
-
supplier={"amap"}
|
|
26
|
-
>
|
|
27
|
-
<SomeHomePage />
|
|
28
|
-
</MapProvider>
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const SomeOuterPage = defineSetup(function SomeOuterPage() {
|
|
33
|
-
return () => {
|
|
34
|
-
return (
|
|
35
|
-
<div>
|
|
36
|
-
<SomeAutoComplete cityName="上海市"></SomeAutoComplete>
|
|
37
|
-
<HeycarMap
|
|
38
|
-
class={css.demo}
|
|
39
|
-
fallback={() => <div>error</div>}
|
|
40
|
-
loading={() => <div>loading</div>}
|
|
41
|
-
center={[121.5, 31]}
|
|
42
|
-
zoom={13}
|
|
43
|
-
></HeycarMap>
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
const SomeAutoComplete = defineSetup(function SomeAutoComplete(props: { cityName: string }) {
|
|
49
|
-
const { autoCompletePlaces, setKeyword, setCity } = useBusinessMapAutoComplete({
|
|
50
|
-
cityNameRef: computed(() => props.cityName),
|
|
51
|
-
});
|
|
52
|
-
(window as any).setKeyword = setKeyword;
|
|
53
|
-
(window as any).setCity = setCity;
|
|
54
|
-
return () => {
|
|
55
|
-
const list = autoCompletePlaces.value.map((place) => (
|
|
56
|
-
<div>
|
|
57
|
-
{place.lng} | {place.lat} | {place.name} | {place.description}
|
|
58
|
-
</div>
|
|
59
|
-
));
|
|
60
|
-
return <div>{list}</div>;
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
export const SomeHomePage = defineSetup(function SomeHomePage() {
|
|
65
|
-
const getRecomendPlace: BusinessRecomendPlaceMapProps["getRecomendPlace"] = async (
|
|
66
|
-
place,
|
|
67
|
-
context
|
|
68
|
-
) => {
|
|
69
|
-
const { lat, lng } = place;
|
|
70
|
-
console.log("getRecomendPlace context?.source = ", context?.source);
|
|
71
|
-
return [
|
|
72
|
-
{ lat: lat + 0.0001, lng: lng + 0.0001, name: "place name 1" },
|
|
73
|
-
{ lat: lat + 0.002, lng: lng + 0.002, name: "place name 2" },
|
|
74
|
-
];
|
|
75
|
-
};
|
|
76
|
-
const {
|
|
77
|
-
centerPlace,
|
|
78
|
-
placeCandidates,
|
|
79
|
-
panTo,
|
|
80
|
-
setCenterPlaceByRecomand,
|
|
81
|
-
mapContext,
|
|
82
|
-
apiMapDistance,
|
|
83
|
-
} = useBusinessRecomendPlaceMap();
|
|
84
|
-
|
|
85
|
-
(window as any).setCenterPlaceByRecomand = setCenterPlaceByRecomand;
|
|
86
|
-
return () => {
|
|
87
|
-
return (
|
|
88
|
-
<div>
|
|
89
|
-
placeCandidates: {placeCandidates} <br />
|
|
90
|
-
centerPlace: {centerPlace.lng} | {centerPlace.lat} | {centerPlace.name} |{" "}
|
|
91
|
-
{centerPlace.cityName} <br />
|
|
92
|
-
<BusinessRecomendPlaceMap
|
|
93
|
-
class={css.demo}
|
|
94
|
-
title={centerPlace.name}
|
|
95
|
-
description={"some description"}
|
|
96
|
-
geoDefaultPosition={[121, 31]}
|
|
97
|
-
getRecomendPlace={getRecomendPlace}
|
|
98
|
-
mapContext={mapContext}
|
|
99
|
-
onGeoError={(e) => console.log("onGeoError e = ", e)}
|
|
100
|
-
/>
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Demo";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|