hides visibility switch when there is only a layer CDB-1256
added tests for layer visibility CDB-1256
Merge CDB-1256 into release/2.8.3