Fix issue with the TileProviderByLevel example when no name is specified

This commit is contained in:
Alexander Bock
2025-08-15 17:50:47 +02:00
parent 559190d7d7
commit f341310419
2 changed files with 8 additions and 3 deletions

View File

@@ -87,8 +87,13 @@ TileProviderByLevel::TileProviderByLevel(const ghoul::Dictionary& dictionary) {
const std::string provId = tileProviderDict.value<std::string>("Identifier");
tp->setIdentifier(provId);
const std::string providerName = tileProviderDict.value<std::string>("Name");
tp->setGuiName(providerName);
if (tileProviderDict.hasValue<std::string>("Name")) {
const std::string providerName = tileProviderDict.value<std::string>("Name");
tp->setGuiName(providerName);
}
else {
tp->setGuiName(provId);
}
addPropertySubOwner(tp.get());
_levelTileProviders.push_back(std::move(tp));