@tracktor/map 0.2.2 → 0.3.4

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.
@@ -1,5 +1,5 @@
1
1
  import { Map } from 'mapbox-gl';
2
- import { MarkerMapProps } from '../../types/MarkerMapProps.ts';
2
+ import { MarkerMapProps } from '../../types/MarkerMapProps';
3
3
  export declare const DEFAULT_CENTER_LNG = 2.333;
4
4
  export declare const DEFAULT_CENTER_LAT = 46.8677;
5
5
  /**
@@ -18,7 +18,7 @@ declare const useMarkerMap: ({ markers, loading, center, openPopup, onMapClick,
18
18
  loading: boolean | undefined;
19
19
  map: import('react').RefObject<Map | null>;
20
20
  mapContainer: import('react').RefObject<HTMLDivElement | null>;
21
- markers: import('../../main.ts').MarkerProps[] | undefined;
21
+ markers: import('../../main').MarkerProps[] | undefined;
22
22
  webGLSupported: boolean;
23
23
  };
24
24
  export default useMarkerMap;
@@ -0,0 +1,15 @@
1
+ import { Map } from 'mapbox-gl';
2
+ import { RefObject } from 'react';
3
+ import { MarkerProps } from '../types/MarkerProps.ts';
4
+ type UseAnimationMapProps = {
5
+ map: RefObject<Map | null>;
6
+ disableFlyTo?: boolean;
7
+ flyToDuration?: number;
8
+ zoom?: number;
9
+ fitBounds?: boolean;
10
+ markers?: MarkerProps[];
11
+ fitBoundDuration?: number;
12
+ fitBoundsPadding?: number;
13
+ };
14
+ declare const useAnimationMap: ({ map, disableFlyTo, flyToDuration, zoom, fitBounds, markers, fitBoundDuration, fitBoundsPadding, }: UseAnimationMapProps) => void;
15
+ export default useAnimationMap;
@@ -0,0 +1,8 @@
1
+ import { LngLatLike, Map } from 'mapbox-gl';
2
+ import { RefObject } from 'react';
3
+ type UseMapCenterProps = {
4
+ map: RefObject<Map | null>;
5
+ center?: LngLatLike | number[] | undefined;
6
+ };
7
+ declare const useMapCenter: ({ map, center }: UseMapCenterProps) => void;
8
+ export default useMapCenter;
@@ -0,0 +1,13 @@
1
+ import { Palette } from '@tracktor/design-system';
2
+ import { Map } from 'mapbox-gl';
3
+ import { RefObject } from 'react';
4
+ import { MarkerProps } from '../types/MarkerProps.ts';
5
+ type UseInitializeMapProps = {
6
+ map: RefObject<Map | null>;
7
+ markers?: MarkerProps[];
8
+ palette: Palette;
9
+ setLoadingMapBox: (loading: boolean) => void;
10
+ markersAreInvalid: boolean;
11
+ };
12
+ declare const useMarkers: ({ map, markers, markersAreInvalid, palette, setLoadingMapBox }: UseInitializeMapProps) => void;
13
+ export default useMarkers;
@@ -0,0 +1,8 @@
1
+ import { Map } from 'mapbox-gl';
2
+ import { RefObject } from 'react';
3
+ type UseCorrectedMapClickProps = {
4
+ map: RefObject<Map | null>;
5
+ onMapClick?: (lng: number, lat: number) => void;
6
+ };
7
+ declare const useCorrectedMapClick: ({ map, onMapClick }: UseCorrectedMapClickProps) => void;
8
+ export default useCorrectedMapClick;
@@ -0,0 +1,10 @@
1
+ import { Map } from 'mapbox-gl';
2
+ import { RefObject } from 'react';
3
+ import { MarkerProps } from '../types/MarkerProps';
4
+ type UsePopupsProps = {
5
+ map: RefObject<Map | null>;
6
+ markers?: MarkerProps[];
7
+ openPopup: string | number | undefined;
8
+ };
9
+ declare const usePopups: ({ openPopup, map, markers }: UsePopupsProps) => void;
10
+ export default usePopups;