Browse Source

Change map settings to string

QGC4.4
Pierre TILAK 6 years ago
parent
commit
5683020f93
  1. 2
      src/Airmap/AirmapSettings.qml
  2. 5
      src/FlightMap/FlightMap.qml
  3. 6
      src/QtLocationPlugin/GoogleMapProvider.h
  4. 12
      src/QtLocationPlugin/MapProvider.h
  5. 219
      src/QtLocationPlugin/QGCMapUrlEngine.cpp
  6. 6
      src/QtLocationPlugin/QMLControl/OfflineMap.qml
  7. 11
      src/Settings/FlightMap.SettingsGroup.json
  8. 101
      src/Settings/FlightMapSettings.cc
  9. 30
      src/Settings/FlightMapSettings.h
  10. 35
      src/ui/preferences/GeneralSettings.qml

2
src/Airmap/AirmapSettings.qml

@ -681,7 +681,7 @@ Item { @@ -681,7 +681,7 @@ Item {
visible: !QGroundControl.airspaceManager.flightPlan.loadingFlightList && _flightList.count > 0 && tableView.currentRow >= 0
function updateActiveMapType() {
var settings = QGroundControl.settingsManager.flightMapSettings
var fullMapName = settings.mapProvider.enumStringValue + " " + settings.mapType.enumStringValue
var fullMapName = settings.mapProvider.value + " " + settings.mapType.value
for (var i = 0; i < map.supportedMapTypes.length; i++) {
if (fullMapName === map.supportedMapTypes[i].name) {
map.activeMapType = map.supportedMapTypes[i]

5
src/FlightMap/FlightMap.qml

@ -95,7 +95,10 @@ Map { @@ -95,7 +95,10 @@ Map {
function updateActiveMapType() {
var settings = QGroundControl.settingsManager.flightMapSettings
var fullMapName = settings.mapProvider.enumStringValue + " " + settings.mapType.enumStringValue
//var fullMapName = settings.mapProvider.value + " " + settings.mapType.value
var fullMapName = settings.mapProvider.value
console.log("updateActiveMapType",fullMapName)
for (var i = 0; i < _map.supportedMapTypes.length; i++) {
if (fullMapName === _map.supportedMapTypes[i].name) {
_map.activeMapType = _map.supportedMapTypes[i]

6
src/QtLocationPlugin/GoogleMapProvider.h

@ -56,9 +56,9 @@ class GoogleMapProvider : public MapProvider { @@ -56,9 +56,9 @@ class GoogleMapProvider : public MapProvider {
// CycleMap,
// CustomMap = 100
const unsigned int AVERAGE_GOOGLE_STREET_MAP = 4913;
const unsigned int AVERAGE_GOOGLE_SAT_MAP = 56887;
const unsigned int AVERAGE_GOOGLE_TERRAIN_MAP = 19391;
const quint32 AVERAGE_GOOGLE_STREET_MAP = 4913;
const quint32 AVERAGE_GOOGLE_SAT_MAP = 56887;
const quint32 AVERAGE_GOOGLE_TERRAIN_MAP = 19391;
// -----------------------------------------------------------
// Google Street Map

12
src/QtLocationPlugin/MapProvider.h

@ -11,12 +11,12 @@ static const unsigned char pngSignature[] = {0x89, 0x50, 0x4E, 0x47, 0x0D, @@ -11,12 +11,12 @@ static const unsigned char pngSignature[] = {0x89, 0x50, 0x4E, 0x47, 0x0D,
static const unsigned char jpegSignature[] = {0xFF, 0xD8, 0xFF, 0x00};
static const unsigned char gifSignature[] = {0x47, 0x49, 0x46, 0x38, 0x00};
const unsigned int AVERAGE_BING_STREET_MAP = 1297;
const unsigned int AVERAGE_BING_SAT_MAP = 19597;
const unsigned int AVERAGE_MAPBOX_SAT_MAP = 15739;
const unsigned int AVERAGE_MAPBOX_STREET_MAP = 5648;
const unsigned int AVERAGE_TILE_SIZE = 13652;
const unsigned int AVERAGE_AIRMAP_ELEV_SIZE = 2786;
const quint32 AVERAGE_BING_STREET_MAP = 1297;
const quint32 AVERAGE_BING_SAT_MAP = 19597;
const quint32 AVERAGE_MAPBOX_SAT_MAP = 15739;
const quint32 AVERAGE_MAPBOX_STREET_MAP = 5648;
const quint32 AVERAGE_TILE_SIZE = 13652;
const quint32 AVERAGE_AIRMAP_ELEV_SIZE = 2786;
class MapProvider : public QObject {
Q_OBJECT

219
src/QtLocationPlugin/QGCMapUrlEngine.cpp

@ -7,70 +7,72 @@ @@ -7,70 +7,72 @@
*
****************************************************************************/
/**
* @file
* @author Gus Grubba <mavlink@grubba.com>
* Original work: The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* Original work: The OpenPilot Team, http://www.openpilot.org Copyright (C)
* 2012.
*/
//#define DEBUG_GOOGLE_MAPS
#include "AppSettings.h"
#include "QGCApplication.h"
#include "QGCMapEngine.h"
#include "AppSettings.h"
#include "SettingsManager.h"
#include <QRegExp>
#include <QNetworkReply>
#include <QByteArray>
#include <QEventLoop>
#include <QTimer>
#include <QNetworkReply>
#include <QRegExp>
#include <QString>
#include <QByteArray>
#include <QTimer>
//-----------------------------------------------------------------------------
UrlFactory::UrlFactory()
: _timeout(5 * 1000)
{
UrlFactory::UrlFactory() : _timeout(5 * 1000) {
// BingMaps
//_versionBingMaps = "563";
#ifndef QGC_NO_GOOGLE_MAPS
_providersTable["GoogleStreet"] = new GoogleStreetMapProvider(this);
_providersTable["GoogleSatellite"] = new GoogleSatelliteMapProvider(this);
_providersTable["Google Street Map"] = new GoogleStreetMapProvider(this);
_providersTable["Google Satellite"] = new GoogleSatelliteMapProvider(this);
_providersTable["Google Terrain"] = new GoogleTerrainMapProvider(this);
#endif
}
void UrlFactory::registerProvider(QString name, MapProvider* provider){
_providersTable[name]=provider;
void UrlFactory::registerProvider(QString name, MapProvider* provider) {
_providersTable[name] = provider;
}
//-----------------------------------------------------------------------------
UrlFactory::~UrlFactory()
{
}
UrlFactory::~UrlFactory() {}
QString
UrlFactory::getImageFormat(int id, const QByteArray& image)
{
QString UrlFactory::getImageFormat(int id, const QByteArray& image) {
QString type = getTypeFromId(id);
if (_providersTable.find(type) != _providersTable.end()) {
return _providersTable[getTypeFromId(id)]->getImageFormat(image);
} else {
return "";
}
}
//-----------------------------------------------------------------------------
QString
UrlFactory::getImageFormat(QString type, const QByteArray& image)
{
QString UrlFactory::getImageFormat(QString type, const QByteArray& image) {
if (_providersTable.find(type) != _providersTable.end()) {
return _providersTable[type]->getImageFormat(image);
//QString format;
//if(image.size() > 2)
} else {
return "";
}
// QString format;
// if(image.size() > 2)
//{
// if (image.startsWith(reinterpret_cast<const char*>(pngSignature)))
// format = "png";
// else if (image.startsWith(reinterpret_cast<const char*>(jpegSignature)))
// else if (image.startsWith(reinterpret_cast<const
// char*>(jpegSignature)))
// format = "jpg";
// else if (image.startsWith(reinterpret_cast<const char*>(gifSignature)))
// else if (image.startsWith(reinterpret_cast<const
// char*>(gifSignature)))
// format = "gif";
// else {
// switch (type) {
@ -119,40 +121,44 @@ UrlFactory::getImageFormat(QString type, const QByteArray& image) @@ -119,40 +121,44 @@ UrlFactory::getImageFormat(QString type, const QByteArray& image)
// format = "jpg";
// break;
// default:
// qWarning("UrlFactory::getImageFormat() Unknown map id %d", type);
// break;
// qWarning("UrlFactory::getImageFormat() Unknown map id %d",
// type); break;
// }
// }
//}
//return format;
// return format;
}
QNetworkRequest
UrlFactory::getTileURL(int id, int x, int y, int zoom, QNetworkAccessManager* networkManager){
QNetworkRequest UrlFactory::getTileURL(int id, int x, int y, int zoom,
QNetworkAccessManager* networkManager) {
return _providersTable[getTypeFromId(id)]->getTileURL(x,y,zoom,networkManager);
QString type = getTypeFromId(id);
if (_providersTable.find(type) != _providersTable.end()) {
return _providersTable[type]->getTileURL(x, y, zoom, networkManager);
}
return QNetworkRequest(QUrl());
}
//-----------------------------------------------------------------------------
QNetworkRequest
UrlFactory::getTileURL(QString type, int x, int y, int zoom, QNetworkAccessManager* networkManager)
{
return _providersTable[type]->getTileURL(x,y,zoom,networkManager);
QNetworkRequest UrlFactory::getTileURL(QString type, int x, int y, int zoom,
QNetworkAccessManager* networkManager) {
return _providersTable[type]->getTileURL(x, y, zoom, networkManager);
////-- Build URL
//QNetworkRequest request;
//QString url = _getURL(type, x, y, zoom, networkManager);
//if(url.isEmpty()) {
// QNetworkRequest request;
// QString url = _getURL(type, x, y, zoom, networkManager);
// if(url.isEmpty()) {
// return request;
//}
//request.setUrl(QUrl(url));
//request.setRawHeader("Accept", "*/*");
//switch (type) {
// // case GoogleMap:
// // case GoogleSatellite:
// // case GoogleLabels:
// // case GoogleTerrain:
// // case GoogleHybrid:
// // request.setRawHeader("Referrer", "https://www.google.com/maps/preview");
// // break;
// request.setUrl(QUrl(url));
// request.setRawHeader("Accept", "*/*");
// switch (type) {
// // case GoogleMap:
// // case GoogleSatellite:
// // case GoogleLabels:
// // case GoogleTerrain:
// // case GoogleHybrid:
// // request.setRawHeader("Referrer",
// "https://www.google.com/maps/preview");
// // break;
// case BingHybrid:
// case BingMap:
// case BingSatellite:
@ -171,15 +177,17 @@ UrlFactory::getTileURL(QString type, int x, int y, int zoom, QNetworkAccessManag @@ -171,15 +177,17 @@ UrlFactory::getTileURL(QString type, int x, int y, int zoom, QNetworkAccessManag
// break;
// case OpenStreetMap:
// case OpenStreetOsm:
// request.setRawHeader("Referrer", "https://www.openstreetmap.org/");
// break;
// request.setRawHeader("Referrer",
// "https://www.openstreetmap.org/"); break;
// */
// case EsriWorldStreet:
// case EsriWorldSatellite:
// case EsriTerrain: {
// QByteArray token = qgcApp()->toolbox()->settingsManager()->appSettings()->esriToken()->rawValue().toString().toLatin1();
// request.setRawHeader("User-Agent", QByteArrayLiteral("Qt Location based application"));
// QByteArray token =
// qgcApp()->toolbox()->settingsManager()->appSettings()->esriToken()->rawValue().toString().toLatin1();
// request.setRawHeader("User-Agent", QByteArrayLiteral("Qt
// Location based application"));
// request.setRawHeader("User-Token", token);
// }
// return request;
@ -191,8 +199,8 @@ UrlFactory::getTileURL(QString type, int x, int y, int zoom, QNetworkAccessManag @@ -191,8 +199,8 @@ UrlFactory::getTileURL(QString type, int x, int y, int zoom, QNetworkAccessManag
// default:
// break;
//}
//request.setRawHeader("User-Agent", _userAgent);
//return request;
// request.setRawHeader("User-Agent", _userAgent);
// return request;
}
//-----------------------------------------------------------------------------
@ -455,59 +463,62 @@ UrlFactory::_getURL(QString type, int x, int y, int zoom, QNetworkAccessManager* @@ -455,59 +463,62 @@ UrlFactory::_getURL(QString type, int x, int y, int zoom, QNetworkAccessManager*
#endif
//-----------------------------------------------------------------------------
quint32
UrlFactory::averageSizeForType(QString type)
{
quint32 UrlFactory::averageSizeForType(QString type) {
qDebug() << "UrlFactory::averageSizeForType for" << type;
if (_providersTable.find(type) != _providersTable.end()) {
return _providersTable[type]->getAverageSize();
} else {
qDebug() << "UrlFactory::averageSizeForType " << type
<< " Not registered";
}
// switch (type) {
// case GoogleMap:
// return AVERAGE_GOOGLE_STREET_MAP;
// case BingMap:
// return AVERAGE_BING_STREET_MAP;
// case GoogleSatellite:
// return AVERAGE_GOOGLE_SAT_MAP;
// case MapboxSatellite:
// return AVERAGE_MAPBOX_SAT_MAP;
// case BingHybrid:
// case BingSatellite:
// return AVERAGE_BING_SAT_MAP;
// case GoogleTerrain:
// return AVERAGE_GOOGLE_TERRAIN_MAP;
// case MapboxStreets:
// case MapboxStreetsBasic:
// case MapboxRunBikeHike:
// return AVERAGE_MAPBOX_STREET_MAP;
// case AirmapElevation:
// return AVERAGE_AIRMAP_ELEV_SIZE;
// case GoogleLabels:
// case MapboxDark:
// case MapboxLight:
// case MapboxOutdoors:
// case MapboxPencil:
// case OpenStreetMap:
// case GoogleHybrid:
// case MapboxComic:
// case MapboxEmerald:
// case MapboxHighContrast:
// case MapboxHybrid:
// case MapboxPirates:
// case MapboxWheatPaste:
// default:
// break;
// }
// return AVERAGE_TILE_SIZE;
// switch (type) {
// case GoogleMap:
// return AVERAGE_GOOGLE_STREET_MAP;
// case BingMap:
// return AVERAGE_BING_STREET_MAP;
// case GoogleSatellite:
// return AVERAGE_GOOGLE_SAT_MAP;
// case MapboxSatellite:
// return AVERAGE_MAPBOX_SAT_MAP;
// case BingHybrid:
// case BingSatellite:
// return AVERAGE_BING_SAT_MAP;
// case GoogleTerrain:
// return AVERAGE_GOOGLE_TERRAIN_MAP;
// case MapboxStreets:
// case MapboxStreetsBasic:
// case MapboxRunBikeHike:
// return AVERAGE_MAPBOX_STREET_MAP;
// case AirmapElevation:
// return AVERAGE_AIRMAP_ELEV_SIZE;
// case GoogleLabels:
// case MapboxDark:
// case MapboxLight:
// case MapboxOutdoors:
// case MapboxPencil:
// case OpenStreetMap:
// case GoogleHybrid:
// case MapboxComic:
// case MapboxEmerald:
// case MapboxHighContrast:
// case MapboxHybrid:
// case MapboxPirates:
// case MapboxWheatPaste:
// default:
// break;
// }
// return AVERAGE_TILE_SIZE;
}
QString UrlFactory::getTypeFromId(int id){
QString UrlFactory::getTypeFromId(int id) {
QHashIterator<QString, MapProvider*> i(_providersTable);
while(i.hasNext()){
while (i.hasNext()) {
i.next();
if(abs(qHash(i.key())) == id){
if (abs(qHash(i.key())) == id) {
return i.key();
}
}
@ -517,6 +528,4 @@ QString UrlFactory::getTypeFromId(int id){ @@ -517,6 +528,4 @@ QString UrlFactory::getTypeFromId(int id){
// Todo : qHash produce a uint bigger than max(int)
// There is still a low probability for abs to
// generate similar hash for different types
int UrlFactory::getIdFromType(QString type){
return abs(qHash(type));
}
int UrlFactory::getIdFromType(QString type) { return abs(qHash(type)); }

6
src/QtLocationPlugin/QMLControl/OfflineMap.qml

@ -38,7 +38,7 @@ Item { @@ -38,7 +38,7 @@ Item {
property Fact _mapboxFact: _settingsManager ? _settingsManager.appSettings.mapboxToken : null
property Fact _esriFact: _settingsManager ? _settingsManager.appSettings.esriToken : null
property string mapType: _fmSettings ? (_fmSettings.mapProvider.enumStringValue + " " + _fmSettings.mapType.enumStringValue) : ""
property string mapType: _fmSettings ? (_fmSettings.mapProvider.value + " " + _fmSettings.mapType.value) : ""
property bool isMapInteractive: false
property var savedCenter: undefined
property real savedZoom: 3
@ -93,10 +93,10 @@ Item { @@ -93,10 +93,10 @@ Item {
function updateMap() {
for (var i = 0; i < _map.supportedMapTypes.length; i++) {
//console.log(_map.supportedMapTypes[i].name)
console.log(_map.supportedMapTypes[i].name, i)
if (mapType === _map.supportedMapTypes[i].name) {
_map.activeMapType = _map.supportedMapTypes[i]
//console.log("Update Map:" + " " + _map.activeMapType)
console.log("Update Map:" + " " + _map.activeMapType)
handleChanges()
return
}

11
src/Settings/FlightMap.SettingsGroup.json

@ -2,17 +2,12 @@ @@ -2,17 +2,12 @@
{
"name": "mapProvider",
"shortDescription": "Currently selected map provider for flight maps",
"type": "uint32",
"enumStrings": "Bing,Google,Statkart,Mapbox,Esri,Eniro,VWorld",
"enumValues": "0,1,2,3,4,5,6",
"defaultValue": 0
"type": "string"
},
{
"name": "mapType",
"shortDescription": "Currently selected map type for flight maps",
"type": "uint32",
"enumStrings": "Street Map,Satellite Map,Hybrid Map,Terrain Map",
"enumValues": "0,1,2,3",
"defaultValue": 2
"type": "string",
"default": ""
}
]

101
src/Settings/FlightMapSettings.cc

@ -19,106 +19,7 @@ @@ -19,106 +19,7 @@
DECLARE_SETTINGGROUP(FlightMap, "FlightMap")
{
qmlRegisterUncreatableType<FlightMapSettings>("QGroundControl.SettingsManager", 1, 0, "FlightMapSettings", "Reference only");
// Save the original version since we modify based on map provider
_savedMapTypeStrings = _nameToMetaDataMap[mapTypeName]->enumStrings();
_savedMapTypeValues = _nameToMetaDataMap[mapTypeName]->enumValues();
#ifdef QGC_NO_GOOGLE_MAPS
//-- Remove Google
_excludeProvider(mapProviderGoogle);
#endif
if(qgcApp()->toolbox()->settingsManager()->appSettings()->mapboxToken()->rawValue().toString().isEmpty()) {
_excludeProvider(mapProviderMapbox);
}
if(qgcApp()->toolbox()->settingsManager()->appSettings()->esriToken()->rawValue().toString().isEmpty()) {
_excludeProvider(mapProviderEsri);
}
_newMapProvider(mapProvider()->rawValue());
}
DECLARE_SETTINGSFACT(FlightMapSettings, mapProvider)
DECLARE_SETTINGSFACT(FlightMapSettings, mapType)
DECLARE_SETTINGSFACT_NO_FUNC(FlightMapSettings, mapProvider)
{
if (!_mapProviderFact) {
_mapProviderFact = _createSettingsFact(mapProviderName);
connect(_mapProviderFact, &Fact::rawValueChanged, this, &FlightMapSettings::_newMapProvider);
}
return _mapProviderFact;
}
void FlightMapSettings::_excludeProvider(MapProvider_t provider)
{
FactMetaData* metaData = _nameToMetaDataMap[mapProviderName];
QVariantList enumValues = metaData->enumValues();
QStringList enumStrings = metaData->enumStrings();
_removeEnumValue(provider, enumStrings, enumValues);
metaData->setEnumInfo(enumStrings, enumValues);
}
void FlightMapSettings::_removeEnumValue(int value, QStringList& enumStrings, QVariantList& enumValues)
{
bool found = false;
int removeIndex;
for (removeIndex=0; removeIndex<enumValues.count(); removeIndex++) {
if (enumValues[removeIndex].toInt() == value) {
found = true;
break;
}
}
if (found) {
enumValues.removeAt(removeIndex);
enumStrings.removeAt(removeIndex);
}
}
void FlightMapSettings::_newMapProvider(QVariant value)
{
FactMetaData* metaData = _nameToMetaDataMap[mapTypeName];
QStringList enumStrings = _savedMapTypeStrings;
QVariantList enumValues = _savedMapTypeValues;
switch (value.toInt()) {
case mapProviderBing:
_removeEnumValue(mapTypeTerrain, enumStrings, enumValues);
break;
case mapProviderGoogle:
_removeEnumValue(mapTypeHybrid, enumStrings, enumValues);
break;
case mapProviderStarkart:
_removeEnumValue(mapTypeStreet, enumStrings, enumValues);
_removeEnumValue(mapTypeSatellite, enumStrings, enumValues);
_removeEnumValue(mapTypeHybrid, enumStrings, enumValues);
break;
case mapProviderEniro:
_removeEnumValue(mapTypeStreet, enumStrings, enumValues);
_removeEnumValue(mapTypeSatellite, enumStrings, enumValues);
_removeEnumValue(mapTypeHybrid, enumStrings, enumValues);
break;
case mapProviderEsri:
_removeEnumValue(mapTypeHybrid, enumStrings, enumValues);
break;
case mapProviderVWorld:
_removeEnumValue(mapTypeHybrid, enumStrings, enumValues);
_removeEnumValue(mapTypeTerrain, enumStrings, enumValues);
}
metaData->setEnumInfo(enumStrings, enumValues);
emit mapTypeChanged();
// Check that map type is still valid for this new map provider
bool found = false;
int currentMapType = mapType()->rawValue().toInt();
for (int i=0; i<enumValues.count(); i++) {
if (currentMapType == enumValues[i].toInt()) {
found = true;
break;
}
}
if (!found) {
mapType()->setRawValue(0);
}
}

30
src/Settings/FlightMapSettings.h

@ -18,39 +18,9 @@ class FlightMapSettings : public SettingsGroup @@ -18,39 +18,9 @@ class FlightMapSettings : public SettingsGroup
public:
FlightMapSettings(QObject* parent = nullptr);
// This enum must match the json meta data
typedef enum {
mapProviderBing,
mapProviderGoogle,
mapProviderStarkart,
mapProviderMapbox,
mapProviderEsri,
mapProviderEniro,
mapProviderVWorld
} MapProvider_t;
// This enum must match the json meta data
typedef enum {
mapTypeStreet,
mapTypeSatellite,
mapTypeHybrid,
mapTypeTerrain
} MapType_t;
DEFINE_SETTING_NAME_GROUP()
DEFINE_SETTINGFACT(mapProvider)
DEFINE_SETTINGFACT(mapType)
signals:
void mapTypeChanged(void);
private slots:
void _newMapProvider(QVariant value);
private:
void _removeEnumValue(int value, QStringList& enumStrings, QVariantList& enumValues);
void _excludeProvider(MapProvider_t provider);
QStringList _savedMapTypeStrings;
QVariantList _savedMapTypeValues;
};

35
src/ui/preferences/GeneralSettings.qml

@ -38,8 +38,8 @@ Rectangle { @@ -38,8 +38,8 @@ Rectangle {
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 20
property real _comboFieldWidth: ScreenTools.defaultFontPixelWidth * 28
property real _valueFieldWidth: ScreenTools.defaultFontPixelWidth * 10
property Fact _mapProvider: QGroundControl.settingsManager.flightMapSettings.mapProvider
property Fact _mapType: QGroundControl.settingsManager.flightMapSettings.mapType
property string _mapProvider: QGroundControl.settingsManager.flightMapSettings.mapProvider.value
property string _mapType: QGroundControl.settingsManager.flightMapSettings.mapType.value
property Fact _followTarget: QGroundControl.settingsManager.appSettings.followTarget
property real _panelWidth: _root.width * _internalWidthRatio
property real _margins: ScreenTools.defaultFontPixelWidth
@ -160,30 +160,19 @@ Rectangle { @@ -160,30 +160,19 @@ Rectangle {
QGCLabel {
text: qsTr("Map Provider")
width: _labelWidth
visible: _mapProvider.visible
//visible: _mapProvider.visible
}
FactComboBox {
Layout.preferredWidth: _comboFieldWidth
fact: _mapProvider
indexModel: false
visible: _mapProvider.visible
}
QGCLabel {
text: qsTr("Map Type")
visible: _mapType && _mapType.visible
}
FactComboBox {
id: mapTypes
QGCComboBox {
id: mapCombo
model: QGroundControl.mapEngineManager.mapList
Layout.preferredWidth: _comboFieldWidth
fact: _mapType
indexModel: false
visible: _mapType && _mapType.visible
Connections {
target: QGroundControl.settingsManager.flightMapSettings
onMapTypeChanged: {
mapTypes.model = _mapType.enumStrings
onActivated: {
_mapProvider = textAt(index)
QGroundControl.settingsManager.flightMapSettings.mapProvider.value=textAt(index)
}
Component.onCompleted: {
var index = mapCombo.find(_mapProvider)
mapCombo.currentIndex = index
}
}

Loading…
Cancel
Save