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
b1d7f897
Commit
b1d7f897
authored
Jan 01, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor improvements and bugfixes
parent
32e1c529
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
11 deletions
+29
-11
MapWidget.cc
src/ui/MapWidget.cc
+16
-6
MapWidget.h
src/ui/MapWidget.h
+4
-0
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+9
-5
No files found.
src/ui/MapWidget.cc
View file @
b1d7f897
...
...
@@ -12,7 +12,7 @@
#include <QComboBox>
#include <QGridLayout>
#include <QDir>
#include "MapWidget.h"
#include "ui_MapWidget.h"
...
...
@@ -43,7 +43,7 @@ MapWidget::MapWidget(QWidget *parent) :
mc
=
new
qmapcontrol
::
MapControl
(
QSize
(
320
,
240
));
mc
->
showScale
(
true
);
mc
->
showCoord
(
true
);
mc
->
enablePersistentCache
(
qApp
->
applicationDirPath
()
);
mc
->
enablePersistentCache
();
mc
->
setMouseTracking
(
true
);
// required to update the mouse position for diplay and capture
// create MapAdapter to get maps from
...
...
@@ -76,10 +76,10 @@ MapWidget::MapWidget(QWidget *parent) :
// Set default zoom level
mc
->
setZoom
(
16
);
// Zurich, ETH
//
mc->setView(QPointF(8.548056,47.376389));
mc
->
setView
(
QPointF
(
8.548056
,
47.376389
));
// Veracruz Mexico
, ETH
mc
->
setView
(
QPointF
(
-
96.105208
,
19.138955
));
// Veracruz Mexico
//
mc->setView(QPointF(-96.105208,19.138955));
// Add controls to select map provider
/////////////////////////////////////////////////
...
...
@@ -600,7 +600,7 @@ void MapWidget::updatePosition(float time, double lat, double lon)
{
Q_UNUSED
(
time
);
//gpsposition->setText(QString::number(time) + " / " + QString::number(lat) + " / " + QString::number(lon));
if
(
followgps
->
isChecked
())
if
(
followgps
->
isChecked
()
&&
isVisible
()
)
{
mc
->
setView
(
QPointF
(
lat
,
lon
));
}
...
...
@@ -655,6 +655,16 @@ void MapWidget::resizeEvent(QResizeEvent* event )
mc
->
resize
(
this
->
size
());
}
void
MapWidget
::
showEvent
(
QShowEvent
*
event
)
{
Q_UNUSED
(
event
);
}
void
MapWidget
::
hideEvent
(
QHideEvent
*
event
)
{
Q_UNUSED
(
event
);
}
void
MapWidget
::
changeEvent
(
QEvent
*
e
)
{
...
...
src/ui/MapWidget.h
View file @
b1d7f897
...
...
@@ -81,6 +81,10 @@ protected:
void
wheelEvent
(
QWheelEvent
*
event
);
void
keyPressEvent
(
QKeyEvent
*
event
);
void
resizeEvent
(
QResizeEvent
*
event
);
/** @brief Start widget updating */
void
showEvent
(
QShowEvent
*
event
);
/** @brief Stop widget updating */
void
hideEvent
(
QHideEvent
*
event
);
QAction
*
osmAction
;
QAction
*
yahooActionMap
;
...
...
src/ui/map3D/QGCGoogleEarthView.cc
View file @
b1d7f897
...
...
@@ -203,7 +203,8 @@ void QGCGoogleEarthView::setHome(double lat, double lon, double alt)
void
QGCGoogleEarthView
::
hideEvent
(
QHideEvent
*
event
)
{
Q_UNUSED
(
event
)
updateTimer
->
stop
();
Q_UNUSED
(
event
);
updateTimer
->
stop
();
}
void
QGCGoogleEarthView
::
showEvent
(
QShowEvent
*
event
)
...
...
@@ -211,11 +212,9 @@ void QGCGoogleEarthView::showEvent(QShowEvent* event)
// React only to internal (pre-display)
// events
Q_UNUSED
(
event
)
{
// Enable widget, initialize on first run
// FIXME Re-inits now on every visibility change
//if (!webViewInitialized)
if
(
!
webViewInitialized
)
{
#if (defined Q_OS_MAC)
webViewMac
->
setPage
(
new
QGCWebPage
(
webViewMac
));
...
...
@@ -233,9 +232,11 @@ void QGCGoogleEarthView::showEvent(QShowEvent* event)
gEarthInitialized
=
false
;
QTimer
::
singleShot
(
3000
,
this
,
SLOT
(
initializeGoogleEarth
()));
}
else
{
updateTimer
->
start
(
refreshRateMs
);
}
}
}
void
QGCGoogleEarthView
::
printWinException
(
int
no
,
QString
str1
,
QString
str2
,
QString
str3
)
...
...
@@ -349,6 +350,9 @@ void QGCGoogleEarthView::initializeGoogleEarth()
connect
(
ui
->
camDistanceSlider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
setViewRangeScaledInt
(
int
)));
setViewRangeScaledInt
(
ui
->
camDistanceSlider
->
value
());
// Start update timer
updateTimer
->
start
(
refreshRateMs
);
gEarthInitialized
=
true
;
}
}
...
...
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