Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
aa5584db
Commit
aa5584db
authored
Sep 16, 2019
by
Pierre TILAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Map Provider / Type choice is back
parent
c63de4c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
5 deletions
+48
-5
FlightMap.qml
src/FlightMap/FlightMap.qml
+1
-2
QGCMapUrlEngine.cpp
src/QtLocationPlugin/QGCMapUrlEngine.cpp
+3
-1
QGCMapEngineManager.cc
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
+21
-0
QGCMapEngineManager.h
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h
+4
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+19
-2
No files found.
src/FlightMap/FlightMap.qml
View file @
aa5584db
...
...
@@ -95,8 +95,7 @@ Map {
function
updateActiveMapType
()
{
var
settings
=
QGroundControl
.
settingsManager
.
flightMapSettings
//var fullMapName = settings.mapProvider.value + " " + settings.mapType.value
var
fullMapName
=
settings
.
mapProvider
.
value
var
fullMapName
=
settings
.
mapProvider
.
value
+
"
"
+
settings
.
mapType
.
value
console
.
log
(
"
updateActiveMapType
"
,
fullMapName
)
for
(
var
i
=
0
;
i
<
_map
.
supportedMapTypes
.
length
;
i
++
)
{
...
...
src/QtLocationPlugin/QGCMapUrlEngine.cpp
View file @
aa5584db
...
...
@@ -36,6 +36,8 @@ UrlFactory::UrlFactory() : _timeout(5 * 1000) {
// BingMaps
//_versionBingMaps = "563";
// Warning : in _providersTable, keys needs to follow this format : "Provider Type"
#ifndef QGC_NO_GOOGLE_MAPS
_providersTable
[
"Google Street Map"
]
=
new
GoogleStreetMapProvider
(
this
);
_providersTable
[
"Google Satellite"
]
=
new
GoogleSatelliteMapProvider
(
this
);
...
...
@@ -532,7 +534,7 @@ QString UrlFactory::getTypeFromId(int id) {
return
i
.
key
();
}
}
qCDebug
(
QGCMapUrlEngineLog
)
<<
"getTypeFromId : id not found"
<<
id
qCDebug
(
QGCMapUrlEngineLog
)
<<
"getTypeFromId : id not found"
<<
id
;
return
""
;
}
...
...
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
View file @
aa5584db
...
...
@@ -216,6 +216,27 @@ QGCMapEngineManager::mapList()
{
return
getQGCMapEngine
()
->
getMapNameList
();
}
//-----------------------------------------------------------------------------
QStringList
QGCMapEngineManager
::
mapProviderList
()
{
// Extract Provider name from MapName ( format : "Provider Type")
QStringList
mapList
=
getQGCMapEngine
()
->
getMapNameList
();
mapList
.
replaceInStrings
(
QRegExp
(
"^([^
\\
]*) (.*)$"
),
"
\\
1"
);
mapList
.
removeDuplicates
();
return
mapList
;
}
//-----------------------------------------------------------------------------
QStringList
QGCMapEngineManager
::
mapTypeList
()
{
// Extract type name from MapName ( format : "Provider Type")
QStringList
mapList
=
getQGCMapEngine
()
->
getMapNameList
();
mapList
.
replaceInStrings
(
QRegExp
(
"^([^
\\
]*) (.*)"
),
"
\\
2"
);
mapList
.
removeDuplicates
();
return
mapList
;
}
//-----------------------------------------------------------------------------
quint32
...
...
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h
View file @
aa5584db
...
...
@@ -43,6 +43,8 @@ public:
Q_PROPERTY
(
QString
tileSizeStr
READ
tileSizeStr
NOTIFY
tileSizeChanged
)
Q_PROPERTY
(
QmlObjectListModel
*
tileSets
READ
tileSets
NOTIFY
tileSetsChanged
)
Q_PROPERTY
(
QStringList
mapList
READ
mapList
CONSTANT
)
Q_PROPERTY
(
QStringList
mapProviderList
READ
mapProviderList
CONSTANT
)
Q_PROPERTY
(
QStringList
mapTypeList
READ
mapTypeList
CONSTANT
)
Q_PROPERTY
(
quint32
maxMemCache
READ
maxMemCache
WRITE
setMaxMemCache
NOTIFY
maxMemCacheChanged
)
Q_PROPERTY
(
quint32
maxDiskCache
READ
maxDiskCache
WRITE
setMaxDiskCache
NOTIFY
maxDiskCacheChanged
)
Q_PROPERTY
(
QString
errorMessage
READ
errorMessage
NOTIFY
errorMessageChanged
)
...
...
@@ -77,6 +79,8 @@ public:
quint64
tileSize
()
{
return
_imageSet
.
tileSize
+
_elevationSet
.
tileSize
;
}
QString
tileSizeStr
();
QStringList
mapList
();
QStringList
mapProviderList
();
QStringList
mapTypeList
();
QmlObjectListModel
*
tileSets
()
{
return
&
_tileSets
;
}
quint32
maxMemCache
();
quint32
maxDiskCache
();
...
...
src/ui/preferences/GeneralSettings.qml
View file @
aa5584db
...
...
@@ -160,11 +160,11 @@ Rectangle {
QGCLabel
{
text
:
qsTr
(
"
Map Provider
"
)
width
:
_labelWidth
//visible: _mapProvider.visible
}
QGCComboBox
{
id
:
mapCombo
model
:
QGroundControl
.
mapEngineManager
.
mapList
model
:
QGroundControl
.
mapEngineManager
.
map
Provider
List
Layout.preferredWidth
:
_comboFieldWidth
onActivated
:
{
_mapProvider
=
textAt
(
index
)
...
...
@@ -175,6 +175,23 @@ Rectangle {
mapCombo
.
currentIndex
=
index
}
}
QGCLabel
{
text
:
qsTr
(
"
Map Type
"
)
width
:
_labelWidth
}
QGCComboBox
{
id
:
mapTypeCombo
model
:
QGroundControl
.
mapEngineManager
.
mapTypeList
Layout.preferredWidth
:
_comboFieldWidth
onActivated
:
{
_mapType
=
textAt
(
index
)
QGroundControl
.
settingsManager
.
flightMapSettings
.
mapType
.
value
=
textAt
(
index
)
}
Component.onCompleted
:
{
var
index
=
mapTypeCombo
.
find
(
_mapType
)
mapTypeCombo
.
currentIndex
=
index
}
}
QGCLabel
{
text
:
qsTr
(
"
Stream GCS Position
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment