import React from "react"; import { MapProps } from "react-map-gl/maplibre"; import maplibregl, { MapLayerMouseEvent } from "maplibre-gl"; import * as Styled from "./styled"; import * as util from "./util"; import MarkerWithPopup from "./MarkerWithPopup"; /** * The BaseMap component renders a MapLibre map * as well as markers that are declared as child elements of the BaseMap element. * * As BaseMap wraps a react-map-gl Map component, any control which can be added as a child of a react-map-gl map is supported. * See https://visgl.github.io/react-map-gl/docs/api-reference/map to see which react-map-gl * children are shipped by default. Others are also supported. * * Overlays are groups of similar MapLibre markers, e.g. vehicle location * markers, bus stop markers, etc. * * Overlays are automatically added to the overlay control displayed by the * BaseMap. The user uses that control to turn overlays on or off. Only overlays * with an id are added to the control. */ type Props = React.ComponentPropsWithoutRef & { /** A URL, or list of URLs pointing to the vector tile specification which should be used as the main map. */ baseLayer?: string | string[]; /** A list of names to match onto the base layers. Used only if there are multiple entries defined for `BaseLayer` */ baseLayerNames?: string[]; /** A [lat, lon] position to center the map at. */ center?: [number, number]; /** A unique identifier for the map (useful when using MapProvider) */ id?: string; /** An object of props which should be passed down to MapLibre */ mapLibreProps?: MapProps; /** The maximum zoom level the map should allow */ maxZoom?: number; /** A callback method which is fired when the map is clicked with the left mouse button/tapped */ onClick?: (e: MapLayerMouseEvent) => void; /** A callback method which is fired when the layer selector component is clicked with the left mouse button/tapped */ onClickLayerSelector?: () => void; /** A callback method which is fired when the map is clicked with the right mouse button/long tapped */ onContextMenu?: (e: MapLayerMouseEvent) => void; /** A callback method which is fired when the map zoom or map bounds change */ onViewportChanged?: (e: State) => void; /** When set to true, all hidden layers will be removed. No layers will be uncheckable until * it is set to false */ showEverything?: boolean; /** An initial zoom value for the map */ zoom?: number; }; type State = { latitude: number; longitude: number; zoom: number; }; declare const BaseMap: ({ baseLayer, baseLayerNames, center, children, id, mapLibreProps, maxZoom, onClick, onClickLayerSelector, onContextMenu, showEverything, onViewportChanged, style, zoom: initZoom }: Props) => JSX.Element; export default BaseMap; type LayerProps = React.ComponentPropsWithoutRef & { id: string; name?: string; visible?: boolean; }; declare const LayerWrapper: (props: LayerProps) => JSX.Element; export declare const Popup: import("styled-components").StyledComponent void; onClose?: (e: import("@vis.gl/react-maplibre").PopupEvent) => void; children?: React.ReactNode; } & React.RefAttributes>>, any, { autoOffset?: number; }, never>; export { LayerWrapper, MarkerWithPopup, Styled, util }; //# sourceMappingURL=index.d.ts.map