To query or change any of the basic layer properties like name, label, or group, use the MgLayer::GetProperty() and MgLayer::SetProperty() methods, where Property is one of the layer properties. You must save and refresh the map for the changes to take effect.