MgLayer::IsVisible() method. There is no method to set actual visibility because it depends on other visibility settings.
To query the actual layer visibility, use theMgLayer::GetVisible() method. To change the visibility setting for a layer, use the MgLayer::SetVisible() method.
To query the visibility setting for a layer, use theMgGroup::GetVisible() method. To change the visibility setting for a layer group, use the MgGroup::SetVisible() method.
To query the visibility setting for a layer group, use theModifying Maps and Layers for details.
To change the layer visibility for a given view scale, modify the layer resource and save it back to the repository. SeeThe following example turns on the visibility for the Roads layer.
$layers = $map->GetLayers();
$roadsLayer = $layers->GetItem('Roads');
$roadsLayer->SetVisible(True);