rs-react-native-map-clustering
Version:
React Native Map Clustering both for Android and iOS with TypeScript support
42 lines (41 loc) • 1.59 kB
TypeScript
import React, { ReactNode, MutableRefObject } from 'react';
import { LayoutAnimationConfig } from 'react-native';
import MapView, { MapViewProps, Details } from 'react-native-maps';
import SuperCluster from 'supercluster';
import { Region } from './helpers';
import { Feature as ClusterMapFeature } from './types';
export interface ClusteredMapViewProps extends MapViewProps {
radius?: number;
maxZoom?: number;
minZoom?: number;
minPoints?: number;
extent?: number;
nodeSize?: number;
children?: ReactNode;
onClusterPress?: (cluster: ClusterMapFeature, markers: ClusterMapFeature[]) => void;
onRegionChangeComplete?: (region: Region, markers: ClusterMapFeature[] | Details) => void;
onMarkersChange?: (markers: ClusterMapFeature[]) => void;
preserveClusterPressBehavior?: boolean;
clusteringEnabled?: boolean;
clusterColor?: string;
clusterTextColor?: string;
clusterFontFamily?: string;
spiderLineColor?: string;
layoutAnimationConf?: LayoutAnimationConfig;
animationEnabled?: boolean;
renderCluster?: (props: any) => ReactNode;
tracksViewChanges?: boolean;
spiralEnabled?: boolean;
superClusterRef?: MutableRefObject<SuperCluster | null>;
edgePadding?: {
top: number;
left: number;
right: number;
bottom: number;
};
selectedClusterId?: string;
selectedClusterColor?: string;
mapRef?: (ref: MapView | null) => void;
}
declare const _default: React.NamedExoticComponent<ClusteredMapViewProps & React.RefAttributes<MapView>>;
export default _default;