Class: IWRasterBasedClustering

IWRasterBasedClustering

A clustering algorithm which uses a raster with configurable size to cluster points on a map.

new IWRasterBasedClustering()

Default Constructor.

Methods


calculateClusters(hits, zoomLevel)

Returns clusters containing the specified hits. The result is an array of objects describing the clusters. Each cluster has a coordinate and a property hits which is an array of all hits contained in this cluster.
Parameters:
Name Type Description
hits array an array of objects with the hits to cluster
zoomLevel number the zoom level of the map
Returns:
the clusters
Type
array

setOptions(options)

Sets the clustering options. Properties are rasterWidth and rasterHeight, both provided in pixels.

Example:
var clustering = new IWRasterBasedClustering();
clustering.setOptions({
	rasterWidth: 50,
	rasterHeight: 50
});
Parameters:
Name Type Description
options object the options
Returns:
Type
void