import type L from 'leaflet'; interface LatLng { lat: number; lng: number; } declare type CollisionResolutionStrategy = 'nearest' | 'average' | 'weightedAverage' | 'merge' | 'discard' | 'custom'; interface PointClustererOptions { thresholdFactor: number; maxPointRange: number; collisionResolution: CollisionResolutionStrategy; callback?: ((...params: any) => void) | null; customCollisionResolver?: ((...params: any) => LatLng) | null; } interface RequiredProperty { point: LatLng; [key: string]: any; } export declare class PointClusterer { private map; private originalPoints; private options; private rBush; private pointData; constructor(map: L.Map, originalPoints: RequiredProperty[], options: PointClustererOptions); private init; private getProcessedData; private updatePoints; private calculateThreshold; private douglasPeucker; private distanceToLineSegment; private distanceBetweenPoints; private processPoints; private resolveCollision; /** * 将新点与所有与其发生碰撞的点合并为一个新的点,位置取所有碰撞点的中心 * @param newPoint * @param collidingPoints * @returns */ private resolveByMerge; /** * 如果新点与已有点发生碰撞,忽略该新点,不添加到地图 * @param newPoint * @param collidingPoints * @returns */ private resolveByDiscard; /** * 用户自定义的碰撞处理策略 * @param newPoint * @param collidingPoints * @returns */ private resolveByCustom; /** * 选择与新点距离加权平均值最小的已存在点集,并以这些点的加权平均位置作为新点 * @param newPoint * @param collidingPoints * @returns */ private resolveByWeightedAverage; /** * 选择与新点距离平均值最小的已存在点集,并以这些点的平均位置作为新点 * @param newPoint * @param collidingPoints * @returns */ private resolveByAverage; /** * 选择与新点距离最近的已存在点 * @param collidingPoints * @param point * @returns */ private findNearest; } export {};