OpenLayers.Strategy.CenteredCluster

Strategy for vector feature clustering.

NOTE: This code includes a patch for OpenLayers.Layer.Vector.getDataExtent function.

Inherits from

  • <OpenLayers.Strategy>
Summary
OpenLayers.Strategy.CenteredClusterStrategy for vector feature clustering.
Properties
centered{Boolean}
enabled{Boolean}
zoomSettings{Boolean}
candidateMatches{Function}
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.
Constructor
OpenLayers.Strategy.CenteredClusterCreate a new CenteredCluster strategy.
Functions
activateActivate the strategy.
deactivateDeactivate the strategy.
OpenLayers.Layer.VectorInstances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Functions
getDataExtentCalculates the max extent which includes all of the features, even if they are clustered.

Properties

centered

{Boolean}

enabled

{Boolean}

zoomSettings

{Boolean}

candidateMatches

{Function}

distance

{Integer} Pixel distance between features that should be considered a single cluster.  Default is 20 pixels.

threshold

{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)

Constructor

OpenLayers.Strategy.CenteredCluster

Create a new CenteredCluster strategy.

Parameters

options{Object} Optional object whose properties will be set on the instance.

Functions

activate

activate: function()

Activate the strategy.  Register any listeners, do appropriate setup.

Returns

{Boolean} The strategy was successfully activated.

deactivate

deactivate: function()

Deactivate the strategy.  Unregister any listeners, do appropriate tear-down.

Returns

{Boolean} The strategy was successfully deactivated.

OpenLayers.Layer.Vector

Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.  Create a new vector layer with the OpenLayers.Layer.Vector constructor.

Inherits from

  • <OpenLayers.Layer>
Summary
Functions
getDataExtentCalculates the max extent which includes all of the features, even if they are clustered.

Functions

getDataExtent

OpenLayers.Layer.Vector.prototype.getDataExtent = function()

Calculates the max extent which includes all of the features, even if they are clustered.

Returns

{<OpenLayers.Bounds>} or null if the layer has no features with geometries.

activate: function()
Activate the strategy.
deactivate: function()
Deactivate the strategy.
OpenLayers.Layer.Vector.prototype.getDataExtent = function()
Calculates the max extent which includes all of the features, even if they are clustered.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Close