Ensure AlertLayerHandler is initialized prior to loading warnings

This commit is contained in:
Dan Paulat 2024-08-04 23:19:15 -05:00
parent aec52f940d
commit 264cfb9326
3 changed files with 17 additions and 0 deletions

View file

@ -206,6 +206,18 @@ AlertLayer::AlertLayer(std::shared_ptr<MapContext> context,
AlertLayer::~AlertLayer() = default;
void AlertLayer::InitializeHandler()
{
static bool ftt = true;
if (ftt)
{
logger_->debug("Initializing handler");
AlertLayerHandler::Instance();
ftt = false;
}
}
void AlertLayer::Initialize()
{
logger_->debug("Initialize: {}", awips::GetPhenomenonText(p->phenomenon_));

View file

@ -29,6 +29,8 @@ public:
void Render(const QMapLibre::CustomLayerRenderParameters&) override final;
void Deinitialize() override final;
static void InitializeHandler();
signals:
void AlertSelected(const types::TextEventKey& key);

View file

@ -99,6 +99,9 @@ public:
overlayProductView->SetAutoRefresh(autoRefreshEnabled_);
overlayProductView->SetAutoUpdate(autoUpdateEnabled_);
// Initialize AlertLayerHandler
map::AlertLayer::InitializeHandler();
auto& generalSettings = settings::GeneralSettings::Instance();
// Initialize context