diff --git a/src/QtLocationPlugin/QGCMapEngine.cpp b/src/QtLocationPlugin/QGCMapEngine.cpp index fe64539d25fc0b8cdb3091d5c9fe7b1a439eae43..f39e67e237744a4d9654f85a89ed0020bd715c68 100644 --- a/src/QtLocationPlugin/QGCMapEngine.cpp +++ b/src/QtLocationPlugin/QGCMapEngine.cpp @@ -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: diff --git a/src/QtLocationPlugin/QGCMapUrlEngine.cpp b/src/QtLocationPlugin/QGCMapUrlEngine.cpp index c0c2732da7eb73606a925422da50bb2fe4d0a736..c1a20e47d63ccb551778d593bbe2eb36ba295aa4 100644 --- a/src/QtLocationPlugin/QGCMapUrlEngine.cpp +++ b/src/QtLocationPlugin/QGCMapUrlEngine.cpp @@ -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; @@ -419,6 +425,43 @@ 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 > 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 > 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; diff --git a/src/QtLocationPlugin/QGCMapUrlEngine.h b/src/QtLocationPlugin/QGCMapUrlEngine.h index 1dc2281d618add8d7f23f304162527512b753191..83337a72fbc3096847f73858142a1ded197b8b7a 100644 --- a/src/QtLocationPlugin/QGCMapUrlEngine.h +++ b/src/QtLocationPlugin/QGCMapUrlEngine.h @@ -56,6 +56,10 @@ public: MapQuestSat = 701, */ + VWorldMap = 800, + VWorldSatellite = 801, + VWorldStreet = 802, + MapboxStreets = 6000, MapboxLight = 6001, MapboxDark = 6002, diff --git a/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp b/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp index a3456b9ea4a9726ae95292b1d083af2e08951feb..51d2f49a30535785a5860f4b87aec24149308eaf 100644 --- a/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp +++ b/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp @@ -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); */ diff --git a/src/Settings/FlightMap.SettingsGroup.json b/src/Settings/FlightMap.SettingsGroup.json index a931205e455b1101fbc30382ac5308eb27e8fe06..bcb2a593b6e698b5c7675f1470334ae05aa149f5 100644 --- a/src/Settings/FlightMap.SettingsGroup.json +++ b/src/Settings/FlightMap.SettingsGroup.json @@ -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 }, { diff --git a/src/Settings/FlightMapSettings.cc b/src/Settings/FlightMapSettings.cc index d2af25689c1b94858cdcc1e43735862240e2896c..1bb19790daec27efa64388d03834b359c7bde18e 100644 --- a/src/Settings/FlightMapSettings.cc +++ b/src/Settings/FlightMapSettings.cc @@ -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(); diff --git a/src/Settings/FlightMapSettings.h b/src/Settings/FlightMapSettings.h index edbc79391889bb6736398950e1c9c3afae0c70ef..5991d4c1ca8926aae6f266b11bb6a17ae6d52a2e 100644 --- a/src/Settings/FlightMapSettings.h +++ b/src/Settings/FlightMapSettings.h @@ -26,7 +26,8 @@ public: mapProviderStarkart, mapProviderMapbox, mapProviderEsri, - mapProviderEniro + mapProviderEniro, + mapProviderVWorld } MapProvider_t; // This enum must match the json meta data