@dossierhq/leaflet
Version:
A library for rendering maps in Dossier with Leaflet.
42 lines (41 loc) • 1.43 kB
TypeScript
import 'leaflet.locatecontrol';
import { type CSSProperties, type FunctionComponent, type JSX } from 'react';
import { type BoundingBox, type Location } from './CoreTypes.js';
import { type MarkerColor } from './MarkerUtils.js';
import type { ZoomMetrics } from './Types.js';
interface MapContainerProps {
className?: string;
style?: CSSProperties;
center: Location;
zoom?: number | null;
minZoom?: number;
/** When changed resets to the provided `center` and `zoom` values. */
resetSignal?: unknown;
maxBoundingBox?: BoundingBox;
onBoundingBoxChanged?: (boundingBox: BoundingBox) => void;
onZoomMetricsChanged?: (zoomMetrics: ZoomMetrics) => void;
children?: React.ReactNode;
}
interface LocateControlProps {
title?: string;
outsideMapBoundsMsg?: string;
showPopup?: boolean;
autoStart?: boolean;
}
interface MarkerProps {
color?: MarkerColor;
location: Location;
tooltip?: JSX.Element | string | null;
onClick?: () => void;
}
interface EditLocationMarkerProps {
value: Location | null;
onChange: (location: Location) => void;
}
interface MapContainerComponent extends FunctionComponent<MapContainerProps> {
LocateControl: FunctionComponent<LocateControlProps>;
Marker: FunctionComponent<MarkerProps>;
EditLocationMarker: FunctionComponent<EditLocationMarkerProps>;
}
export declare const MapContainer: MapContainerComponent;
export {};