code: function(targets) {
          this.targets = [];
          if(targets && targets.length) {
              var target;
              for(var i=0, len=targets.length; i<len; ++i) {
                  target = targets[i];
                  if(target instanceof OpenLayers.Layer.Vector) {
                      this.addTargetLayer(target);
                  } else {
                      this.addTarget(target);
                  }
              }
          }
      }
docs: Method: setTargets
  Set the targets for the snapping agent.
  
  Parameters:
  targets - {Array} An array of target configs or target layers.