Commit 50f8db09 authored by Andre Kjellstrup's avatar Andre Kjellstrup

Maps:Added Statkart Topo2 (very useful norwegian topographic map)

This map is an absolute necessary for navigating the northern parts.
parent 2b89fbd7
......@@ -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);
......
......@@ -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:
......
......@@ -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:
{
......
......@@ -44,6 +44,8 @@ public:
OpenStreetMapSurfer = 34,
OpenStreetMapSurferTerrain=35,
StatkartTopo = 100,
BingMap = 444,
BingSatellite = 555,
BingHybrid = 666,
......
......@@ -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);
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment