Commit 65c30db0 authored by Pierre TILAK's avatar Pierre TILAK

Re-add GoogleSat

parent f538e059
...@@ -220,3 +220,26 @@ QString GoogleMapProvider::_getURL(int x, int y, int zoom, ...@@ -220,3 +220,26 @@ QString GoogleMapProvider::_getURL(int x, int y, int zoom,
//return {}; //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);
}
...@@ -23,7 +23,7 @@ class GoogleMapProvider : public MapProvider { ...@@ -23,7 +23,7 @@ class GoogleMapProvider : public MapProvider {
void _googleVersionCompleted(); void _googleVersionCompleted();
void _replyDestroyed(); void _replyDestroyed();
private: protected:
// Define the url to Request // Define the url to Request
QString _getURL(int x, int y, int zoom, QString _getURL(int x, int y, int zoom,
QNetworkAccessManager* networkManager) ; QNetworkAccessManager* networkManager) ;
...@@ -42,3 +42,12 @@ class GoogleMapProvider : public MapProvider { ...@@ -42,3 +42,12 @@ class GoogleMapProvider : public MapProvider {
QString _versionGoogleTerrain; QString _versionGoogleTerrain;
QString _secGoogleWord; 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);
};
...@@ -47,7 +47,7 @@ UrlFactory::UrlFactory() ...@@ -47,7 +47,7 @@ UrlFactory::UrlFactory()
//_versionBingMaps = "563"; //_versionBingMaps = "563";
#ifndef QGC_NO_GOOGLE_MAPS #ifndef QGC_NO_GOOGLE_MAPS
_googleMapProvider = new GoogleMapProvider(this); _googleMapProvider = new GoogleSatelliteMapProvider(this);
#endif #endif
} }
......
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