diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index 83b1f5d118..95b7fb12c0 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -23,10 +23,7 @@ MapWindow::MapWindow(const QMapLibre::Settings &settings) : m_settings(settings) QObject::connect(uiState(), &UIState::uiUpdate, this, &MapWindow::updateState); reinit_timer.setSingleShot(true); - QObject::connect(&reinit_timer, &QTimer::timeout, this, [=] { - m_settings.setApiKey(get_mapbox_token()); - initializeGL(); - }); + QObject::connect(&reinit_timer, &QTimer::timeout, this, &MapWindow::initializeGL); map_overlay = new QWidget (this); map_overlay->setAttribute(Qt::WA_TranslucentBackground, true); @@ -248,6 +245,7 @@ void MapWindow::resizeGL(int w, int h) { } void MapWindow::initializeGL() { + m_settings.setApiKey(get_mapbox_token()); m_map.reset(new QMapLibre::Map(this, m_settings, size(), 1)); if (last_position) {