forked from SindenDev/amap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qgeotilefetcheramap.h
72 lines (55 loc) · 1.82 KB
/
qgeotilefetcheramap.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
68
69
70
71
72
#ifndef QGEOTILEFETCHERAMAP_H
#define QGEOTILEFETCHERAMAP_H
#include "qgeoserviceproviderpluginamap.h"
#include <QtLocation/private/qgeotilefetcher_p.h>
#include <QMutex>
#include <QNetworkReply>
QT_BEGIN_NAMESPACE
class QGeoTiledMapReply;
class QGeoTileSpec;
class QGeoTiledMappingManagerEngine;
class QGeoTiledMappingManagerEngineAmap;
class QNetworkAccessManager;
class QGeoTileFetcherAmap : public QGeoTileFetcher
{
Q_OBJECT
public:
QGeoTileFetcherAmap(const QVariantMap ¶meters,
QGeoTiledMappingManagerEngineAmap *engine, const QSize &tileSize);
~QGeoTileFetcherAmap();
QGeoTiledMapReply *getTileImage(const QGeoTileSpec &spec);
private:
QString _getURL(int type, int x, int y, int zoom);
void _tryCorrectAmapVersions(QNetworkAccessManager *networkManager);
void _getSecAmapWords(int x, int y, QString &sec1, QString &sec2);
void _getSessionToken();
private slots:
void _networkReplyError(QNetworkReply::NetworkError error);
void _replyDestroyed();
void _amapVersionCompleted();
private:
Q_DISABLE_COPY(QGeoTileFetcherAmap)
QNetworkAccessManager *m_networkManager;
QPointer<QGeoTiledMappingManagerEngineAmap> m_engineAmap;
QSize m_tileSize;
QString m_apiKey;
QString m_signature;
QString m_client;
QString m_baseUri;
int _timeout;
bool _amapVersionRetrieved;
QNetworkReply* _amapReply;
QMutex _amapVersionMutex;
QByteArray _userAgent;
QString _language;
QJsonValue _sessionToken;
// Amap version strings
QString _versionAmapMap;
QString _versionAmapSatellite;
QString _versionAmapLabels;
QString _versionAmapTerrain;
QString _secAmapWord;
QNetworkRequest netRequest;
};
QT_END_NAMESPACE
#endif