1.0.8 • Published 1 year ago

pigeon-maps-cluster v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago