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
54d8fd8d
Commit
54d8fd8d
authored
Dec 07, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly handle default (initial) map coordinates and zoom level.
parent
18a9b13a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+4
-8
No files found.
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
54d8fd8d
...
...
@@ -25,7 +25,7 @@ const char* QGroundControlQmlGlobal::_flightMapPositionLongitudeSettingsKey =
const
char
*
QGroundControlQmlGlobal
::
_flightMapZoomSettingsKey
=
"FlightMapZoom"
;
QGeoCoordinate
QGroundControlQmlGlobal
::
_coord
=
QGeoCoordinate
(
0.0
,
0.0
);
double
QGroundControlQmlGlobal
::
_zoom
=
17
;
double
QGroundControlQmlGlobal
::
_zoom
=
2
;
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
:
QGCTool
(
app
,
toolbox
)
...
...
@@ -46,20 +46,16 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox
setParent
(
NULL
);
// Load last coordinates and zoom from config file
QSettings
settings
;
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
_coord
.
setLatitude
(
settings
.
value
(
_flightMapPositionLatitudeSettingsKey
,
0
).
toDouble
());
_coord
.
setLongitude
(
settings
.
value
(
_flightMapPositionLongitudeSettingsKey
,
0
).
toDouble
());
_zoom
=
settings
.
value
(
_flightMapZoomSettingsKey
,
2
).
toDouble
();
//if config file is clear
if
(
_zoom
==
0
)
_zoom
=
17.0
;
_coord
.
setLatitude
(
settings
.
value
(
_flightMapPositionLatitudeSettingsKey
,
_coord
.
latitude
()).
toDouble
());
_coord
.
setLongitude
(
settings
.
value
(
_flightMapPositionLongitudeSettingsKey
,
_coord
.
longitude
()).
toDouble
());
_zoom
=
settings
.
value
(
_flightMapZoomSettingsKey
,
_zoom
).
toDouble
();
}
QGroundControlQmlGlobal
::~
QGroundControlQmlGlobal
()
{
// Save last coordinates and zoom to config file
QSettings
settings
;
settings
.
beginGroup
(
_flightMapPositionSettingsGroup
);
settings
.
setValue
(
_flightMapPositionLatitudeSettingsKey
,
_coord
.
latitude
());
settings
.
setValue
(
_flightMapPositionLongitudeSettingsKey
,
_coord
.
longitude
());
...
...
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