@heycar/heycars-map 0.3.7 → 0.3.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/DemoBusinessRecomendPlace.d.ts +9 -0
- package/dist/business-components/AbsoluteAddressBox/AbsoluteAddressBox.d.ts +1 -2
- package/dist/business-components/AddressBox/AddressBox.d.ts +1 -2
- package/dist/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +2 -0
- package/dist/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +1 -2
- package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -8
- package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +46 -0
- package/dist/business-components/DrivingLine/DrivingLine.d.ts +1 -2
- package/dist/business-components/DrivingRoute/DrivingRoute.d.ts +1 -2
- package/dist/business-components/PassengerCircle/PassengerCircle.d.ts +1 -2
- package/dist/business-components/PickupPoints/PickupPoints.d.ts +1 -2
- package/dist/business-components/PlaceCircle/PlaceCircle.d.ts +1 -2
- package/dist/business-components/StartEndPoint/StartEndPoint.d.ts +1 -2
- package/dist/business-components/TaxiCar/TaxiCar.d.ts +1 -2
- package/dist/business-components/WalkingLine/WalkingLine.d.ts +1 -2
- package/dist/business-components/WalkingRoute/WalkingRoute.d.ts +1 -2
- package/dist/business-components/WaveCircle/WaveCircle.d.ts +1 -2
- package/dist/components/Gmap/Gmap.d.ts +0 -2
- package/dist/components/MapProvider/MapProvider.d.ts +1 -4
- package/dist/hooks/useMapAutoComplete.d.ts +1 -2
- package/dist/hooks-business/useBusinessMapAutoComplete.d.ts +1 -2
- package/dist/index.cjs +54 -54
- package/dist/index.js +1867 -1959
- package/package.json +2 -3
- package/todo.md +27 -4
- package/dist/Demo/CityBound/SearchDemo.d.ts +0 -1
- package/dist/Demo/CityBound/country.d.ts +0 -5
- package/dist/Demo/CityBound/searchResult.d.ts +0 -8
- package/dist/hooks/useMapLog.d.ts +0 -5
- package/src/App.tsx +0 -27
- package/src/Demo/CityBound/SearchDemo.tsx +0 -142
- package/src/Demo/CityBound/country.ts +0 -4179
- package/src/Demo/CityBound/searchResult.ts +0 -21122
- package/src/Demo/Demo.css.ts +0 -6
- package/src/Demo/Demo.tsx +0 -97
- package/src/Demo/DemoBusinessQuoting.tsx +0 -18
- package/src/Demo/DemoBusinessRecomendPlace.tsx +0 -89
- package/src/Demo/DemoBusinessTaxiEnd.tsx +0 -38
- package/src/Demo/DemoBusinessTaxiService.tsx +0 -58
- package/src/Demo/sample.json +0 -793
- package/src/api/contants.ts +0 -3
- package/src/api/driving.ts +0 -87
- package/src/api/geocoder.ts +0 -88
- package/src/api/geometry.ts +0 -44
- package/src/api/place.ts +0 -105
- package/src/assets/icons/svg/address-locator.svg +0 -1
- package/src/assets/icons/svg/arrow-right.svg +0 -1
- package/src/assets/icons/svg/end-point.svg +0 -1
- package/src/assets/icons/svg/passenger-circle.svg +0 -1
- package/src/assets/icons/svg/place-circle.svg +0 -22
- package/src/assets/icons/svg/start-point.svg +0 -1
- package/src/assets/icons/svg/taxi-car.svg +0 -1
- package/src/assets/icons/svg/wave-circle.svg +0 -1
- package/src/business-components/AbsoluteAddressBox/AbsoluteAddressBox.css.ts +0 -68
- package/src/business-components/AbsoluteAddressBox/AbsoluteAddressBox.tsx +0 -50
- package/src/business-components/AbsoluteAddressBox/index.ts +0 -1
- package/src/business-components/AddressBox/AddressBox.css.ts +0 -55
- package/src/business-components/AddressBox/AddressBox.tsx +0 -76
- package/src/business-components/AddressBox/index.ts +0 -1
- package/src/business-components/AddressLocator/AddressLocator.css.ts +0 -7
- package/src/business-components/AddressLocator/AddressLocator.tsx +0 -40
- package/src/business-components/AddressLocator/index.ts +0 -1
- package/src/business-components/BusinessQuotingMap/BusinessQuotingMap.tsx +0 -49
- package/src/business-components/BusinessQuotingMap/index.ts +0 -1
- package/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.tsx +0 -218
- package/src/business-components/BusinessRecomendPlaceMap/index.ts +0 -1
- package/src/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.tsx +0 -43
- package/src/business-components/BusinessTaxiEndMap/index.ts +0 -1
- package/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.tsx +0 -453
- package/src/business-components/BusinessTaxiServiceMap/index.ts +0 -1
- package/src/business-components/DrivingLine/DrivingLine.css.ts +0 -10
- package/src/business-components/DrivingLine/DrivingLine.tsx +0 -135
- package/src/business-components/DrivingLine/index.ts +0 -1
- package/src/business-components/DrivingRoute/DrivingRoute.tsx +0 -52
- package/src/business-components/DrivingRoute/index.ts +0 -1
- package/src/business-components/FitView/FitView.tsx +0 -22
- package/src/business-components/FitView/index.ts +0 -1
- package/src/business-components/PassengerCircle/PassengerCircle.css.ts +0 -21
- package/src/business-components/PassengerCircle/PassengerCircle.tsx +0 -69
- package/src/business-components/PassengerCircle/index.ts +0 -1
- package/src/business-components/PickupPoints/PickupPoints.tsx +0 -38
- package/src/business-components/PickupPoints/index.ts +0 -1
- package/src/business-components/PlaceCircle/PlaceCircle.css.ts +0 -76
- package/src/business-components/PlaceCircle/PlaceCircle.tsx +0 -110
- package/src/business-components/PlaceCircle/index.ts +0 -1
- package/src/business-components/StartEndPoint/StartEndPoint.css.ts +0 -70
- package/src/business-components/StartEndPoint/StartEndPoint.tsx +0 -122
- package/src/business-components/StartEndPoint/index.ts +0 -1
- package/src/business-components/TaxiCar/TaxiCar.css.ts +0 -16
- package/src/business-components/TaxiCar/TaxiCar.tsx +0 -93
- package/src/business-components/TaxiCar/index.ts +0 -1
- package/src/business-components/WalkingLine/WalkingLine.tsx +0 -80
- package/src/business-components/WalkingLine/index.ts +0 -1
- package/src/business-components/WalkingRoute/WalkingRoute.tsx +0 -43
- package/src/business-components/WalkingRoute/index.ts +0 -1
- package/src/business-components/WaveCircle/WaveCircle.css.ts +0 -54
- package/src/business-components/WaveCircle/WaveCircle.tsx +0 -59
- package/src/business-components/WaveCircle/index.ts +0 -1
- package/src/components/Amap/Amap.css.ts +0 -5
- package/src/components/Amap/Amap.ts +0 -76
- package/src/components/Amap/index.ts +0 -1
- package/src/components/AmapInfoWindow/AmapInfoWindow.ts +0 -45
- package/src/components/AmapInfoWindow/index.ts +0 -1
- package/src/components/AmapLoader/AmapLoader.ts +0 -20
- package/src/components/AmapLoader/index.ts +0 -1
- package/src/components/AmapMarker/AmapMarker.ts +0 -48
- package/src/components/AmapMarker/index.ts +0 -1
- package/src/components/AmapPolygon/AmapPolygon.ts +0 -41
- package/src/components/AmapPolygon/index.ts +0 -1
- package/src/components/AmapPolyline/AmapPolyline.ts +0 -40
- package/src/components/AmapPolyline/index.ts +0 -1
- package/src/components/AmapText/AmapText.ts +0 -39
- package/src/components/AmapText/index.ts +0 -1
- package/src/components/Gmap/Gmap.css.ts +0 -10
- package/src/components/Gmap/Gmap.ts +0 -54
- package/src/components/Gmap/index.ts +0 -1
- package/src/components/GmapAdvancedMarkerView/GmapAdvancedMarkerView.ts +0 -63
- package/src/components/GmapAdvancedMarkerView/index.ts +0 -1
- package/src/components/GmapInfoWindow/GmapInfoWindow.ts +0 -38
- package/src/components/GmapInfoWindow/index.ts +0 -1
- package/src/components/GmapLoader/GmapLoader.ts +0 -21
- package/src/components/GmapLoader/index.ts +0 -1
- package/src/components/GmapMarker/GmapMarker.ts +0 -34
- package/src/components/GmapMarker/index.ts +0 -1
- package/src/components/GmapPolygon/GmapPolygon.ts +0 -29
- package/src/components/GmapPolygon/index.ts +0 -1
- package/src/components/GmapPolyline/GmapPolyline.ts +0 -29
- package/src/components/GmapPolyline/index.ts +0 -1
- package/src/components/MapProvider/MapProvider.tsx +0 -83
- package/src/components/MapProvider/index.ts +0 -1
- package/src/hooks/useDrivingRoute.ts +0 -106
- package/src/hooks/useGeoLocation.ts +0 -70
- package/src/hooks/useHeycarMap.ts +0 -28
- package/src/hooks/useMap.ts +0 -43
- package/src/hooks/useMapAngle.ts +0 -42
- package/src/hooks/useMapAutoComplete.ts +0 -130
- package/src/hooks/useMapCityBound.ts +0 -64
- package/src/hooks/useMapDrag.ts +0 -72
- package/src/hooks/useMapEventSource.ts +0 -20
- package/src/hooks/useMapFitView.ts +0 -135
- package/src/hooks/useMapGeometry.ts +0 -27
- package/src/hooks/useMapLngLatToVw.ts +0 -31
- package/src/hooks/useMapLoader.ts +0 -164
- package/src/hooks/useMapLog.ts +0 -24
- package/src/hooks/useMapPlace.ts +0 -138
- package/src/hooks/useMapRecomendPlace.ts +0 -150
- package/src/hooks/useMapSupplier.ts +0 -16
- package/src/hooks/useOverlay.ts +0 -23
- package/src/hooks/usePlacesLabelDirection.ts +0 -61
- package/src/hooks/useUdate.ts +0 -9
- package/src/hooks/useWaitTimer.ts +0 -25
- package/src/hooks/useWalkingRoute.ts +0 -87
- package/src/hooks-business/useBusinessMapAutoComplete.ts +0 -22
- package/src/hooks-business/useBusinessQuotingMap.ts +0 -11
- package/src/hooks-business/useBusinessRecomendPlaceMap.ts +0 -45
- package/src/hooks-business/useBusinessTaxiServiceMap.ts +0 -12
- package/src/index.ts +0 -33
- package/src/main.ts +0 -6
- package/src/style.css +0 -0
- package/src/types/amap/autocomplete.d.ts +0 -64
- package/src/types/amap/driving.d.ts +0 -170
- package/src/types/amap/geocoder.d.ts +0 -217
- package/src/types/amap/marker.ts +0 -11
- package/src/types/amap/place.d.ts +0 -114
- package/src/types/amap/plugin.d.ts +0 -27
- package/src/types/amap/walking.d.ts +0 -78
- package/src/types/global.d.ts +0 -10
- package/src/types/helper.ts +0 -172
- package/src/types/interface.ts +0 -62
- package/src/types/mapHelper.ts +0 -1
- package/src/utils/compare.ts +0 -189
- package/src/utils/dom.ts +0 -14
- package/src/utils/helper.ts +0 -5
- package/src/utils/transform.ts +0 -68
- package/src/vite-env.d.ts +0 -12
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@vanilla-extract/recipes";
|
|
2
|
-
|
|
3
|
-
export const passengerCircle = recipe({
|
|
4
|
-
base: {
|
|
5
|
-
display: "flex",
|
|
6
|
-
},
|
|
7
|
-
variants: {
|
|
8
|
-
size: {
|
|
9
|
-
small: {
|
|
10
|
-
width: "4.53vw",
|
|
11
|
-
height: "4.53vw",
|
|
12
|
-
marginBottom: "-2.265vw",
|
|
13
|
-
},
|
|
14
|
-
large: {
|
|
15
|
-
width: "16.27vw",
|
|
16
|
-
height: "16.27vw",
|
|
17
|
-
marginBottom: "-8.135vw",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
import imgPassengerCircle from "../../assets/icons/svg/passenger-circle.svg";
|
|
3
|
-
import imgPlaceCircle from "../../assets/icons/svg/place-circle.svg";
|
|
4
|
-
import { AmapMarker } from "../../components/AmapMarker";
|
|
5
|
-
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView";
|
|
6
|
-
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
7
|
-
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
8
|
-
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
9
|
-
import { createElement, defineSetup } from "../../types/helper";
|
|
10
|
-
import { createDom } from "../../utils/dom";
|
|
11
|
-
import { vec2lnglat } from "../../utils/transform";
|
|
12
|
-
|
|
13
|
-
import * as css from "./PassengerCircle.css";
|
|
14
|
-
|
|
15
|
-
interface PassengerCircleProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
16
|
-
position: [number, number];
|
|
17
|
-
size?: "small" | "large";
|
|
18
|
-
}
|
|
19
|
-
export const APassengerCircle = defineSetup(function APassengerCircle(
|
|
20
|
-
props: PassengerCircleProps<AmapOverlay>
|
|
21
|
-
) {
|
|
22
|
-
useMapLog(props, "APassengerCircle");
|
|
23
|
-
const contentRef = computed(() => {
|
|
24
|
-
const { size = "large" } = props;
|
|
25
|
-
const src = size === "large" ? imgPassengerCircle : imgPlaceCircle;
|
|
26
|
-
return `
|
|
27
|
-
<img src="${src}" class="${css.passengerCircle({ size })}">
|
|
28
|
-
`;
|
|
29
|
-
});
|
|
30
|
-
return () => {
|
|
31
|
-
return (
|
|
32
|
-
<AmapMarker
|
|
33
|
-
position={props.position}
|
|
34
|
-
content={contentRef.value}
|
|
35
|
-
anchor={"bottom-center"}
|
|
36
|
-
registerOverlay={props.registerOverlay}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export const GPassengerCircle = defineSetup(function GPassengerCircle(
|
|
43
|
-
props: PassengerCircleProps<GmapOverlay>
|
|
44
|
-
) {
|
|
45
|
-
useMapLog(props, "GPassengerCircle");
|
|
46
|
-
const contentRef = computed(() => {
|
|
47
|
-
const { size = "large" } = props;
|
|
48
|
-
const src = size === "large" ? imgPassengerCircle : imgPlaceCircle;
|
|
49
|
-
return createDom("img", { class: css.passengerCircle({ size }), src });
|
|
50
|
-
});
|
|
51
|
-
return () => (
|
|
52
|
-
<GmapAdvancedMarkerView
|
|
53
|
-
position={vec2lnglat(props.position)}
|
|
54
|
-
content={contentRef.value}
|
|
55
|
-
registerOverlay={props.registerOverlay}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
export const PassengerCircle = defineSetup(function PassengerCircle(
|
|
61
|
-
props: PassengerCircleProps<AmapOverlay> | PassengerCircleProps<GmapOverlay>
|
|
62
|
-
) {
|
|
63
|
-
const payload = useMapSupplier();
|
|
64
|
-
return () => {
|
|
65
|
-
return createElement(payload.supplier === "gmap" ? GPassengerCircle : APassengerCircle, {
|
|
66
|
-
attrs: props,
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./PassengerCircle";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { reactive, toRef } from "vue-demi";
|
|
2
|
-
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
3
|
-
import { usePointsLabelDirection } from "../../hooks/usePlacesLabelDirection";
|
|
4
|
-
import { defineSetup } from "../../types/helper";
|
|
5
|
-
import type { Place } from "../../types/interface";
|
|
6
|
-
import { place2point } from "../../utils/transform";
|
|
7
|
-
import { PlaceCircle } from "../PlaceCircle";
|
|
8
|
-
|
|
9
|
-
export interface PickupPointsProps extends MapLogProps {
|
|
10
|
-
places: Place[];
|
|
11
|
-
renderLabel?: (place: Place) => string | undefined;
|
|
12
|
-
onClick?: (value: Place) => any;
|
|
13
|
-
}
|
|
14
|
-
export const PickupPoints = defineSetup(function PickupPoints(props: PickupPointsProps, { emit }) {
|
|
15
|
-
useMapLog(props, "PickupPoints");
|
|
16
|
-
const { renderLabel } = props;
|
|
17
|
-
const directions = usePointsLabelDirection(
|
|
18
|
-
reactive({ places: toRef(props, "places"), heightLimit: 9, widthLimit: 32 })
|
|
19
|
-
);
|
|
20
|
-
return () => {
|
|
21
|
-
return (
|
|
22
|
-
<div>
|
|
23
|
-
{props.places.map((place, idx) => {
|
|
24
|
-
const direction = directions.value[idx];
|
|
25
|
-
const label = renderLabel ? renderLabel(place) : place.name;
|
|
26
|
-
return (
|
|
27
|
-
<PlaceCircle
|
|
28
|
-
position={place2point(place)}
|
|
29
|
-
label={label}
|
|
30
|
-
textAlign={direction}
|
|
31
|
-
onClick={() => emit("click", place)}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
})}
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./PickupPoints";
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { style } from "@vanilla-extract/css";
|
|
2
|
-
import { recipe } from "@vanilla-extract/recipes";
|
|
3
|
-
|
|
4
|
-
export const placeCircleLayout = recipe({
|
|
5
|
-
base: {
|
|
6
|
-
display: "flex",
|
|
7
|
-
alignItems: "center",
|
|
8
|
-
},
|
|
9
|
-
variants: {
|
|
10
|
-
textAlign: {
|
|
11
|
-
left: {
|
|
12
|
-
flexDirection: "row-reverse",
|
|
13
|
-
},
|
|
14
|
-
right: {},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const amapPlaceIconLayout = recipe({
|
|
20
|
-
variants: {
|
|
21
|
-
textAlign: {
|
|
22
|
-
left: {
|
|
23
|
-
marginRight: "-2.265vw",
|
|
24
|
-
},
|
|
25
|
-
right: {
|
|
26
|
-
marginLeft: "-2.265vw",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const gmapPlaceIconLayout = recipe({
|
|
33
|
-
base: {
|
|
34
|
-
marginBottom: "-2.265vw",
|
|
35
|
-
},
|
|
36
|
-
variants: {
|
|
37
|
-
textAlign: {
|
|
38
|
-
left: {
|
|
39
|
-
marginRight: "calc(50% - 2.265vw)",
|
|
40
|
-
},
|
|
41
|
-
right: {
|
|
42
|
-
marginLeft: "calc(50% - 2.265vw)",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export const placeIcon = recipe({
|
|
49
|
-
base: {
|
|
50
|
-
display: "flex",
|
|
51
|
-
width: "4.53vw",
|
|
52
|
-
height: "4.53vw",
|
|
53
|
-
},
|
|
54
|
-
variants: {
|
|
55
|
-
hideIcon: {
|
|
56
|
-
true: {
|
|
57
|
-
opacity: 0,
|
|
58
|
-
},
|
|
59
|
-
false: {},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
export const label = style({
|
|
65
|
-
display: "-webkit-box",
|
|
66
|
-
fontSize: "3.2vw",
|
|
67
|
-
fontFamily: "PingFangSC-Semibold, PingFang SC",
|
|
68
|
-
fontWeight: 600,
|
|
69
|
-
color: "#243E66",
|
|
70
|
-
lineHeight: "4.53vw",
|
|
71
|
-
width: "max-content",
|
|
72
|
-
maxWidth: "32vw",
|
|
73
|
-
WebkitLineClamp: 2,
|
|
74
|
-
WebkitBoxOrient: "vertical",
|
|
75
|
-
overflow: "hidden",
|
|
76
|
-
});
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue-demi";
|
|
2
|
-
import imgPlaceCircle from "../../assets/icons/svg/place-circle.svg";
|
|
3
|
-
import { AmapMarker, AmapMarkerProps } from "../../components/AmapMarker";
|
|
4
|
-
import {
|
|
5
|
-
GmapAdvancedMarkerView,
|
|
6
|
-
GmapAdvancedMarkerViewProps,
|
|
7
|
-
} from "../../components/GmapAdvancedMarkerView";
|
|
8
|
-
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
9
|
-
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
10
|
-
import { AnchorType } from "../../types/amap/marker";
|
|
11
|
-
import { createElement, defineSetup } from "../../types/helper";
|
|
12
|
-
import type { Point } from "../../types/interface";
|
|
13
|
-
import { createDom } from "../../utils/dom";
|
|
14
|
-
import { vec2lnglat } from "../../utils/transform";
|
|
15
|
-
import * as css from "./PlaceCircle.css";
|
|
16
|
-
|
|
17
|
-
export interface PlaceCircleProps extends MapLogProps {
|
|
18
|
-
position: [number, number];
|
|
19
|
-
label?: string;
|
|
20
|
-
textAlign?: "left" | "right";
|
|
21
|
-
hideIcon?: boolean;
|
|
22
|
-
onClick?: (value: Point) => any;
|
|
23
|
-
}
|
|
24
|
-
export const APlaceCircle = defineSetup(function APlaceCircle(props: PlaceCircleProps, { emit }) {
|
|
25
|
-
useMapLog(props, "APlaceCircle");
|
|
26
|
-
const textAlignRef = computed(() => props.textAlign ?? "right");
|
|
27
|
-
const contentRef = computed(() => {
|
|
28
|
-
const { hideIcon = false } = props;
|
|
29
|
-
return `
|
|
30
|
-
<div class="${css.placeCircleLayout({ textAlign: textAlignRef.value })}">
|
|
31
|
-
<img class="${css.placeIcon({ hideIcon })} ${css.amapPlaceIconLayout({
|
|
32
|
-
textAlign: textAlignRef.value,
|
|
33
|
-
})}" src="${imgPlaceCircle}">
|
|
34
|
-
<div class="${css.label}">${props.label}</div>
|
|
35
|
-
</div>
|
|
36
|
-
`;
|
|
37
|
-
});
|
|
38
|
-
const contentWithoutLabelRef = computed(() => {
|
|
39
|
-
const { hideIcon = false } = props;
|
|
40
|
-
return `<img class="${css.placeIcon({ hideIcon })} ${css.amapPlaceIconLayout({
|
|
41
|
-
textAlign: textAlignRef.value,
|
|
42
|
-
})}" src="${imgPlaceCircle}">`;
|
|
43
|
-
});
|
|
44
|
-
const handleClick: AmapMarkerProps["onClick"] = (e) => {
|
|
45
|
-
console.log("on amap marker e = ", e);
|
|
46
|
-
emit("click", props.position);
|
|
47
|
-
};
|
|
48
|
-
return () => {
|
|
49
|
-
return (
|
|
50
|
-
<AmapMarker
|
|
51
|
-
position={props.position}
|
|
52
|
-
content={props.label ? contentRef.value : contentWithoutLabelRef.value}
|
|
53
|
-
anchor={textAlignRef.value === "left" ? AnchorType.middleRight : AnchorType.middleLeft}
|
|
54
|
-
onClick={handleClick}
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
export const GPlaceCircle = defineSetup(function GPlaceCircle(props: PlaceCircleProps, { emit }) {
|
|
61
|
-
useMapLog(props, "GPlaceCircle");
|
|
62
|
-
const textAlignRef = computed(() => props.textAlign ?? "right");
|
|
63
|
-
const contentRef = computed(() => {
|
|
64
|
-
const { hideIcon = false } = props;
|
|
65
|
-
return createDom(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
class: `${css.placeCircleLayout({
|
|
69
|
-
textAlign: textAlignRef.value,
|
|
70
|
-
})} ${css.gmapPlaceIconLayout({ textAlign: textAlignRef.value })}`,
|
|
71
|
-
},
|
|
72
|
-
`
|
|
73
|
-
<img class="${css.placeIcon({ hideIcon })}" src="${imgPlaceCircle}">
|
|
74
|
-
<div class="${css.label}">${props.label}</div>
|
|
75
|
-
`
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
const contentWithoutLabelRef = computed(() => {
|
|
79
|
-
const { hideIcon = false } = props;
|
|
80
|
-
return createDom("img", {
|
|
81
|
-
class: `${css.placeIcon({ hideIcon })} ${css.gmapPlaceIconLayout({
|
|
82
|
-
textAlign: textAlignRef.value,
|
|
83
|
-
})}`,
|
|
84
|
-
src: imgPlaceCircle,
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
const handleClick: GmapAdvancedMarkerViewProps["onClick"] = (e) => {
|
|
88
|
-
console.log("on gmap advanced marker view e = ", e);
|
|
89
|
-
emit("click", props.position);
|
|
90
|
-
};
|
|
91
|
-
return () => (
|
|
92
|
-
<GmapAdvancedMarkerView
|
|
93
|
-
position={vec2lnglat(props.position)}
|
|
94
|
-
content={props.label ? contentRef.value : contentWithoutLabelRef.value}
|
|
95
|
-
onClick={handleClick}
|
|
96
|
-
/>
|
|
97
|
-
);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
export const PlaceCircle = defineSetup(function PlaceCircle(props: PlaceCircleProps, { emit }) {
|
|
101
|
-
const payload = useMapSupplier();
|
|
102
|
-
return () => {
|
|
103
|
-
return createElement(payload.supplier === "gmap" ? GPlaceCircle : APlaceCircle, {
|
|
104
|
-
attrs: props,
|
|
105
|
-
on: {
|
|
106
|
-
click: (value: any) => emit("click", value),
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./PlaceCircle";
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { style } from "@vanilla-extract/css";
|
|
2
|
-
import { recipe } from "@vanilla-extract/recipes";
|
|
3
|
-
|
|
4
|
-
export const pointLayout = style({
|
|
5
|
-
marginBottom: "-0.4vw",
|
|
6
|
-
display: "flex",
|
|
7
|
-
flexDirection: "column",
|
|
8
|
-
alignItems: "center",
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export const pointInfoBox = style({
|
|
12
|
-
padding: "1.07vw 2.4vw 1.6vw 2.67vw",
|
|
13
|
-
background: "#FFFFFF",
|
|
14
|
-
boxShadow: "0vw 0.53vw 2.4vw 0vw rgba(63,63,63,0.2)",
|
|
15
|
-
borderRadius: "2.13vw",
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const pointSingleInfoBox = style({
|
|
19
|
-
padding: "2.67vw 2.67vw 2.4vw 3.2vw",
|
|
20
|
-
background: "#FFFFFF",
|
|
21
|
-
boxShadow: "0vw 0vw 2.67vw 0vw rgba(78,85,108,0.15)",
|
|
22
|
-
borderRadius: "4.8vw",
|
|
23
|
-
fontSize: "3.2vw",
|
|
24
|
-
fontFamily: "PingFangSC-Medium, PingFang SC",
|
|
25
|
-
fontWeight: 500,
|
|
26
|
-
color: "#1E1E1E",
|
|
27
|
-
lineHeight: "4.53vw",
|
|
28
|
-
whiteSpace: "nowrap",
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export const pointInfoBoxTitle = style({
|
|
32
|
-
fontSize: "3.2vw",
|
|
33
|
-
fontFamily: "PingFangSC-Medium, PingFang SC",
|
|
34
|
-
fontWeight: 500,
|
|
35
|
-
color: "#1E1E1E",
|
|
36
|
-
lineHeight: "4.53vw",
|
|
37
|
-
whiteSpace: "nowrap",
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
export const pointInfoBoxDescription = style({
|
|
41
|
-
fontSize: "2.4vw",
|
|
42
|
-
fontFamily: "PingFangSC-Regular, PingFang SC",
|
|
43
|
-
fontWeight: 400,
|
|
44
|
-
color: "#7E7E7E",
|
|
45
|
-
lineHeight: "3.47vw",
|
|
46
|
-
whiteSpace: "nowrap",
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export const pointInfoBoxEmphasize = style({
|
|
50
|
-
color: "#4471FF",
|
|
51
|
-
fontFamily: "PingFangSC-Medium, PingFang SC",
|
|
52
|
-
fontWeight: 500,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export const pointIcon = recipe({
|
|
56
|
-
variants: {
|
|
57
|
-
type: {
|
|
58
|
-
start: {
|
|
59
|
-
marginTop: "1.33vw",
|
|
60
|
-
width: "6.192vw",
|
|
61
|
-
height: "7.998vw",
|
|
62
|
-
},
|
|
63
|
-
end: {
|
|
64
|
-
marginTop: "2.4vw",
|
|
65
|
-
width: "6.192vw",
|
|
66
|
-
height: "7.998vw",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
});
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue-demi";
|
|
2
|
-
import imgEndPoint from "../../assets/icons/svg/end-point.svg";
|
|
3
|
-
import imgStartPoint from "../../assets/icons/svg/start-point.svg";
|
|
4
|
-
import { AmapMarker } from "../../components/AmapMarker";
|
|
5
|
-
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView/GmapAdvancedMarkerView";
|
|
6
|
-
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
7
|
-
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
8
|
-
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
9
|
-
import { createElement, defineSetup } from "../../types/helper";
|
|
10
|
-
import { createDom } from "../../utils/dom";
|
|
11
|
-
import { decodeAsterisk, vec2lnglat } from "../../utils/transform";
|
|
12
|
-
import * as css from "./StartEndPoint.css";
|
|
13
|
-
|
|
14
|
-
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
15
|
-
type: "start" | "end";
|
|
16
|
-
position: [number, number];
|
|
17
|
-
title?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
}
|
|
20
|
-
export const AStartEndPoint = defineSetup(function AStartEndPoint(
|
|
21
|
-
props: StartEndPointProps<AmapOverlay>
|
|
22
|
-
) {
|
|
23
|
-
useMapLog(props, "AStartEndPoint");
|
|
24
|
-
const contentRef = computed(() => {
|
|
25
|
-
const icon = props.type === "start" ? imgStartPoint : imgEndPoint;
|
|
26
|
-
const descriptionRow = !props.description
|
|
27
|
-
? ""
|
|
28
|
-
: decodeAsterisk(props.description)
|
|
29
|
-
.map((item) =>
|
|
30
|
-
item.type === "normal"
|
|
31
|
-
? item.value
|
|
32
|
-
: `<span class="${css.pointInfoBoxEmphasize}">${item.value}</span>`
|
|
33
|
-
)
|
|
34
|
-
.join("");
|
|
35
|
-
if (!props.description && !props.title)
|
|
36
|
-
return `<img src="${icon}" class="${css.pointIcon({ type: props.type })}">`;
|
|
37
|
-
if (!props.description)
|
|
38
|
-
return `
|
|
39
|
-
<div class="${css.pointLayout}">
|
|
40
|
-
<div class="${css.pointSingleInfoBox}">${props.title}</div>
|
|
41
|
-
<img src="${icon}" class="${css.pointIcon({ type: props.type })}">
|
|
42
|
-
</div>
|
|
43
|
-
`;
|
|
44
|
-
return `
|
|
45
|
-
<div class="${css.pointLayout}">
|
|
46
|
-
<div class="${css.pointInfoBox}">
|
|
47
|
-
<div class="${css.pointInfoBoxTitle}">${props.title ?? ""}</div>
|
|
48
|
-
<div class="${css.pointInfoBoxDescription}">${descriptionRow}</div>
|
|
49
|
-
</div>
|
|
50
|
-
<img src="${icon}" class="${css.pointIcon({ type: props.type })}">
|
|
51
|
-
</div>
|
|
52
|
-
`;
|
|
53
|
-
});
|
|
54
|
-
return () => (
|
|
55
|
-
<AmapMarker
|
|
56
|
-
registerOverlay={props.registerOverlay}
|
|
57
|
-
position={props.position}
|
|
58
|
-
content={contentRef.value}
|
|
59
|
-
anchor={"bottom-center"}
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
export const GStartEndPoint = defineSetup(function GStartEndPoint(
|
|
65
|
-
props: StartEndPointProps<GmapOverlay>
|
|
66
|
-
) {
|
|
67
|
-
useMapLog(props, "GStartEndPoint");
|
|
68
|
-
const contentRef = computed(() => {
|
|
69
|
-
const icon = props.type === "start" ? imgStartPoint : imgEndPoint;
|
|
70
|
-
const descriptionRow = !props.description
|
|
71
|
-
? ""
|
|
72
|
-
: decodeAsterisk(props.description)
|
|
73
|
-
.map((item) =>
|
|
74
|
-
item.type === "normal"
|
|
75
|
-
? item.value
|
|
76
|
-
: `<span class="${css.pointInfoBoxEmphasize}">${item.value}</span>`
|
|
77
|
-
)
|
|
78
|
-
.join("");
|
|
79
|
-
if (!props.description && !props.title)
|
|
80
|
-
return createDom("img", { class: css.pointIcon({ type: props.type }), src: icon });
|
|
81
|
-
if (!props.description)
|
|
82
|
-
return createDom(
|
|
83
|
-
"div",
|
|
84
|
-
{ class: css.pointLayout },
|
|
85
|
-
`
|
|
86
|
-
<div class="${css.pointSingleInfoBox}">${props.title}</div>
|
|
87
|
-
<img src="${icon}" class="${css.pointIcon({ type: props.type })}">
|
|
88
|
-
`
|
|
89
|
-
);
|
|
90
|
-
return createDom(
|
|
91
|
-
"div",
|
|
92
|
-
{ class: css.pointLayout },
|
|
93
|
-
`
|
|
94
|
-
<div class="${css.pointInfoBox}">
|
|
95
|
-
<div class="${css.pointInfoBoxTitle}">${props.title ?? ""}</div>
|
|
96
|
-
<div class="${css.pointInfoBoxDescription}">${descriptionRow}</div>
|
|
97
|
-
</div>
|
|
98
|
-
<img src="${icon}" class="${css.pointIcon({ type: props.type })}">
|
|
99
|
-
`
|
|
100
|
-
);
|
|
101
|
-
});
|
|
102
|
-
return () => {
|
|
103
|
-
return (
|
|
104
|
-
<GmapAdvancedMarkerView
|
|
105
|
-
registerOverlay={props.registerOverlay}
|
|
106
|
-
position={vec2lnglat(props.position)}
|
|
107
|
-
content={contentRef.value}
|
|
108
|
-
/>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
export const StartEndPoint = defineSetup(function StartEndPoint(
|
|
114
|
-
props: StartEndPointProps<AmapOverlay> | StartEndPointProps<GmapOverlay>
|
|
115
|
-
) {
|
|
116
|
-
const payload = useMapSupplier();
|
|
117
|
-
return () => {
|
|
118
|
-
return createElement(payload.supplier === "gmap" ? GStartEndPoint : AStartEndPoint, {
|
|
119
|
-
attrs: props,
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./StartEndPoint";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { style } from "@vanilla-extract/css";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
pointInfoBoxEmphasize,
|
|
5
|
-
pointLayout,
|
|
6
|
-
pointSingleInfoBox,
|
|
7
|
-
} from "../StartEndPoint/StartEndPoint.css";
|
|
8
|
-
|
|
9
|
-
export const taxiCarLayout = style({});
|
|
10
|
-
|
|
11
|
-
export const carIcon = style({
|
|
12
|
-
marginTop: "1.87vw",
|
|
13
|
-
marginBottom: "-5.5vw",
|
|
14
|
-
width: "6vw",
|
|
15
|
-
height: "11vw",
|
|
16
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue-demi";
|
|
2
|
-
import imgTaxicar from "../../assets/icons/svg/taxi-car.svg";
|
|
3
|
-
import { AmapMarker } from "../../components/AmapMarker";
|
|
4
|
-
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView/GmapAdvancedMarkerView";
|
|
5
|
-
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
6
|
-
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
7
|
-
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
8
|
-
import { createElement, defineSetup } from "../../types/helper";
|
|
9
|
-
import { createDom } from "../../utils/dom";
|
|
10
|
-
import { decodeAsterisk, vec2lnglat } from "../../utils/transform";
|
|
11
|
-
import * as css from "./TaxiCar.css";
|
|
12
|
-
|
|
13
|
-
export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
14
|
-
position: [number, number];
|
|
15
|
-
angle?: number;
|
|
16
|
-
title?: string;
|
|
17
|
-
}
|
|
18
|
-
export const ATaxiCar = defineSetup(function ATaxiCar(props: TaxiCarProps<AmapOverlay>) {
|
|
19
|
-
useMapLog(props, "ATaxiCar");
|
|
20
|
-
const contentRef = computed(() => {
|
|
21
|
-
const titleRow = !props.title
|
|
22
|
-
? ""
|
|
23
|
-
: decodeAsterisk(props.title)
|
|
24
|
-
.map((item) =>
|
|
25
|
-
item.type === "normal"
|
|
26
|
-
? item.value
|
|
27
|
-
: `<span class="${css.pointInfoBoxEmphasize}">${item.value}</span>`
|
|
28
|
-
)
|
|
29
|
-
.join("");
|
|
30
|
-
const carStyle = `transform:rotate(${props.angle ?? 0}deg)`;
|
|
31
|
-
if (!props.title) return `<img src="${imgTaxicar}" class="${css.carIcon}" style="${carStyle}">`;
|
|
32
|
-
return `
|
|
33
|
-
<div class="${css.pointLayout}">
|
|
34
|
-
<div class="${css.pointSingleInfoBox}">${titleRow}</div>
|
|
35
|
-
<img src="${imgTaxicar}" class="${css.carIcon}" style="${carStyle}">
|
|
36
|
-
</div>
|
|
37
|
-
`;
|
|
38
|
-
});
|
|
39
|
-
return () => (
|
|
40
|
-
<AmapMarker
|
|
41
|
-
position={props.position}
|
|
42
|
-
content={contentRef.value}
|
|
43
|
-
anchor={"bottom-center"}
|
|
44
|
-
registerOverlay={props.registerOverlay}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export const GTaxiCar = defineSetup(function GTaxiCar(props: TaxiCarProps<GmapOverlay>) {
|
|
50
|
-
useMapLog(props, "GTaxiCar");
|
|
51
|
-
const contentRef = computed(() => {
|
|
52
|
-
const titleRow = !props.title
|
|
53
|
-
? ""
|
|
54
|
-
: decodeAsterisk(props.title)
|
|
55
|
-
.map((item) =>
|
|
56
|
-
item.type === "normal"
|
|
57
|
-
? item.value
|
|
58
|
-
: `<span class="${css.pointInfoBoxEmphasize}">${item.value}</span>`
|
|
59
|
-
)
|
|
60
|
-
.join("");
|
|
61
|
-
const carStyle = `transform:rotate(${props.angle ?? 0}deg)`;
|
|
62
|
-
if (!props.title)
|
|
63
|
-
return createDom("img", { class: css.carIcon, src: imgTaxicar, style: carStyle });
|
|
64
|
-
return createDom(
|
|
65
|
-
"div",
|
|
66
|
-
{ class: css.pointLayout },
|
|
67
|
-
`
|
|
68
|
-
<div class="${css.pointSingleInfoBox}">${titleRow}</div>
|
|
69
|
-
<img src="${imgTaxicar}" class="${css.carIcon}" style="${carStyle}">
|
|
70
|
-
`
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
return () => {
|
|
74
|
-
return (
|
|
75
|
-
<GmapAdvancedMarkerView
|
|
76
|
-
position={vec2lnglat(props.position)}
|
|
77
|
-
content={contentRef.value}
|
|
78
|
-
registerOverlay={props.registerOverlay}
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
export const TaxiCar = defineSetup(function TaxiCar(
|
|
85
|
-
props: TaxiCarProps<AmapOverlay> | TaxiCarProps<GmapOverlay>
|
|
86
|
-
) {
|
|
87
|
-
const payload = useMapSupplier();
|
|
88
|
-
return () => {
|
|
89
|
-
return createElement(payload.supplier === "gmap" ? GTaxiCar : ATaxiCar, {
|
|
90
|
-
attrs: props,
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./TaxiCar";
|