code: function(event) {
          if((!event || event.zoomChanged) && this.features) {
              var resolution = this.layer.map.getResolution();
              if(resolution != this.resolution || !this.clustersExist()) {
                  this.resolution = resolution;
                  var clusters = [];
                  var feature, clustered, cluster;
                  for(var i=0; i<this.features.length; ++i) {
                      feature = this.features[i];
                      if(feature.geometry) {
                          clustered = false;
                          for(var j=clusters.length-1; j>=0; --j) {
                              cluster = clusters[j];
                              if(this.shouldCluster(cluster, feature)) {
                                  this.addToCluster(cluster, feature);
                                  clustered = true;
                                  break;
                              }
                          }
                          if(!clustered) {
                              clusters.push(this.createCluster(this.features[i]));
                          }
                      }
                  }
                  this.clustering = true;
                  this.layer.removeAllFeatures();
                  this.clustering = false;
                  if(clusters.length > 0) {
                      if(this.threshold > 1) {
                          var clone = clusters.slice();
                          clusters = [];
                          var candidate;
                          for(var i=0, len=clone.length; i<len; ++i) {
                              candidate = clone[i];
                              if(candidate.attributes.count < this.threshold) {
                                  Array.prototype.push.apply(clusters, candidate.cluster);
                              } else {
                                  clusters.push(candidate);
                              }
                          }
                      }
                      this.clustering = true;
                      // A legitimate feature addition could occur during this
                      // addFeatures call.  For clustering to behave well, features
                      // should be removed from a layer before requesting a new batch.
                      this.layer.addFeatures(clusters);
                      this.clustering = false;
                  }
                  this.clusters = clusters;
              }
          }
      }
docs: Method: cluster
  Cluster features based on some threshold distance.
  
  Parameters:
  event - {Object} The event received when cluster is called as a
  result of a moveend event.