@heycar/heycars-map 0.2.0 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite -c vite.config.dev.ts",
@@ -5,7 +5,7 @@ import { AmapMarker } from "../../components/AmapMarker";
5
5
  import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView/GmapAdvancedMarkerView";
6
6
  import { useMapSupplier } from "../../hooks/useMapSupplier";
7
7
  import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
8
- import { createElement, defineSetup } from "../../types/helper";
8
+ import { createElement, defineLagecySetup, defineSetup } from "../../types/helper";
9
9
  import { createDom } from "../../utils/dom";
10
10
  import { decodeAsterisk, vec2lnglat } from "../../utils/transform";
11
11
  import * as css from "./StartEndPoint.css";
@@ -16,7 +16,7 @@ export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
16
16
  title?: string;
17
17
  description?: string;
18
18
  }
19
- export const AStartEndPoint = defineSetup(function AStartEndPoint(
19
+ export const AStartEndPoint = defineLagecySetup(function AStartEndPoint(
20
20
  props: StartEndPointProps<AmapOverlay>
21
21
  ) {
22
22
  const contentRef = computed(() => {
@@ -57,9 +57,9 @@ export const AStartEndPoint = defineSetup(function AStartEndPoint(
57
57
  anchor={"bottom-center"}
58
58
  />
59
59
  );
60
- });
60
+ }).props(["type", "title", "registerOverlay", "position", "description"]);
61
61
 
62
- export const GStartEndPoint = defineSetup(function GStartEndPoint(
62
+ export const GStartEndPoint = defineLagecySetup(function GStartEndPoint(
63
63
  props: StartEndPointProps<GmapOverlay>
64
64
  ) {
65
65
  const contentRef = computed(() => {
@@ -105,7 +105,7 @@ export const GStartEndPoint = defineSetup(function GStartEndPoint(
105
105
  />
106
106
  );
107
107
  };
108
- });
108
+ }).props(["type", "title", "registerOverlay", "position", "description"]);
109
109
 
110
110
  export const StartEndPoint = defineSetup(function StartEndPoint(
111
111
  props: StartEndPointProps<AmapOverlay> | StartEndPointProps<GmapOverlay>
@@ -0,0 +1,6 @@
1
+ import { useMapFitView, UseMapFitViewProps } from "../hooks/useMapFitView";
2
+
3
+ export type UseBusinessMapFitViewProps = Pick<UseMapFitViewProps, "mapRef" | "autoFitTimeout">;
4
+ export const useBusinessMapFitView = (props: UseBusinessMapFitViewProps) => {
5
+ return useMapFitView({ ...props, padding: [25, 20, 15, 15] });
6
+ };
package/src/index.ts CHANGED
@@ -12,12 +12,15 @@ export { WalkingRoute } from "./business-components/WalkingRoute";
12
12
  export { WaveCircle } from "./business-components/WaveCircle";
13
13
  export * from "./components/MapProvider";
14
14
  export * from "./hooks-business/useBusinessMapAutoComplete";
15
+ export * from "./hooks-business/useBusinessMapFitView";
15
16
  export * from "./hooks-business/useBusinessMapRecomendPlace";
16
17
  export { useDrivingRoute } from "./hooks/useDrivingRoute";
17
18
  export { useGeoLocation } from "./hooks/useGeoLocation";
18
19
  export { useHeycarMap } from "./hooks/useHeycarMap";
19
20
  export { useMapAngle } from "./hooks/useMapAngle";
20
21
  export { useMapDrag } from "./hooks/useMapDrag";
22
+ export { useMapFitView } from "./hooks/useMapFitView";
21
23
  export { useMapPlace } from "./hooks/useMapPlace";
22
24
  export { useMapRecomendPlace } from "./hooks/useMapRecomendPlace";
25
+ export { useWalkingRoute } from "./hooks/useWalkingRoute";
23
26
  export * from "./types/interface";