Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
9219a952
Commit
9219a952
authored
Sep 18, 2016
by
Don Gagne
Committed by
GitHub
Sep 18, 2016
Browse files
Merge pull request #4044 from AndKe/Statkart
Maps:Added Statkart Topo2 (very useful norwegian topographic map)
parents
8fa4835b
50f8db09
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/FlightMap/FlightMapSettings.cc
View file @
9219a952
...
...
@@ -32,6 +32,7 @@ void FlightMapSettings::setToolbox(QGCToolbox *toolbox)
#ifndef QGC_NO_GOOGLE_MAPS
_supportedMapProviders
<<
"Google"
;
#endif
_supportedMapProviders
<<
"Statkart"
;
_loadSettings
();
}
...
...
@@ -82,6 +83,8 @@ void FlightMapSettings::_setMapTypesForCurrentProvider(void)
_mapTypes
<<
"Street Map"
<<
"Satellite Map"
<<
"Hybrid Map"
;
}
else
if
(
_mapProvider
==
"Google"
)
{
_mapTypes
<<
"Street Map"
<<
"Satellite Map"
<<
"Terrain Map"
;
}
else
if
(
_mapProvider
==
"Statkart"
)
{
_mapTypes
<<
"Topo2"
;
}
#endif
emit
mapTypesChanged
(
_mapTypes
);
...
...
src/QtLocationPlugin/QGCMapEngine.cpp
View file @
9219a952
...
...
@@ -51,6 +51,7 @@ stQGeoTileCacheQGCMapTypes kMapTypes[] = {
{
"Bing Street Map"
,
UrlFactory
::
BingMap
},
{
"Bing Satellite Map"
,
UrlFactory
::
BingSatellite
},
{
"Bing Hybrid Map"
,
UrlFactory
::
BingHybrid
},
{
"Statkart Topo2"
,
UrlFactory
::
StatkartTopo
},
{
"MapQuest Street Map"
,
UrlFactory
::
MapQuestMap
},
{
"MapQuest Satellite Map"
,
UrlFactory
::
MapQuestSat
}
/*
...
...
@@ -463,6 +464,7 @@ QGCMapEngine::concurrentDownloads(UrlFactory::MapType type)
case
UrlFactory
::
BingMap
:
case
UrlFactory
::
BingSatellite
:
case
UrlFactory
::
BingHybrid
:
case
UrlFactory
::
StatkartTopo
:
return
12
;
case
UrlFactory
::
MapQuestMap
:
case
UrlFactory
::
MapQuestSat
:
...
...
src/QtLocationPlugin/QGCMapUrlEngine.cpp
View file @
9219a952
...
...
@@ -84,6 +84,7 @@ UrlFactory::getImageFormat(MapType type, const QByteArray& image)
case
GoogleHybrid
:
case
BingMap
:
case
OpenStreetMap
:
case
StatkartTopo
:
format
=
"png"
;
break
;
case
MapQuestMap
:
...
...
@@ -143,6 +144,9 @@ UrlFactory::getTileURL(MapType type, int x, int y, int zoom, QNetworkAccessManag
case
BingSatellite
:
request
.
setRawHeader
(
"Referrer"
,
"https://www.bing.com/maps/"
);
break
;
case
StatkartTopo
:
request
.
setRawHeader
(
"Referrer"
,
"https://www.norgeskart.no/"
);
break
;
/*
case OpenStreetMapSurfer:
case OpenStreetMapSurferTerrain:
...
...
@@ -229,6 +233,11 @@ UrlFactory::_getURL(MapType type, int x, int y, int zoom, QNetworkAccessManager*
}
break
;
#endif
case
StatkartTopo
:
{
return
QString
(
"http://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo2&zoom=%1&x=%2&y=%3"
).
arg
(
zoom
).
arg
(
x
).
arg
(
y
);
}
break
;
/*
case OpenStreetMap:
{
...
...
src/QtLocationPlugin/QGCMapUrlEngine.h
View file @
9219a952
...
...
@@ -44,6 +44,8 @@ public:
OpenStreetMapSurfer
=
34
,
OpenStreetMapSurferTerrain
=
35
,
StatkartTopo
=
100
,
BingMap
=
444
,
BingSatellite
=
555
,
BingHybrid
=
666
,
...
...
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
View file @
9219a952
...
...
@@ -114,6 +114,9 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
mapTypes
<<
QGeoMapType
(
QGeoMapType
::
SatelliteMapDay
,
"Bing Satellite Map"
,
"Bing satellite map"
,
false
,
false
,
UrlFactory
::
BingSatellite
);
mapTypes
<<
QGeoMapType
(
QGeoMapType
::
HybridMap
,
"Bing Hybrid Map"
,
"Bing hybrid map"
,
false
,
false
,
UrlFactory
::
BingHybrid
);
// Statkart
mapTypes
<<
QGeoMapType
(
QGeoMapType
::
TerrainMap
,
"Statkart Topo2"
,
"Statkart Topo2"
,
false
,
false
,
UrlFactory
::
StatkartTopo
);
/* See: https://wiki.openstreetmap.org/wiki/Tile_usage_policy
mapTypes << QGeoMapType(QGeoMapType::StreetMap, "Open Street Map", "Open Street map", false, false, UrlFactory::OpenStreetMap);
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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