react-native-maps-markercluster
Version:
React Native Map Clustering both for Android and iOS
72 lines (71 loc) • 2.69 kB
TypeScript
import type { ReactNode } from 'react';
import type { LayoutAnimationConfig } from 'react-native';
import type { MarkerPressEvent } from 'react-native-maps';
import type Supercluster from 'supercluster';
export declare namespace MarkerClusterType {
type Size = 'small' | 'medium' | 'large';
type StyleProp = string | ((size: Size) => string);
type Cluster = ReturnType<Supercluster['getClusters']>[number];
type ClusterChildren = ReturnType<Supercluster['getLeaves']>;
type SpiderMarker = Cluster & {
index: number;
latitude: number;
longitude: number;
centerPoint: {
latitude: number;
longitude: number;
};
};
type WrapperProps = {
readonly radius?: number;
readonly clusteringEnabled?: boolean;
readonly spiralEnabled?: boolean;
readonly animationEnabled?: boolean;
readonly preserveClusterPressBehavior?: boolean;
readonly tracksViewChanges?: boolean;
readonly layoutAnimationConf?: LayoutAnimationConfig;
readonly maxZoom?: number;
readonly minZoom?: number;
readonly extent?: number;
readonly nodeSize?: number;
readonly minPoints?: number;
readonly edgePadding?: {
top: number;
left: number;
right: number;
bottom: number;
};
readonly spiderLineColor?: string;
readonly onPressCluster?: (cluster: Cluster, markers?: Cluster[]) => void;
readonly onMarkersChange?: (clusters?: Cluster[]) => void;
readonly renderCluster?: (cluster: any) => ReactNode;
readonly selectedClusterId?: string;
readonly selectedClusterColor?: StyleProp;
readonly clusterWrapperBackgroundColor?: StyleProp;
readonly clusterBackgroundColor?: StyleProp;
readonly clusterTextColor?: StyleProp;
readonly clusterFontFamily?: StyleProp;
readonly children?: ReactNode;
};
type ClusterProps = {
readonly geometry: Cluster['geometry'];
readonly properties: Cluster['properties'];
readonly onPress?: (event: MarkerPressEvent) => void;
readonly clusterWrapperBackgroundColor?: StyleProp;
readonly clusterBackgroundColor?: StyleProp;
readonly clusterTextColor?: StyleProp;
readonly clusterFontFamily?: StyleProp;
readonly tracksViewChanges?: boolean;
};
type GeoJSONFeature = {
type: 'Feature';
geometry: {
coordinates: [number, number];
type: 'Point';
};
properties: {
point_count: number;
index: number;
};
};
}