Only add placefile layers if the placefile is enabled

This commit is contained in:
Dan Paulat 2023-11-03 05:43:06 -05:00
parent 7e2fd7c109
commit c81d9d9ba6

View file

@ -859,8 +859,12 @@ void MapWidgetImpl::AddLayer(types::LayerType type,
}
else if (type == types::LayerType::Placefile)
{
// Add the placefile layer
AddPlacefileLayer(std::get<std::string>(description), before);
// If the placefile is enabled, add the placefile layer
std::string placefileName = std::get<std::string>(description);
if (placefileManager_->placefile_enabled(placefileName))
{
AddPlacefileLayer(placefileName, before);
}
}
else if (type == types::LayerType::Information)
{