Clusterer
in package
Please report bugs on https://github.com/matthiasmullie/geo/issues.
Tags
Table of Contents
Methods
- __construct() : mixed
- addCoordinate() : mixed
- getClusters() : array<string|int, Cluster>
- getCoordinates() : array<string|int, Coordinate>
- setMinClusterLocations() : mixed
- Set the minimum amount of locations before clustering.
- setNumberOfClusters() : mixed
- Set an approximate amount of clusters.
- setSaveCoordinates() : mixed
- Enables coordinate saving in clusters.
Methods
__construct()
public
__construct(Bounds $bounds) : mixed
Parameters
- $bounds : Bounds
addCoordinate()
public
addCoordinate(Coordinate $coordinate) : mixed
Parameters
- $coordinate : Coordinate
getClusters()
public
getClusters() : array<string|int, Cluster>
Return values
array<string|int, Cluster>getCoordinates()
public
getCoordinates() : array<string|int, Coordinate>
Return values
array<string|int, Coordinate>setMinClusterLocations()
Set the minimum amount of locations before clustering.
public
setMinClusterLocations(int $limit) : mixed
Parameters
- $limit : int
setNumberOfClusters()
Set an approximate amount of clusters.
public
setNumberOfClusters(int $number) : mixed
Approximate in that it also depends on the viewport: less square = less clusters.
Parameters
- $number : int
setSaveCoordinates()
Enables coordinate saving in clusters.
public
setSaveCoordinates(bool $save) : mixed
Note that while it allows you to retrieve all Coordinate objects in a cluster, this does not scale. At some point, if you keep adding coordinates into clusters, you'll run out of memory because we're saving all those coordinates. If you don't need the exact information of coordinates in a cluster, leave this disabled.
Parameters
- $save : bool