code: function(features, clickPosition, options) {
          options = options || {};
          if(features.length) {
              var point = new OpenLayers.Geometry.Point(clickPosition.lon,
                  clickPosition.lat);
              var feature, resultFeature, dist;
              var minDist = Number.MAX_VALUE;
              for(var i=0; i<features.length; ++i) {
                  feature = features[i];
                  if(feature.geometry) {
                      dist = point.distanceTo(feature.geometry, {edge: false});
                      if(dist < minDist) {
                          minDist = dist;
                          resultFeature = feature;
                          if(minDist == 0) {
                              break;
                          }
                      }
                  }
              }
              
              if(options.hover == true) {
                  this.hoverSelect(resultFeature);
              } else {
                  this.select(resultFeature || features);
              } 
          }
      }
docs: Method: selectBestFeature
  Selects the feature from an array of features that is the best match
  for the click position.
  
  Parameters:
  features - {Array(<OpenLayers.Feature.Vector>)}
  clickPosition - {<OpenLayers.LonLat>}
  options - {Object} additional options for this method
  
  Supported options include:
  hover - {Boolean} Do the selection for the hover handler.