mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 04:30:05 +00:00
Gracefully fallback when icon cannot be loaded
This commit is contained in:
parent
dc284974b3
commit
2fd94c6575
2 changed files with 20 additions and 3 deletions
|
|
@ -88,8 +88,16 @@ void MarkerLayer::Impl::ReloadMarkers()
|
|||
"{}\n{}, {}", marker.name, latitudeString, longitudeString) :
|
||||
fmt::format("{}, {}", latitudeString, longitudeString);
|
||||
|
||||
auto iconInfo = markerManager_->get_icon(marker.iconName);
|
||||
if (iconInfo)
|
||||
{
|
||||
geoIcons_->SetIconTexture(icon, iconInfo->name, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
geoIcons_->SetIconTexture(icon, marker.iconName, 0);
|
||||
}
|
||||
|
||||
geoIcons_->SetIconTexture(icon, marker.iconName, 0);
|
||||
geoIcons_->SetIconLocation(icon, marker.latitude, marker.longitude);
|
||||
geoIcons_->SetIconHoverText(icon, hoverText);
|
||||
geoIcons_->SetIconModulate(icon, marker.iconColor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue