docs: function _addLayer(canvas, params, args, method) {
  	var $canvas, data,
  		layers, layer = (params._layer ? args : params);
  
  	// Store arguments object for later use
  	params._args = args;
  
  	// Convert all draggable drawings into jCanvas layers
  	if (params.draggable || params.dragGroups) {
  		params.layer = true;
  		params.draggable = true;
  	}
  
  	// Determine the layer's type using the available information
  	if (!params._method) {
  		if (method) {
  			params._method = method;
  		} else if (params.method) {
  			params._method = $.fn[params.method];
  		} else if (params.type) {
  			params._method = $.fn[maps.drawings[params.type]];
  		}
  	}
  
  	// If layer hasn't been added yet
  	if (params.layer && !params._layer) {
  		// Add layer to canvas
  
  		$canvas = $(canvas);
  
  		data = _getCanvasData(canvas);
  		layers = data.layers;
  
  		// Do not add duplicate layers of same name
  		if (layer.name === null || (isString(layer.name) && data.layer.names[layer.name] === undefined)) {
  
  			// Convert number properties to numbers
  			_coerceNumericProps(params);
  
  			// Ensure layers are unique across canvases by cloning them
  			layer = new jCanvasObject(params);
  			layer.canvas = canvas;
  			// Indicate that this is a layer for future checks
  			layer.layer = true;
  			layer._layer = true;
  			layer._running = {};
  			// If layer stores user-defined data
  			if (layer.data !== null) {
  				// Clone object
  				layer.data = extendObject({}, layer.data);
  			} else {
  				// Otherwise, create data object
  				layer.data = {};
  			}
  			// If layer stores a list of associated groups
  			if (layer.groups !== null) {
  				// Clone list
  				layer.groups = layer.groups.slice(0);
  			} else {
  				// Otherwise, create empty list
  				layer.groups = [];
  			}
  
  			// Update layer group maps
  			_updateLayerName($canvas, data, layer);
  			_updateLayerGroups($canvas, data, layer);
  
  			// Check for any associated jCanvas events and enable them
  			_addLayerEvents($canvas, data, layer);
  
  			// Optionally enable drag-and-drop support and cursor support
  			_enableDrag($canvas, data, layer);
  
  			// Copy _event property to parameters object
  			params._event = layer._event;
  
  			// Calculate width/height for text layers
  			if (layer._method === $.fn.drawText) {
  				$canvas.measureText(layer);
  			}
  
  			// Add layer to end of array if no index is specified
  			if (layer.index === null) {
  				layer.index = layers.length;
  			}
  
  			// Add layer to layers array at specified index
  			layers.splice(layer.index, 0, layer);
  
  			// Store layer on parameters object
  			params._args = layer;
  
  			// Trigger an 'add' event
  			_triggerLayerEvent($canvas, data, layer, 'add');
  
  		}
  
  	} else if (!params.layer) {
  		_coerceNumericProps(params);
  	}
  
  	return layer;
  }