import type { MMapEntity } from "../../.."; import type { LngLat } from "../../../common/types"; import type { ClustererObject, Feature, IClusterMethod } from "./interface"; /** * MMapClusterer props */ type MMapClustererProps = { /** Clusterisation method */ method: IClusterMethod; /** Features */ features: Feature[]; /** Function to create marker for point*/ marker: (feature: Feature) => MMapEntity; /** Function to create marker for cluster*/ cluster: (coordinates: LngLat, features: Feature[]) => MMapEntity; /** The amount of time that may be passed before the render method can be called again */ tickTimeout?: number; /** Return false, if you want to override the render */ onRender?: (clusters: ClustererObject[]) => void | false; /** * Maximum zoom for clusterisation. * If map zoom is bigger, markers will be displayed as is. **/ maxZoom?: number; }; type DefaultProps = typeof defaultProps; declare const defaultProps: Readonly<{ tickTimeout: 200; }>; /** * Display clustered features on a map. * @deprecated Package @mappable-world/clusterer@0.0.1 is deprecated. Please use https://www.npmjs.com/package/@mappable-world/mappable-clusterer instead. * @example * ```javascript * const clusterer = new MMapClusterer({ * method: clusterByGrid({gridSize: 64}), * features: POINTS, * marker: (feature) => new MMapMarker({ * coordinates: feature.geometry.coordinates, * source: 'my-source' * } * cluster: (coordinates, cluster) => new MMapMarker({ * coordinates, * source: 'my-source' * } * }); * * map.addChild(new MMapDefaultSchemeLayer()) * .addChild(new MMapFeatureDataSource({id: 'my-source'})) * .addChild(new MMapLayer({source: 'my-source', type: 'markers'})) * .addChild(clusterer); * ``` */ declare class MMapClusterer extends mappable.MMapComplexEntity { static defaultProps: Readonly<{ tickTimeout: 200; }>; static [mappable.overrideKeyReactify]: import("../../../reactify/reactify").CustomReactify false | void) | undefined; marker: (feature: Feature) => import("react").ReactElement>; cluster: (coordinates: LngLat, features: Feature[]) => import("react").ReactElement>; ref?: import("react").Ref false | void) | undefined; marker: (feature: Feature) => import("react").ReactElement>; cluster: (coordinates: LngLat, features: Feature[]) => import("react").ReactElement>; }, {}>> | undefined; key?: import("react").Key | null | undefined; }>>; static [mappable.overrideKeyVuefy]: import("../../../modules/vuefy").CustomVuefyFn; static [mappable.optionsKeyVuefy]: import("../../../modules/vuefy").CustomVuefyOptions; /** All created entities with cluster id*/ private _entitiesCache; /** Viewport entities with cluster id */ private _visibleEntities; /** Store to add entities on a map */ private _container; /** Listener on map update and resize */ private _mapListener; constructor(props: MMapClustererProps); /** * Compare feature coordinates with bounds. * Visible in x2 bounds. * * @param feature * @param bounds * @param projection * @returns either feature belongs to viewport or not */ private _isVisible; /** * Get entity from store or create it * * @param feature * @param entityId * @param length count of entities in the cluster * @returns ready to add to map entity */ private _getEntity; /** * Generate map of new entities based on returned from method objects * * @param nextViewportObjects clustered objects * @returns map of entities for new render */ private _getVisibleEntities; /** * Removes unnecessary entities and adds new to the map * * @param nextVisibleEntities new entities for matching with existing entities */ private _syncVisibleEntities; private _render; protected _onAttach(): void; protected _onDetach(): void; protected _onUpdate(): void; } export { MMapClusterer, MMapClustererProps };