code: function(layer, attributes) {
      if(attributes === undefined) {
        attributes = layer;
        layer = 0;
      }
  
      if(layer >= this.getLayerCount() && layer < 0) {
        throw new Error("layer does not exist");
      }
  
      if(typeof(attributes) == 'string') {
        attributes = attributes.split(',');
      }
  
      for(var i = 0; i < attributes.length; ++i) {
        attributes[i] = attributes[i].replace(/ /g, '');
      }
  
      this.layers[layer].options.interactivity = attributes;
      this._definitionUpdated();
      return this;
    }
docs: set interactivity attributes for a layer.
  if attributes are passed as first param layer 0 is
  set