Strategy for vector feature clustering.
| OpenLayers. Strategy. Cluster | Strategy for vector feature clustering. |
| Properties | |
| layer | {OpenLayers.Layer.Vector} The layer that this strategy is assigned to. |
| distance | {Integer} Pixel distance between features that should be considered a single cluster. |
| 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. Strategy. Cluster | 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. |
{OpenLayers.Layer.Vector} The layer that this strategy is assigned to.
{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()
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 )