UNPKG

@deatog/react-google-maps-api

Version:
33 lines (32 loc) 1.6 kB
import { type ReactElement } from 'react'; import { MarkerClusterer, type MarkerClustererOptions } from '@googlemaps/markerclusterer'; export type MarkerClustererOptionsSubset = Omit<MarkerClustererOptions, 'map' | 'markers'>; export type GoogleMarkerClustererProps = { /** Render prop that exposes marker clusterer to children components * * The callback function should return a list of Marker components. */ children: (markerClusterer: MarkerClusterer) => ReactElement<any, any>; /** Subset of {@link MarkerClustererOptions} options * * ``` * { * algorithm?: Algorithm; * renderer?: Renderer; * onClusterClick?: onClusterClickHandler; * } * ``` */ options: MarkerClustererOptionsSubset; /** This callback is called when the clusterer instance has loaded. It is called with the clusterer instance. */ onLoad?: ((clusterer: MarkerClusterer) => void) | undefined; /** This callback is called when the component unmounts. It is called with the clusterer instance. */ onUnload?: ((clusterer: MarkerClusterer) => void) | undefined; }; /** Wrapper around [@googlemaps/markerclusterer](https://github.com/googlemaps/js-markerclusterer) * * Accepts {@link MarkerClustererOptionsSubset} which is a subset of {@link MarkerClustererOptions} */ declare function GoogleMarkerClusterer({ children, options, onLoad, onUnload, }: GoogleMarkerClustererProps): ReactElement<any, any> | undefined; declare const _default: import("react").MemoExoticComponent<typeof GoogleMarkerClusterer>; export default _default;