34 : IUAVGadgetConfiguration(classId, parent)
35 , m_mapProvider(
"GoogleHybrid")
37 , m_defaultLatitude(0)
38 , m_defaultLongitude(0)
39 , m_showTileGridLines(false)
40 , m_accessMode(
"ServerAndCache")
41 , m_useMemoryCache(true)
42 , m_cacheLocation(Utils::PathUtils().GetStoragePath() +
"mapscache" + QDir::separator())
43 , m_uavSymbol(QString::fromUtf8(
":/uavs/images/mapquad.png"))
44 , m_maxUpdateRate(2000)
48 , m_geoLanguage(
"autoDetect")
52 if (qSettings !=
nullptr) {
54 QString
mapProvider = qSettings->value(
"mapProvider").toString();
55 int zoom = qSettings->value(
"defaultZoom").toInt();
56 double latitude = qSettings->value(
"defaultLatitude").toDouble();
57 double longitude = qSettings->value(
"defaultLongitude").toDouble();
59 QString
accessMode = qSettings->value(
"accessMode").toString();
61 QString
cacheLocation = qSettings->value(
"cacheLocation").toString();
62 QString
uavSymbol = qSettings->value(
"uavSymbol").toString();
63 int max_update_rate = qSettings->value(
"maxUpdateRate").toInt();
64 float userImageHorizontalScale = qSettings->value(
"userImageHorizontalScale").toFloat();
65 float userImageVerticalScale = qSettings->value(
"userImageVerticalScale").toFloat();
66 QString userImageLocation = qSettings->value(
"userImageLocation").toString();
67 QString language = qSettings->value(
"geolanguage").toString();
68 m_opacity = qSettings->value(
"overlayOpacity", 1).toReal();
70 if (!mapProvider.isEmpty()) {
73 if (!language.isEmpty()) {
74 m_geoLanguage = language;
82 m_userImageHorizontalScale = userImageHorizontalScale;
83 m_userImageVerticalScale = userImageVerticalScale;
84 m_userImageLocation = userImageLocation;
86 m_maxUpdateRate = max_update_rate;
87 if (m_maxUpdateRate < 100 || m_maxUpdateRate > 5000)
88 m_maxUpdateRate = 2000;
90 if (!accessMode.isEmpty())
91 m_accessMode = accessMode;
95 if (!cacheLocation.isEmpty())
104 m->m_mapProvider = m_mapProvider;
105 m->m_defaultZoom = m_defaultZoom;
106 m->m_defaultLatitude = m_defaultLatitude;
107 m->m_defaultLongitude = m_defaultLongitude;
108 m->m_showTileGridLines = m_showTileGridLines;
109 m->m_accessMode = m_accessMode;
110 m->m_useMemoryCache = m_useMemoryCache;
111 m->m_cacheLocation = m_cacheLocation;
112 m->m_uavSymbol = m_uavSymbol;
113 m->m_maxUpdateRate = m_maxUpdateRate;
114 m->m_opacity = m_opacity;
115 m->m_userImageHorizontalScale = m_userImageHorizontalScale;
116 m->m_userImageVerticalScale = m_userImageVerticalScale;
117 m->m_userImageLocation = m_userImageLocation;
118 m->m_geoLanguage = m_geoLanguage;
126 m_settings->setValue(
"mapProvider", m_mapProvider);
127 m_settings->setValue(
"defaultZoom", m_defaultZoom);
128 m_settings->setValue(
"defaultLatitude", m_defaultLatitude);
129 m_settings->setValue(
"defaultLongitude", m_defaultLongitude);
130 m_settings->setValue(
"showTileGridLines", m_showTileGridLines);
131 m_settings->setValue(
"accessMode", m_accessMode);
132 m_settings->setValue(
"useMemoryCache", m_useMemoryCache);
133 m_settings->setValue(
"uavSymbol", m_uavSymbol);
134 m_settings->setValue(
"cacheLocation",
Utils::PathUtils().RemoveStoragePath(m_cacheLocation));
135 m_settings->setValue(
"maxUpdateRate", m_maxUpdateRate);
136 m_settings->setValue(
"overlayOpacity", m_opacity);
137 m_settings->setValue(
"userImageHorizontalScale", m_userImageHorizontalScale);
138 m_settings->setValue(
"userImageVerticalScale", m_userImageVerticalScale);
139 m_settings->setValue(
"userImageLocation", m_userImageLocation);
140 m_settings->setValue(
"geolanguage", m_geoLanguage);
144 qSettings->setValue(
"mapProvider", m_mapProvider);
145 qSettings->setValue(
"defaultZoom", m_defaultZoom);
146 qSettings->setValue(
"defaultLatitude", m_defaultLatitude);
147 qSettings->setValue(
"defaultLongitude", m_defaultLongitude);
148 qSettings->setValue(
"showTileGridLines", m_showTileGridLines);
149 qSettings->setValue(
"accessMode", m_accessMode);
150 qSettings->setValue(
"useMemoryCache", m_useMemoryCache);
151 qSettings->setValue(
"uavSymbol", m_uavSymbol);
152 qSettings->setValue(
"cacheLocation",
Utils::PathUtils().RemoveStoragePath(m_cacheLocation));
153 qSettings->setValue(
"maxUpdateRate", m_maxUpdateRate);
154 qSettings->setValue(
"overlayOpacity", m_opacity);
155 qSettings->setValue(
"userImageHorizontalScale", m_userImageHorizontalScale);
156 qSettings->setValue(
"userImageVerticalScale", m_userImageVerticalScale);
157 qSettings->setValue(
"userImageLocation", m_userImageLocation);
158 qSettings->setValue(
"geolanguage", m_geoLanguage);
bool useMemoryCache() const
bool showTileGridLines() const
IUAVGadgetConfiguration * clone()
QString cacheLocation() const
QString accessMode() const
QString uavSymbol() const
QString mapProvider() const
OPMapGadgetConfiguration(QString classId, QSettings *qSettings=nullptr, QObject *parent=nullptr)
QString InsertStoragePath(QString path)