diff --git a/scwx-qt/source/scwx/qt/map/alert_layer.cpp b/scwx-qt/source/scwx/qt/map/alert_layer.cpp index 85429f5e..f00951ec 100644 --- a/scwx-qt/source/scwx/qt/map/alert_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/alert_layer.cpp @@ -206,6 +206,18 @@ AlertLayer::AlertLayer(std::shared_ptr 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_)); diff --git a/scwx-qt/source/scwx/qt/map/alert_layer.hpp b/scwx-qt/source/scwx/qt/map/alert_layer.hpp index abc3f8f2..99609210 100644 --- a/scwx-qt/source/scwx/qt/map/alert_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/alert_layer.hpp @@ -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); diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index 85e1a0a6..e718bc0e 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -99,6 +99,9 @@ public: overlayProductView->SetAutoRefresh(autoRefreshEnabled_); overlayProductView->SetAutoUpdate(autoUpdateEnabled_); + // Initialize AlertLayerHandler + map::AlertLayer::InitializeHandler(); + auto& generalSettings = settings::GeneralSettings::Instance(); // Initialize context