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
ecdb5841
Unverified
Commit
ecdb5841
authored
Aug 01, 2018
by
Gus Grubba
Committed by
GitHub
Aug 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6736 from stmoon/vworld
create new vworld map for Korea
parents
8aba4456
cf6089d0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
6 deletions
+80
-6
QGCMapEngine.cpp
src/QtLocationPlugin/QGCMapEngine.cpp
+8
-1
QGCMapUrlEngine.cpp
src/QtLocationPlugin/QGCMapUrlEngine.cpp
+51
-1
QGCMapUrlEngine.h
src/QtLocationPlugin/QGCMapUrlEngine.h
+4
-0
QGeoTileFetcherQGC.cpp
src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
+6
-1
QGeoTiledMappingManagerEngineQGC.cpp
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
+4
-0
FlightMap.SettingsGroup.json
src/Settings/FlightMap.SettingsGroup.json
+2
-2
FlightMapSettings.cc
src/Settings/FlightMapSettings.cc
+3
-0
FlightMapSettings.h
src/Settings/FlightMapSettings.h
+2
-1
No files found.
src/QtLocationPlugin/QGCMapEngine.cpp
View file @
ecdb5841
...
...
@@ -55,7 +55,11 @@ stQGeoTileCacheQGCMapTypes kMapTypes[] = {
{
"Bing Satellite Map"
,
UrlFactory
::
BingSatellite
},
{
"Bing Hybrid Map"
,
UrlFactory
::
BingHybrid
},
{
"Statkart Terrain Map"
,
UrlFactory
::
StatkartTopo
},
{
"ENIRO Terrain Map"
,
UrlFactory
::
EniroTopo
}
{
"ENIRO Terrain Map"
,
UrlFactory
::
EniroTopo
},
{
"VWorld Satellite Map"
,
UrlFactory
::
VWorldSatellite
},
{
"VWorld Street Map"
,
UrlFactory
::
VWorldStreet
}
/*
{"MapQuest Street Map", UrlFactory::MapQuestMap},
{"MapQuest Satellite Map", UrlFactory::MapQuestSat}
...
...
@@ -508,6 +512,9 @@ QGCMapEngine::concurrentDownloads(UrlFactory::MapType type)
case
UrlFactory
:
:
EsriWorldSatellite
:
case
UrlFactory
:
:
EsriTerrain
:
case
UrlFactory
:
:
AirmapElevation
:
case
UrlFactory
:
:
VWorldMap
:
case
UrlFactory
:
:
VWorldSatellite
:
case
UrlFactory
:
:
VWorldStreet
:
return
12
;
/*
case UrlFactory::MapQuestMap:
...
...
src/QtLocationPlugin/QGCMapUrlEngine.cpp
View file @
ecdb5841
...
...
@@ -125,6 +125,12 @@ UrlFactory::getImageFormat(MapType type, const QByteArray& image)
case
AirmapElevation
:
format
=
"bin"
;
break
;
case
VWorldStreet
:
format
=
"png"
;
break
;
case
VWorldSatellite
:
format
=
"jpg"
;
break
;
default:
qWarning
(
"UrlFactory::getImageFormat() Unknown map id %d"
,
type
);
break
;
...
...
@@ -141,8 +147,9 @@ UrlFactory::getTileURL(MapType type, int x, int y, int zoom, QNetworkAccessManag
//-- Build URL
QNetworkRequest
request
;
QString
url
=
_getURL
(
type
,
x
,
y
,
zoom
,
networkManager
);
if
(
url
.
isEmpty
())
if
(
url
.
isEmpty
())
{
return
request
;
}
request
.
setUrl
(
QUrl
(
url
));
request
.
setRawHeader
(
"Accept"
,
"*/*"
);
switch
(
type
)
{
...
...
@@ -419,6 +426,49 @@ UrlFactory::_getURL(MapType type, int x, int y, int zoom, QNetworkAccessManager*
}
break
;
case
VWorldStreet
:
{
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
QString
(
""
);
}
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
);
}
}
break
;
case
VWorldSatellite
:
{
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
QString
(
""
);
}
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
);
}
}
break
;
default:
qWarning
(
"Unknown map id %d
\n
"
,
type
);
break
;
...
...
src/QtLocationPlugin/QGCMapUrlEngine.h
View file @
ecdb5841
...
...
@@ -56,6 +56,10 @@ public:
MapQuestSat = 701,
*/
VWorldMap
=
800
,
VWorldSatellite
=
801
,
VWorldStreet
=
802
,
MapboxStreets
=
6000
,
MapboxLight
=
6001
,
MapboxDark
=
6002
,
...
...
src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
View file @
ecdb5841
...
...
@@ -75,7 +75,12 @@ QGeoTileFetcherQGC::getTileImage(const QGeoTileSpec &spec)
{
//-- Build URL
QNetworkRequest
request
=
getQGCMapEngine
()
->
urlFactory
()
->
getTileURL
((
UrlFactory
::
MapType
)
spec
.
mapId
(),
spec
.
x
(),
spec
.
y
(),
spec
.
zoom
(),
_networkManager
);
if
(
!
request
.
url
().
isEmpty
()
)
{
return
new
QGeoTiledMapReplyQGC
(
_networkManager
,
request
,
spec
);
}
else
{
return
NULL
;
}
}
//-----------------------------------------------------------------------------
...
...
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
View file @
ecdb5841
...
...
@@ -133,6 +133,10 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
mapTypes
<<
QGCGEOMAPTYPE
(
QGeoMapType
::
SatelliteMapDay
,
"Esri Satellite Map"
,
"ArcGIS Online World Imagery"
,
true
,
false
,
UrlFactory
::
EsriWorldSatellite
);
mapTypes
<<
QGCGEOMAPTYPE
(
QGeoMapType
::
TerrainMap
,
"Esri Terrain Map"
,
"World Terrain Base"
,
false
,
false
,
UrlFactory
::
EsriTerrain
);
// VWorld
mapTypes
<<
QGCGEOMAPTYPE
(
QGeoMapType
::
SatelliteMapDay
,
"VWorld Satellite Map"
,
"VWorld Satellite Map"
,
false
,
false
,
UrlFactory
::
VWorldSatellite
);
mapTypes
<<
QGCGEOMAPTYPE
(
QGeoMapType
::
StreetMap
,
"VWorld Street Map"
,
"VWorld Street Map"
,
false
,
false
,
UrlFactory
::
VWorldStreet
);
/* See: https://wiki.openstreetmap.org/wiki/Tile_usage_policy
mapTypes << QGCGEOMAPTYPE(QGeoMapType::StreetMap, "Open Street Map", "Open Street map", false, false, UrlFactory::OpenStreetMap);
*/
...
...
src/Settings/FlightMap.SettingsGroup.json
View file @
ecdb5841
...
...
@@ -3,8 +3,8 @@
"name"
:
"MapProvider"
,
"shortDescription"
:
"Currently selected map provider for flight maps"
,
"type"
:
"uint32"
,
"enumStrings"
:
"Bing,Google,Statkart,Mapbox,Esri,Eniro"
,
"enumValues"
:
"0,1,2,3,4,5"
,
"enumStrings"
:
"Bing,Google,Statkart,Mapbox,Esri,Eniro
,VWorld
"
,
"enumValues"
:
"0,1,2,3,4,5
,6
"
,
"defaultValue"
:
0
},
{
...
...
src/Settings/FlightMapSettings.cc
View file @
ecdb5841
...
...
@@ -119,6 +119,9 @@ void FlightMapSettings::_newMapProvider(QVariant value)
case
mapProviderEsri
:
_removeEnumValue
(
mapTypeHybrid
,
enumStrings
,
enumValues
);
break
;
case
mapProviderVWorld
:
_removeEnumValue
(
mapTypeHybrid
,
enumStrings
,
enumValues
);
_removeEnumValue
(
mapTypeTerrain
,
enumStrings
,
enumValues
);
}
metaData
->
setEnumInfo
(
enumStrings
,
enumValues
);
emit
mapTypeChanged
();
...
...
src/Settings/FlightMapSettings.h
View file @
ecdb5841
...
...
@@ -26,7 +26,8 @@ public:
mapProviderStarkart
,
mapProviderMapbox
,
mapProviderEsri
,
mapProviderEniro
mapProviderEniro
,
mapProviderVWorld
}
MapProvider_t
;
// This enum must match the json meta data
...
...
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