accept a separate layer name argument

I needed this patch to get the layer name of the data source I was using.