Nav: only open map once (#21650)

old-commit-hash: f9f43578d1
commatwo_master
Willem Melching 4 years ago committed by GitHub
parent 7a9659a9f7
commit 40fe85f18e
  1. 6
      selfdrive/ui/qt/maps/map.cc
  2. 1
      selfdrive/ui/qt/maps/map.h

@ -278,7 +278,12 @@ void MapWindow::recomputeRoute() {
if (*new_destination != nav_destination) { if (*new_destination != nav_destination) {
qWarning() << "Got new destination from NavDestination param" << *new_destination; qWarning() << "Got new destination from NavDestination param" << *new_destination;
// Only open the map on setting destination the first time
if (allow_open) {
setVisible(true); // Show map on destination set/change setVisible(true); // Show map on destination set/change
allow_open = false;
}
// TODO: close sidebar // TODO: close sidebar
should_recompute = true; should_recompute = true;
@ -375,6 +380,7 @@ void MapWindow::clearRoute() {
map_instructions->hideIfNoError(); map_instructions->hideIfNoError();
map_eta->setVisible(false); map_eta->setVisible(false);
allow_open = true;
} }

@ -111,6 +111,7 @@ private:
bool localizer_valid = false; bool localizer_valid = false;
// Route // Route
bool allow_open = true;
bool gps_ok = false; bool gps_ok = false;
QGeoServiceProvider *geoservice_provider; QGeoServiceProvider *geoservice_provider;
QGeoRoutingManager *routing_manager; QGeoRoutingManager *routing_manager;

Loading…
Cancel
Save