1.0.8 • Published 26 days ago

pigeon-maps-cluster v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
26 days ago

Cluster component for pigeon-maps

npm version minified minified + gzipped

$ npm install pigeon-maps-cluster --save
import { Map, Marker } from "pigeon-maps";
import { Cluster } from "pigeon-maps-cluster";

const coordinates = [
    [lat,lng],
    [lat,lng],
    [lat,lng]
    ...
]

<Map center={[55.753544, 37.621202]}
     zoom={4}
     width={600}
     height={400}>
    <Cluster>
        {
            coordinates.map(coordinate => <Marker key={coordinate.toString()} anchor={coordinate} />)
        }
    </Cluster>
</Map>

Options

OptionTypeDefaultDescription
minZoomnumber0Minimum zoom level at which clusters are generated.
maxZoomnumber16Maximum zoom level at which clusters are generated.
minPointsnumber2Minimum number of points to form a cluster.
clusterMarkerRadiusnumber40Cluster radius, in pixels. Used for generating cluster and for default cluster size.
onClick(data: ClusterData) => voidundefinedFunction that is called when cluster is clicked.
clusterStyleFunction(pointCount: number, markerPixelOffset?: number, number) => CSSPropertiesundefinedFunction that can help you to modify default cluster view.
clusterRenderFunction(pointCount: number, markerPixelOffset?: number, number) => ReactElementundefinedFunction that can help you to create your own cluster (ignores clusterStyleFunction).
classNamestringundefinedCluster container className.
1.0.8

26 days ago

1.0.7

3 months ago

1.0.6

3 months ago

1.0.5

3 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago