forked from vladest/googlemaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgeotilefetchergooglemaps.h
67 lines (50 loc) · 1.78 KB
/
qgeotilefetchergooglemaps.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef QGEOTILEFETCHERGOOGLEMAPS_H
#define QGEOTILEFETCHERGOOGLEMAPS_H
#include "qgeoserviceproviderplugingooglemaps.h"
#include <QtLocation/private/qgeotilefetcher_p.h>
#include <QMutex>
#include <QNetworkReply>
QT_BEGIN_NAMESPACE
class QGeoTiledMapReply;
class QGeoTileSpec;
class QGeoTiledMappingManagerEngine;
class QGeoTiledMappingManagerEngineGooglemaps;
class QNetworkAccessManager;
class QGeoTileFetcherGooglemaps : public QGeoTileFetcher
{
Q_OBJECT
public:
QGeoTileFetcherGooglemaps(const QVariantMap ¶meters,
QGeoTiledMappingManagerEngineGooglemaps *engine, const QSize &tileSize);
~QGeoTileFetcherGooglemaps();
QGeoTiledMapReply *getTileImage(const QGeoTileSpec &spec);
private:
QString _getURL(int type, int x, int y, int zoom);
void _tryCorrectGoogleVersions(QNetworkAccessManager *networkManager);
void _getSecGoogleWords(int x, int y, QString &sec1, QString &sec2);
void _getSessionToken();
private slots:
void _networkReplyError(QNetworkReply::NetworkError error);
void _replyDestroyed();
void _googleVersionCompleted();
private:
Q_DISABLE_COPY(QGeoTileFetcherGooglemaps)
QNetworkAccessManager *m_networkManager;
QPointer<QGeoTiledMappingManagerEngineGooglemaps> m_engineGooglemaps;
QSize m_tileSize;
QString m_apiKey;
QString m_signature;
QString m_client;
QString m_baseUri;
bool _googleVersionRetrieved;
QNetworkReply* _googleReply;
QMutex _googleVersionMutex;
QByteArray _userAgent;
QString _language;
int _scale;
// Google version strings
QString _secGoogleWord;
QNetworkRequest netRequest;
};
QT_END_NAMESPACE
#endif