From fe1eb7e99f424bb6fa0a80393f199a68bd51961a Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Mon, 26 Jul 2021 14:56:53 +0200 Subject: [PATCH] nav: show error when route request fails old-commit-hash: f6b7128741f01c383b31dbd7d3241f26f1e23070 --- selfdrive/ui/qt/maps/map.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index 37545f0069..fec673ac16 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -147,7 +147,7 @@ void MapWindow::timerUpdate() { loaded_once = loaded_once || m_map->isFullyLoaded(); if (!loaded_once) { - map_instructions->showError("Map loading"); + map_instructions->showError("Map Loading"); return; } @@ -343,6 +343,7 @@ void MapWindow::calculateRoute(QMapbox::Coordinate destination) { } void MapWindow::routeCalculated(QGeoRouteReply *reply) { + bool got_route = false; if (reply->error() == QGeoRouteReply::NoError) { if (reply->routes().size() != 0) { qWarning() << "Got route response"; @@ -357,6 +358,7 @@ void MapWindow::routeCalculated(QGeoRouteReply *reply) { navSource["data"] = QVariant::fromValue(feature); m_map->updateSource("navSource", navSource); m_map->setLayoutProperty("navLayer", "visibility", "visible"); + got_route = true; updateETA(); } else { @@ -366,6 +368,10 @@ void MapWindow::routeCalculated(QGeoRouteReply *reply) { qWarning() << "Got error in route reply" << reply->errorString(); } + if (!got_route) { + map_instructions->showError("Failed to Route"); + } + reply->deleteLater(); }