mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:30:05 +00:00
Move MarkerManager to using an ID system for markers, instead of index
This commit is contained in:
parent
236d7c1e35
commit
7a070b3e7f
8 changed files with 233 additions and 74 deletions
|
|
@ -55,17 +55,13 @@ void MarkerLayer::Impl::ReloadMarkers()
|
|||
|
||||
geoIcons_->StartIcons();
|
||||
|
||||
for (size_t i = 0; i < markerManager->marker_count(); i++)
|
||||
{
|
||||
std::optional<types::MarkerInfo> marker = markerManager->get_marker(i);
|
||||
if (!marker)
|
||||
markerManager->for_each(
|
||||
[this](const types::MarkerInfo& marker)
|
||||
{
|
||||
break;
|
||||
}
|
||||
std::shared_ptr<gl::draw::GeoIconDrawItem> icon = geoIcons_->AddIcon();
|
||||
geoIcons_->SetIconTexture(icon, markerIconName_, 0);
|
||||
geoIcons_->SetIconLocation(icon, marker->latitude, marker->longitude);
|
||||
}
|
||||
std::shared_ptr<gl::draw::GeoIconDrawItem> icon = geoIcons_->AddIcon();
|
||||
geoIcons_->SetIconTexture(icon, markerIconName_, 0);
|
||||
geoIcons_->SetIconLocation(icon, marker.latitude, marker.longitude);
|
||||
});
|
||||
|
||||
geoIcons_->FinishIcons();
|
||||
Q_EMIT self_->NeedsRendering();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue