enable having markers without names

This commit is contained in:
AdenKoperczak 2024-12-09 16:24:52 -05:00
parent 5d8f3786de
commit d8233a2c41

View file

@ -190,17 +190,14 @@ void MarkerManager::Impl::ReadMarkerSettings()
{ {
auto record = boost::json::value_to<MarkerRecord>(markerEntry); auto record = boost::json::value_to<MarkerRecord>(markerEntry);
if (!record.markerInfo_.name.empty()) types::MarkerId id = NewId();
{ size_t index = markerRecords_.size();
types::MarkerId id = NewId(); record.markerInfo_.id = id;
size_t index = markerRecords_.size(); markerRecords_.emplace_back(
record.markerInfo_.id = id; std::make_shared<MarkerRecord>(record.markerInfo_));
markerRecords_.emplace_back( idToIndex_.emplace(id, index);
std::make_shared<MarkerRecord>(record.markerInfo_));
idToIndex_.emplace(id, index);
self_->add_icon(record.markerInfo_.iconName, true); self_->add_icon(record.markerInfo_.iconName, true);
}
} }
catch (const std::exception& ex) catch (const std::exception& ex)
{ {