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
2bb7d251
Commit
2bb7d251
authored
Sep 17, 2019
by
Pierre TILAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-add Missing map providers
parent
863c0ffc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
2 deletions
+140
-2
FlightMap.qml
src/FlightMap/FlightMap.qml
+0
-1
GenericMapProvider.cpp
src/QtLocationPlugin/GenericMapProvider.cpp
+81
-0
GenericMapProvider.h
src/QtLocationPlugin/GenericMapProvider.h
+52
-0
QGCMapUrlEngine.cpp
src/QtLocationPlugin/QGCMapUrlEngine.cpp
+7
-1
No files found.
src/FlightMap/FlightMap.qml
View file @
2bb7d251
...
...
@@ -97,7 +97,6 @@ Map {
var
settings
=
QGroundControl
.
settingsManager
.
flightMapSettings
var
fullMapName
=
settings
.
mapProvider
.
value
+
"
"
+
settings
.
mapType
.
value
console
.
log
(
"
updateActiveMapType
"
,
fullMapName
)
for
(
var
i
=
0
;
i
<
_map
.
supportedMapTypes
.
length
;
i
++
)
{
if
(
fullMapName
===
_map
.
supportedMapTypes
[
i
].
name
)
{
_map
.
activeMapType
=
_map
.
supportedMapTypes
[
i
]
...
...
src/QtLocationPlugin/GenericMapProvider.cpp
View file @
2bb7d251
...
...
@@ -20,3 +20,84 @@ QString EniroMapProvider::_getURL(int x, int y, int zoom,
.
arg
(
x
)
.
arg
((
1
<<
zoom
)
-
1
-
y
);
}
QString
MapQuestMapMapProvider
::
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
)
{
Q_UNUSED
(
networkManager
);
char
letter
=
"1234"
[
_getServerNum
(
x
,
y
,
4
)];
return
QString
(
"http://otile%1.mqcdn.com/tiles/1.0.0/map/%2/%3/%4.jpg"
)
.
arg
(
letter
)
.
arg
(
zoom
)
.
arg
(
x
)
.
arg
(
y
);
}
QString
MapQuestSatMapProvider
::
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
)
{
Q_UNUSED
(
networkManager
);
char
letter
=
"1234"
[
_getServerNum
(
x
,
y
,
4
)];
return
QString
(
"http://otile%1.mqcdn.com/tiles/1.0.0/sat/%2/%3/%4.jpg"
)
.
arg
(
letter
)
.
arg
(
zoom
)
.
arg
(
x
)
.
arg
(
y
);
}
QString
VWorldStreetMapProvider
::
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
)
{
Q_UNUSED
(
networkManager
);
int
gap
=
zoom
-
6
;
int
x_min
=
53
*
pow
(
2
,
gap
);
int
x_max
=
55
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
int
y_min
=
22
*
pow
(
2
,
gap
);
int
y_max
=
26
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
if
(
zoom
>
19
)
{
return
{};
}
else
if
(
zoom
>
5
&&
x
>=
x_min
&&
x
<=
x_max
&&
y
>=
y_min
&&
y
<=
y_max
)
{
return
QString
(
"http://xdworld.vworld.kr:8080/2d/Base/service/%1/%2/%3.png"
)
.
arg
(
zoom
)
.
arg
(
x
)
.
arg
(
y
);
}
else
{
QString
key
=
_tileXYToQuadKey
(
x
,
y
,
zoom
);
return
QString
(
"http://ecn.t%1.tiles.virtualearth.net/tiles/"
"r%2.png?g=%3&mkt=%4"
)
.
arg
(
_getServerNum
(
x
,
y
,
4
))
.
arg
(
key
)
.
arg
(
_versionBingMaps
)
.
arg
(
_language
);
}
}
QString
VWorldSatMapProvider
::
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
)
{
Q_UNUSED
(
networkManager
);
int
gap
=
zoom
-
6
;
int
x_min
=
53
*
pow
(
2
,
gap
);
int
x_max
=
55
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
int
y_min
=
22
*
pow
(
2
,
gap
);
int
y_max
=
26
*
pow
(
2
,
gap
)
+
(
2
*
gap
-
1
);
if
(
zoom
>
19
)
{
return
{};
}
else
if
(
zoom
>
5
&&
x
>=
x_min
&&
x
<=
x_max
&&
y
>=
y_min
&&
y
<=
y_max
)
{
return
QString
(
"http://xdworld.vworld.kr:8080/2d/Satellite/service/%1/"
"%2/%3.jpeg"
)
.
arg
(
zoom
)
.
arg
(
x
)
.
arg
(
y
);
}
else
{
QString
key
=
_tileXYToQuadKey
(
x
,
y
,
zoom
);
return
QString
(
"http://ecn.t%1.tiles.virtualearth.net/tiles/"
"a%2.jpeg?g=%3&mkt=%4"
)
.
arg
(
_getServerNum
(
x
,
y
,
4
))
.
arg
(
key
)
.
arg
(
_versionBingMaps
)
.
arg
(
_language
);
}
}
src/QtLocationPlugin/GenericMapProvider.h
View file @
2bb7d251
...
...
@@ -30,3 +30,55 @@ class EniroMapProvider : public MapProvider {
QString
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
);
};
class
MapQuestMapMapProvider
:
public
MapProvider
{
Q_OBJECT
public:
MapQuestMapMapProvider
(
QObject
*
parent
)
:
MapProvider
(
QString
(
"https://mapquest.com"
),
QString
(
"jpg"
),
AVERAGE_TILE_SIZE
,
QGeoMapType
::
StreetMap
,
parent
)
{}
QString
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
);
};
class
MapQuestSatMapProvider
:
public
MapProvider
{
Q_OBJECT
public:
MapQuestSatMapProvider
(
QObject
*
parent
)
:
MapProvider
(
QString
(
"https://mapquest.com"
),
QString
(
"jpg"
),
AVERAGE_TILE_SIZE
,
QGeoMapType
::
SatelliteMapDay
,
parent
)
{
}
QString
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
);
};
class
VWorldStreetMapProvider
:
public
MapProvider
{
Q_OBJECT
public:
VWorldStreetMapProvider
(
QObject
*
parent
)
:
MapProvider
(
QString
(
"www.vworld.kr"
),
QString
(
"png"
),
AVERAGE_TILE_SIZE
,
QGeoMapType
::
StreetMap
,
parent
)
{}
QString
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
);
private:
const
QString
_versionBingMaps
=
"563"
;
};
class
VWorldSatMapProvider
:
public
MapProvider
{
Q_OBJECT
public:
VWorldSatMapProvider
(
QObject
*
parent
)
:
MapProvider
(
QString
(
"www.vworld.kr"
),
QString
(
"jpg"
),
AVERAGE_TILE_SIZE
,
QGeoMapType
::
SatelliteMapDay
,
parent
)
{
}
QString
_getURL
(
int
x
,
int
y
,
int
zoom
,
QNetworkAccessManager
*
networkManager
);
private:
const
QString
_versionBingMaps
=
"563"
;
};
src/QtLocationPlugin/QGCMapUrlEngine.cpp
View file @
2bb7d251
...
...
@@ -69,6 +69,12 @@ UrlFactory::UrlFactory() : _timeout(5 * 1000) {
_providersTable
[
"Mapbox Outdoors"
]
=
new
MapboxOutdoorsMapProvider
(
this
);
_providersTable
[
"Mapbox RunBikeHike"
]
=
new
MapboxRunBikeHikeMapProvider
(
this
);
_providersTable
[
"Mapbox HighContrast"
]
=
new
MapboxHighContrastMapProvider
(
this
);
//_providersTable["MapQuest Map"] = new MapQuestMapMapProvider(this);
//_providersTable["MapQuest Sat"] = new MapQuestSatMapProvider(this);
_providersTable
[
"VWorld Street Map"
]
=
new
VWorldStreetMapProvider
(
this
);
_providersTable
[
"VWorld Satellite Map"
]
=
new
VWorldSatMapProvider
(
this
);
}
void
UrlFactory
::
registerProvider
(
QString
name
,
MapProvider
*
provider
)
{
...
...
@@ -432,7 +438,7 @@ quint32 UrlFactory::averageSizeForType(QString type) {
return
_providersTable
[
type
]
->
getAverageSize
();
}
qCDebug
(
QGCMapUrlEngineLog
)
<<
"UrlFactory::averageSizeForType "
<<
type
<<
" Not registere
t
"
;
<<
" Not registere
d
"
;
// case AirmapElevation:
// return AVERAGE_AIRMAP_ELEV_SIZE;
...
...
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