Reused _getSelectedLayer