OpenSpace.Control.ClusterManager

Facilitates clustering of markers on the default markers layer

Inherits

  • <OpenLayers.Control>

Example

The following example shows how to add this control to the map:

var clusterControl = new OpenSpace.Control.ClusterManager();
osMap.addControl(clusterControl);
clusterControl.activate();
Summary
OpenSpace.Control.ClusterManagerFacilitates clustering of markers on the default markers layer
Properties
OpenSpace marker{Array} Container for markers in default markers layer when control activated.
Parameters for clustering process. globalScale deals with the fact that thepixel of each marker never changes in its holding array (originalMarkers)
Parameters for cluster markers, can be set
Constructor
OpenSpace.Control.ClusterManagerConstructs a new OpenSpace.Control.ClusterManager
Functions
activate
deactivateinherits from OpenLayers.Control and therefore inherits control deactivate
doClustering-called once listener set on activate.

Properties

OpenSpace marker

{Array} Container for markers in default markers layer when control activated.

Parameters for clustering process. globalScale deals with the fact that the

pixel of each marker never changes in its holding array (originalMarkers)

Parameters for cluster markers, can be set

Constructor

OpenSpace.Control.ClusterManager

Constructs a new OpenSpace.Control.ClusterManager

Functions

activate

activate: function(clusterdist)

Parameters

query{number} distance at which a marker will cluster with others.  This is set for the standard OS marker icon(see Map help) but can be configured according to preference.  Default is 30 view port pixels.

inherits from OpenLayers.Control and therefore inherits control activate

deactivate

deactivate: function()

inherits from OpenLayers.Control and therefore inherits control deactivate

doClustering

doClustering: function()

-called once listener set on activate.  Looks at each markers on map Loops though other markers and searches for markers within a certain pixel distance of it.  If it finds them, it creates a cluster marker and removes these and marker from map

activate: function(clusterdist)
deactivate: function()
inherits from OpenLayers.Control and therefore inherits control deactivate
doClustering: function()
-called once listener set on activate.
Close