Strategy for vector feature clustering.
OpenLayers. | Strategy for vector feature clustering. |
Properties | |
distance | {Integer} Pixel distance between features that should be considered a single cluster. |
threshold | {Integer} Optional threshold below which original features will be added to the layer instead of clusters. |
features | {Array(OpenLayers.Feature.Vector)} Cached features. |
clusters | {Array(OpenLayers.Feature.Vector)} Calculated clusters. |
clustering | {Boolean} The strategy is currently clustering features. |
resolution | {Float} The resolution (map units per pixel) of the current cluster set. |
Constructor | |
OpenLayers. | Create a new clustering strategy. |
Functions | |
activate | Activate the strategy. |
deactivate | Deactivate the strategy. |
cacheFeatures | Cache features before they are added to the layer. |
clearCache | Clear out the cached features. |
cluster | Cluster features based on some threshold distance. |
clustersExist | Determine whether calculated clusters are already on the layer. |
shouldCluster | Determine whether to include a feature in a given cluster. |
addToCluster | Add a feature to a cluster. |
createCluster | Given a feature, create a cluster. |
{Integer} Optional threshold below which original features will be added to the layer instead of clusters. For example, a threshold of 3 would mean that any time there are 2 or fewer features in a cluster, those features will be added directly to the layer instead of a cluster representing those features. Default is null (which is equivalent to 1 - meaning that clusters may contain just one feature).
{Array(OpenLayers.Feature.Vector)} Cached features.
{Array(OpenLayers.Feature.Vector)} Calculated clusters.
shouldCluster: function( cluster, feature )
Determine whether to include a feature in a given cluster.
cluster | {OpenLayers.Feature.Vector} A cluster. |
feature | {OpenLayers.Feature.Vector} A feature. |
{Boolean} The feature should be included in the cluster.
addToCluster: function( cluster, feature )
Add a feature to a cluster.
cluster | {OpenLayers.Feature.Vector} A cluster. |
feature | {OpenLayers.Feature.Vector} A feature. |
createCluster: function( feature )
Given a feature, create a cluster.
feature | {OpenLayers.Feature.Vector} |
{OpenLayers.Feature.Vector} A cluster.
Activate the strategy.
activate: function()
Deactivate the strategy.
deactivate: function()
Cache features before they are added to the layer.
cacheFeatures: function( event )
Clear out the cached features.
clearCache: function()
Cluster features based on some threshold distance.
cluster: function( event )
Determine whether calculated clusters are already on the layer.
clustersExist: function()
Determine whether to include a feature in a given cluster.
shouldCluster: function( cluster, feature )
Add a feature to a cluster.
addToCluster: function( cluster, feature )
Given a feature, create a cluster.
createCluster: function( feature )