Group by layer.