diff --git a/src/QtLocationPlugin/GoogleMapProvider.cpp b/src/QtLocationPlugin/GoogleMapProvider.cpp index ef8eb3b75fd62a7d01fd37ff48629adc5a6ee9e1..fd3fcf8e639222dbb4789ee1cd5c0836e87eca83 100644 --- a/src/QtLocationPlugin/GoogleMapProvider.cpp +++ b/src/QtLocationPlugin/GoogleMapProvider.cpp @@ -220,3 +220,26 @@ QString GoogleMapProvider::_getURL(int x, int y, int zoom, //return {}; } +QString GoogleSatelliteMapProvider::_getURL(int x, int y, int zoom, + QNetworkAccessManager* networkManager) { + qDebug()<< "Yohou"; + // http://mt1.google.com/vt/lyrs=s + QString server = "khm"; + QString request = "kh"; + QString sec1 = ""; // after &x=... + QString sec2 = ""; // after &zoom=... + _getSecGoogleWords(x, y, sec1, sec2); + _tryCorrectGoogleVersions(networkManager); + return QString( + "http://%1%2.google.com/%3/v=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10") + .arg(server) + .arg(_getServerNum(x, y, 4)) + .arg(request) + .arg(_versionGoogleSatellite) + .arg(_language) + .arg(x) + .arg(sec1) + .arg(y) + .arg(zoom) + .arg(sec2); +} diff --git a/src/QtLocationPlugin/GoogleMapProvider.h b/src/QtLocationPlugin/GoogleMapProvider.h index a97e3d4f97b9136493802085bf3ad6605bd41528..f81509f4529439eace61be3542ac89865541c34c 100644 --- a/src/QtLocationPlugin/GoogleMapProvider.h +++ b/src/QtLocationPlugin/GoogleMapProvider.h @@ -23,7 +23,7 @@ class GoogleMapProvider : public MapProvider { void _googleVersionCompleted(); void _replyDestroyed(); - private: + protected: // Define the url to Request QString _getURL(int x, int y, int zoom, QNetworkAccessManager* networkManager) ; @@ -42,3 +42,12 @@ class GoogleMapProvider : public MapProvider { QString _versionGoogleTerrain; QString _secGoogleWord; }; + +class GoogleSatelliteMapProvider : public GoogleMapProvider { + Q_OBJECT + public: + GoogleSatelliteMapProvider(QObject* parent):GoogleMapProvider(parent){} + protected: + QString _getURL(int x, int y, int zoom, + QNetworkAccessManager* networkManager); +}; diff --git a/src/QtLocationPlugin/QGCMapUrlEngine.cpp b/src/QtLocationPlugin/QGCMapUrlEngine.cpp index d4321d1b3c1f83f7fcc4aa3e154a8d7dacde842c..063ce951e83b509ad9865adeb1f1269290b9461e 100644 --- a/src/QtLocationPlugin/QGCMapUrlEngine.cpp +++ b/src/QtLocationPlugin/QGCMapUrlEngine.cpp @@ -47,7 +47,7 @@ UrlFactory::UrlFactory() //_versionBingMaps = "563"; #ifndef QGC_NO_GOOGLE_MAPS - _googleMapProvider = new GoogleMapProvider(this); + _googleMapProvider = new GoogleSatelliteMapProvider(this); #endif }