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
9cd9111a
Commit
9cd9111a
authored
Jun 07, 2016
by
Gus Grubba
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3492 from dogmaphobic/mapUpdates
Update map URLs
parents
8176e73e
4f5b188f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
16 deletions
+32
-16
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+0
-1
QGCMapUrlEngine.cpp
src/QtLocationPlugin/QGCMapUrlEngine.cpp
+32
-15
No files found.
src/QmlControls/ScreenTools.qml
View file @
9cd9111a
...
...
@@ -63,7 +63,6 @@ Item {
smallFontPointSize
=
defaultFontPointSize
*
_screenTools
.
smallFontPointRatio
mediumFontPointSize
=
defaultFontPointSize
*
_screenTools
.
mediumFontPointRatio
largeFontPointSize
=
defaultFontPointSize
*
_screenTools
.
largeFontPointRatio
console
.
log
(
"
setBasePointSize
"
,
defaultFontPixelWidth
)
}
Text
{
...
...
src/QtLocationPlugin/QGCMapUrlEngine.cpp
View file @
9cd9111a
...
...
@@ -14,6 +14,8 @@
* Original work: The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
*/
//#define DEBUG_GOOGLE_MAPS
#include "QGCMapEngine.h"
#include <QRegExp>
...
...
@@ -23,6 +25,11 @@
#include <QString>
#include <QByteArray>
#if defined(DEBUG_GOOGLE_MAPS)
#include <QFile>
#include <QStandardPaths>
#endif
//-----------------------------------------------------------------------------
UrlFactory
::
UrlFactory
()
:
_timeout
(
5
*
1000
)
...
...
@@ -36,10 +43,10 @@ UrlFactory::UrlFactory()
QNetworkProxyFactory
::
setUseSystemConfiguration
(
true
);
// Google version strings
_versionGoogleMap
=
"m@33
6
"
;
_versionGoogleSatellite
=
"19
4
"
;
_versionGoogleMap
=
"m@33
8000000
"
;
_versionGoogleSatellite
=
"19
8
"
;
_versionGoogleLabels
=
"h@336"
;
_versionGoogleTerrain
=
"t@132,r@33
6
"
;
_versionGoogleTerrain
=
"t@132,r@33
8000000
"
;
_secGoogleWord
=
"Galileo"
;
// BingMaps
_versionBingMaps
=
"563"
;
...
...
@@ -122,12 +129,12 @@ UrlFactory::getTileURL(MapType type, int x, int y, int zoom, QNetworkAccessManag
case
GoogleLabels
:
case
GoogleTerrain
:
case
GoogleHybrid
:
request
.
setRawHeader
(
"Referrer"
,
"http
://maps.google.com/
"
);
request
.
setRawHeader
(
"Referrer"
,
"http
s://www.google.com/maps/preview
"
);
break
;
case
BingHybrid
:
case
BingMap
:
case
BingSatellite
:
request
.
setRawHeader
(
"Referrer"
,
"http://www.bing.com/maps/"
);
request
.
setRawHeader
(
"Referrer"
,
"http
s
://www.bing.com/maps/"
);
break
;
/*
case OpenStreetMapSurfer:
...
...
@@ -397,22 +404,29 @@ UrlFactory::_googleVersionCompleted()
return
;
}
QString
html
=
QString
(
_googleReply
->
readAll
());
QRegExp
reg
(
"
\"
*http://mt0.google.com/vt/lyrs=m@(
\\
d*)"
,
Qt
::
CaseInsensitive
);
if
(
reg
.
indexIn
(
html
)
!=
-
1
)
{
QStringList
gc
=
reg
.
capturedTexts
();
_versionGoogleMap
=
QString
(
"m@%1"
).
arg
(
gc
[
1
]);
#if defined(DEBUG_GOOGLE_MAPS)
QString
filename
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
HomeLocation
);
filename
+=
"/google.output"
;
QFile
file
(
filename
);
if
(
file
.
open
(
QIODevice
::
ReadWrite
))
{
QTextStream
stream
(
&
file
);
stream
<<
html
<<
endl
;
}
reg
=
QRegExp
(
"
\"
*http://mt0.google.com/vt/lyrs=h@(
\\
d*)"
,
Qt
::
CaseInsensitive
);
#endif
QRegExp
reg
(
"
\"
*https?://mt
\\
D?
\\
d..*/vt
\\
?lyrs=m@(
\\
d*)"
,
Qt
::
CaseInsensitive
);
if
(
reg
.
indexIn
(
html
)
!=
-
1
)
{
QStringList
gc
=
reg
.
capturedTexts
();
_versionGoogle
Labels
=
QString
(
"h
@%1"
).
arg
(
gc
[
1
]);
_versionGoogle
Map
=
QString
(
"m
@%1"
).
arg
(
gc
[
1
]);
}
reg
=
QRegExp
(
"
\"
*http
://khm
\\
D?
\\
d.google.com/kh/v=(
\\
d*)"
,
Qt
::
CaseInsensitive
);
reg
=
QRegExp
(
"
\"
*http
s?://khm
\\
D?
\\
d.googleapis.com/kh
\\
?v=(
\\
d*)"
,
Qt
::
CaseInsensitive
);
if
(
reg
.
indexIn
(
html
)
!=
-
1
)
{
QStringList
gc
=
reg
.
capturedTexts
();
_versionGoogleSatellite
=
gc
[
1
];
}
reg
=
QRegExp
(
"
\"
*http
://mt0.google.com/vt/lyrs=t@(
\\
d*),r@(
\\
d*)"
,
Qt
::
CaseInsensitive
);
reg
=
QRegExp
(
"
\"
*http
s?://mt
\\
D?
\\
d..*/vt
\\
?lyrs=t@(
\\
d*),r@(
\\
d*)"
,
Qt
::
CaseInsensitive
);
if
(
reg
.
indexIn
(
html
)
!=
-
1
)
{
QStringList
gc
=
reg
.
capturedTexts
();
_versionGoogleTerrain
=
QString
(
"t@%1,r@%2"
).
arg
(
gc
[
1
]).
arg
(
gc
[
2
]);
...
...
@@ -437,7 +451,10 @@ UrlFactory::_tryCorrectGoogleVersions(QNetworkAccessManager* networkManager)
QNetworkProxy
tProxy
;
tProxy
.
setType
(
QNetworkProxy
::
DefaultProxy
);
networkManager
->
setProxy
(
tProxy
);
QString
url
=
"http://maps.google.com/maps"
;
QSslConfiguration
conf
=
qheader
.
sslConfiguration
();
conf
.
setPeerVerifyMode
(
QSslSocket
::
VerifyNone
);
qheader
.
setSslConfiguration
(
conf
);
QString
url
=
"http://maps.google.com/maps/api/js?v=3.2&sensor=false"
;
qheader
.
setUrl
(
QUrl
(
url
));
QByteArray
ua
;
ua
.
append
(
getQGCMapEngine
()
->
userAgent
());
...
...
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