diff --git a/src/ui/map/QGCMapToolBar.cc b/src/ui/map/QGCMapToolBar.cc index 067544bcd228941c50a5aeadeab70ef6dac2a9d4..c9596efafa68cd06694906b8393c22332ddd3b36 100644 --- a/src/ui/map/QGCMapToolBar.cc +++ b/src/ui/map/QGCMapToolBar.cc @@ -60,18 +60,27 @@ void QGCMapToolBar::setMap(QGCMapWidget* map) action = mapTypesMenu.addAction(tr("Bing Hybrid"),this,SLOT(setMapType())); action->setData(MapType::BingHybrid); action->setCheckable(true); +#ifdef MAP_DEFAULT_TYPE_BING + action->setChecked(true); +#endif mapTypesGroup->addAction(action); action = mapTypesMenu.addAction(tr("Google Hybrid"),this,SLOT(setMapType())); action->setData(MapType::GoogleHybrid); action->setCheckable(true); +#ifdef MAP_DEFAULT_TYPE_GOOGLE + action->setChecked(true); +#endif mapTypesGroup->addAction(action); action = mapTypesMenu.addAction(tr("OpenStreetMap"),this,SLOT(setMapType())); action->setData(MapType::OpenStreetMap); action->setCheckable(true); +#ifdef MAP_DEFAULT_TYPE_OSM + action->setChecked(true); +#endif mapTypesGroup->addAction(action); - //TODO check current item + optionsMenu.addMenu(&mapTypesMenu); diff --git a/src/ui/map/QGCMapWidget.cc b/src/ui/map/QGCMapWidget.cc index 748d1c2dfbb0b1d3729ae083f4fbe32a7b896e4d..8e2e82165eaa91d7efcc0f16b417a2c779f03c68 100644 --- a/src/ui/map/QGCMapWidget.cc +++ b/src/ui/map/QGCMapWidget.cc @@ -34,7 +34,13 @@ QGCMapWidget::QGCMapWidget(QWidget *parent) : //this->SetShowTileGridLines(true); //default appears to be Google Hybrid, and is broken currently +#if defined MAP_DEFAULT_TYPE_BING this->SetMapType(MapType::BingHybrid); +#elif defined MAP_DEFAULT_TYPE_GOOGLE + this->SetMapType(MapType::GoogleHybrid); +#else + this->SetMapType(MapType::OpenStreetMap); +#endif this->setContextMenuPolicy(Qt::ActionsContextMenu); diff --git a/src/ui/map/QGCMapWidget.h b/src/ui/map/QGCMapWidget.h index 8657ede17aa6eac6a9a9876c78550d79b9b1583a..2f169a9ef427a9a5f8746d90a2f64ddeab1a854c 100644 --- a/src/ui/map/QGCMapWidget.h +++ b/src/ui/map/QGCMapWidget.h @@ -5,6 +5,11 @@ #include #include "../../../libs/opmapcontrol/opmapcontrol.h" +// Choose one default map type +#define MAP_DEFAULT_TYPE_BING +//#define MAP_DEFAULT_TYPE_GOOGLE +//#define MAP_DEFAULT_TYPE_OSM + class UASInterface; class UASWaypointManager; class Waypoint;