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
0268fb5e
Commit
0268fb5e
authored
Feb 18, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding full google maps support to windows
parent
d88602e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
9 deletions
+26
-9
MapWidget.cc
src/ui/MapWidget.cc
+11
-2
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+14
-7
QGCGoogleEarthView.h
src/ui/map3D/QGCGoogleEarthView.h
+1
-0
No files found.
src/ui/MapWidget.cc
View file @
0268fb5e
...
...
@@ -34,6 +34,7 @@ MapWidget::MapWidget(QWidget *parent) :
mav
(
NULL
),
lastUpdate
(
0
),
initialized
(
false
),
mc
(
NULL
),
m_ui
(
new
Ui
::
MapWidget
)
{
m_ui
->
setupUi
(
this
);
...
...
@@ -952,7 +953,7 @@ void MapWidget::updatePosition(float time, double lat, double lon)
//gpsposition->setText(QString::number(time) + " / " + QString::number(lat) + " / " + QString::number(lon));
if
(
followgps
->
isChecked
()
&&
isVisible
())
{
mc
->
setView
(
QPointF
(
lat
,
lon
));
if
(
mc
)
mc
->
setView
(
QPointF
(
lat
,
lon
));
}
}
...
...
@@ -975,6 +976,8 @@ void MapWidget::wheelEvent(QWheelEvent *event)
void
MapWidget
::
keyPressEvent
(
QKeyEvent
*
event
)
{
if
(
mc
)
{
switch
(
event
->
key
())
{
case
Qt
:
:
Key_Plus
:
mc
->
zoomIn
();
...
...
@@ -997,17 +1000,23 @@ void MapWidget::keyPressEvent(QKeyEvent *event)
default:
QWidget
::
keyPressEvent
(
event
);
}
}
}
void
MapWidget
::
resizeEvent
(
QResizeEvent
*
event
)
{
Q_UNUSED
(
event
);
mc
->
resize
(
this
->
size
());
if
(
mc
)
mc
->
resize
(
this
->
size
());
}
void
MapWidget
::
showEvent
(
QShowEvent
*
event
)
{
Q_UNUSED
(
event
);
if
(
!
initialized
)
{
initialized
=
true
;
init
();
}
}
void
MapWidget
::
hideEvent
(
QHideEvent
*
event
)
...
...
src/ui/map3D/QGCGoogleEarthView.cc
View file @
0268fb5e
...
...
@@ -44,17 +44,13 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
#endif
#ifdef _MSC_VER
webViewWin
(
new
QGCWebAxWidget
(
this
)),
documentWin
(
NULL
),
#endif
#if (defined _MSC_VER)
ui
(
new
Ui
::
QGCGoogleEarthView
)
#else
ui
(
new
Ui
::
QGCGoogleEarthView
)
#endif
{
#ifdef _MSC_VER
// Create layout and attach webViewWin
QFile
file
(
"doc.html"
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"Could not open log file"
;
...
...
@@ -406,6 +402,16 @@ QVariant QGCGoogleEarthView::documentElement(QString name)
}
else
{
if
(
documentWin
)
{
// Get HTMLElement object
QVariantList
params
;
params
.
append
(
name
);
//QAxObject* elementWin = documentWin->dynamicCall("getElementById(QString)", params);
QVariant
result
=
documentWin
->
dynamicCall
(
"toString()"
);
qDebug
()
<<
"GOT RESULT"
<<
result
;
return
QVariant
(
0
);
//QVariant(result);
}
//QVariantList params;
//params.append(javaScript);
//params.append("JScript");
...
...
@@ -425,6 +431,7 @@ void QGCGoogleEarthView::initializeGoogleEarth()
QAxObject
*
doc
=
webViewWin
->
querySubObject
(
"Document()"
);
//IDispatch* Disp;
IDispatch
*
winDoc
=
NULL
;
IHTMLDocument2
*
document
=
NULL
;
//332C4425-26CB-11D0-B483-00C04FD90119 IHTMLDocument2
//25336920-03F9-11CF-8FD0-00AA00686F13 HTMLDocument
...
...
@@ -435,11 +442,11 @@ void QGCGoogleEarthView::initializeGoogleEarth()
// CoInternetSetFeatureEnabled
// (FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_PROCESS, TRUE);
//
IHTMLDocument2
*
document
=
NULL
;
document
=
NULL
;
winDoc
->
QueryInterface
(
IID_IHTMLDocument2
,
(
void
**
)
&
document
);
IHTMLWindow2
*
window
=
NULL
;
document
->
get_parentWindow
(
&
window
);
documentWin
=
new
QAxObject
(
document
,
webViewWin
);
jScriptWin
=
new
QAxObject
(
window
,
webViewWin
);
connect
(
jScriptWin
,
SIGNAL
(
exception
(
int
,
QString
,
QString
,
QString
)),
this
,
SLOT
(
printWinException
(
int
,
QString
,
QString
,
QString
)));
jScriptInitialized
=
true
;
...
...
src/ui/map3D/QGCGoogleEarthView.h
View file @
0268fb5e
...
...
@@ -143,6 +143,7 @@ protected:
#ifdef _MSC_VER
QGCWebAxWidget
*
webViewWin
;
QAxObject
*
jScriptWin
;
QAxObject
*
documentWin
;
#endif
#if (defined Q_OS_MAC)
QWebView
*
webViewMac
;
...
...
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