Reuse getSelectedLayer