@tracktor/map 1.1.1 → 1.2.0

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.
@@ -0,0 +1,13 @@
1
+ import { Feature, FeatureCollection, GeoJsonProperties, Geometry } from 'geojson';
2
+ import { MarkerProps } from '../../types/MarkerProps';
3
+ interface FitBoundsProps {
4
+ markers?: MarkerProps[];
5
+ features?: FeatureCollection<Geometry, GeoJsonProperties> | Feature<Geometry> | Feature<Geometry>[];
6
+ padding?: number;
7
+ duration?: number;
8
+ disableAnimation?: boolean;
9
+ fitBounds?: boolean;
10
+ animationKey?: unknown;
11
+ }
12
+ declare const FitBounds: ({ markers, features, padding, duration, disableAnimation, fitBounds, animationKey, }: FitBoundsProps) => null;
13
+ export default FitBounds;
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { MarkerMapProps } from '../../types/MarkerMapProps';
3
+ declare const _default: import('react').MemoExoticComponent<({ containerStyle, square, loading, height, width, center, zoom, popupMaxWidth, openPopup, openPopupOnHover, markers, fitBounds, fitBoundsPadding, fitBoundDuration, fitBoundsAnimationKey, disableAnimation, mapStyle, onMapClick, baseMapView, cooperativeGestures, doubleClickZoom, projection, theme, features, from, to, profile, itineraryLineStyle, }: MarkerMapProps) => ReactElement>;
4
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { Feature, GeoJsonProperties, LineString } from 'geojson';
2
+ import { MapRef } from 'react-map-gl';
3
+ import { MarkerMapProps } from '../../types/MarkerMapProps';
4
+ declare const useMarkerMap: ({ center, zoom, openPopup, openPopupOnHover, markers, baseMapView, mapStyle: baseMapStyle, projection, cooperativeGestures, doubleClickZoom, theme: themeOverride, from, to, profile, }: MarkerMapProps) => {
5
+ coopGestures: boolean | undefined;
6
+ coreStyle: string | (import('mapbox-gl').StyleSpecification & string);
7
+ dblZoom: boolean | undefined;
8
+ handleMapLoad: () => void;
9
+ handleMarkerClick: (id: string | number, hasTooltip: boolean) => void;
10
+ handleMarkerHover: (id: string | number | null, hasTooltip?: boolean) => void;
11
+ initialCenter: {
12
+ latitude: number;
13
+ longitude: number;
14
+ zoom: number | undefined;
15
+ } | undefined;
16
+ mapRef: import('react').RefObject<MapRef | null>;
17
+ route: Feature<LineString, GeoJsonProperties> | null;
18
+ selected: string | number | null;
19
+ selectedMarker: import('../../main').MarkerProps<Record<string, unknown>> | null;
20
+ setSelected: import('react').Dispatch<import('react').SetStateAction<string | number | null>>;
21
+ };
22
+ export default useMarkerMap;
@@ -0,0 +1,14 @@
1
+ export declare const variantMarkerColor: {
2
+ readonly default: "#009ba6";
3
+ readonly primary: "#3F83F8";
4
+ readonly secondary: "#9C27B0";
5
+ readonly success: "#4CAF50";
6
+ readonly warning: "#FF9800";
7
+ };
8
+ export type VariantMarker = keyof typeof variantMarkerColor;
9
+ interface MarkerProps {
10
+ variant?: string | keyof typeof variantMarkerColor;
11
+ color?: string;
12
+ }
13
+ declare const DefaultMarker: ({ color, variant }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default DefaultMarker;
@@ -0,0 +1,6 @@
1
+ import { Feature, FeatureCollection } from 'geojson';
2
+ interface RenderFeaturesProps {
3
+ features?: Feature | Feature[] | FeatureCollection;
4
+ }
5
+ declare const RenderFeatures: ({ features }: RenderFeaturesProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export default RenderFeatures;
@@ -0,0 +1,9 @@
1
+ export type BaseMapView = "street" | "satellite";
2
+ declare const BASEMAP: {
3
+ readonly satellite: "mapbox://styles/mapbox/satellite-streets-v12";
4
+ readonly street: {
5
+ readonly dark: "mapbox://styles/mapbox/dark-v11";
6
+ readonly light: "mapbox://styles/mapbox/streets-v12";
7
+ };
8
+ };
9
+ export default BASEMAP;
@@ -0,0 +1,18 @@
1
+ import { Theme } from '@tracktor/design-system';
2
+ declare const mapboxGlobalStyles: (theme: Theme) => {
3
+ ".mapboxgl-popup-close-button": {
4
+ color: string;
5
+ fontSize: string;
6
+ };
7
+ ".mapboxgl-popup-content": {
8
+ backgroundColor: string;
9
+ borderRadius: string;
10
+ boxShadow: string;
11
+ padding: string;
12
+ width: string;
13
+ };
14
+ ".mapboxgl-popup-tip": {
15
+ borderTopColor: string;
16
+ };
17
+ };
18
+ export default mapboxGlobalStyles;
@@ -0,0 +1,5 @@
1
+ export interface MapContextProps {
2
+ licenseMuiX?: string;
3
+ licenceMapbox?: string;
4
+ }
5
+ export declare const MapContext: import('react').Context<MapContextProps>;
@@ -1,11 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
- interface MapProviderContextProps {
3
- licenseMuiX?: string;
4
- licenceMapbox?: string;
5
- }
6
- export interface MapProviderProps extends MapProviderContextProps {
2
+ import { MapContextProps } from './MapContext.tsx';
3
+ export interface MapProviderProps extends MapContextProps {
7
4
  children: ReactNode;
8
5
  }
9
- export declare const MapProviderContext: import('react').Context<MapProviderContextProps>;
10
6
  export declare const MapProvider: ({ children, licenseMuiX, licenceMapbox }: MapProviderProps) => import("react/jsx-runtime").JSX.Element;
11
7
  export default MapProvider;
package/dist/main.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from './components/MarkerMap/MarkerMap';
2
- export { default as MarkerMap } from './components/MarkerMap/MarkerMap';
3
1
  export { DEFAULT_CENTER_LAT, DEFAULT_CENTER_LNG } from './constants/coordinates.ts';
4
2
  export * from './context/MapProvider';
5
3
  export { default as MapProvider } from './context/MapProvider';
4
+ export * from './Features/MarkerMap/MarkerMap.tsx';
5
+ export { default as MarkerMap } from './Features/MarkerMap/MarkerMap.tsx';
6
6
  export * from './types/MarkerMapProps';
7
7
  export * from './types/MarkerProps';
8
8
  export * from './utils/isValidLatLng';