Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
geotilefetcher_esri.cpp
Go to the documentation of this file.
1// Copyright (C) 2013-2018 Esri <contracts@esri.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
7
8#include <QNetworkAccessManager>
9#include <QNetworkRequest>
10
11#include <QtLocation/private/qgeotilespec_p.h>
12
14
16 QGeoTileFetcher(parent), m_networkManager(new QNetworkAccessManager(this)),
17 m_userAgent(QByteArrayLiteral("Qt Location based application"))
18{
19}
20
22{
25
26 GeoTiledMappingManagerEngineEsri *engine = qobject_cast<GeoTiledMappingManagerEngineEsri *>(
27 parent());
28
29 GeoMapSource *mapSource = engine->mapSource(spec.mapId());
30
31 if (!mapSource)
32 qWarning("Unknown mapId %d\n", spec.mapId());
33 else
34 request.setUrl(mapSource->url().arg(spec.zoom()).arg(spec.x()).arg(spec.y()));
35
36 QNetworkReply *reply = m_networkManager->get(request);
37
38 return new GeoTiledMapReplyEsri(reply, spec);
39}
40
const QString & url() const
GeoTileFetcherEsri(QGeoTiledMappingManagerEngine *parent)
const QByteArray & userAgent() const
QGeoTiledMapReply * getTileImage(const QGeoTileSpec &spec) override
int x() const
int zoom() const
int mapId() const
int y() const
\inmodule QtLocation
The QNetworkAccessManager class allows the application to send network requests and receive replies.
QNetworkReply * get(const QNetworkRequest &request)
Posts a request to obtain the contents of the target request and returns a new QNetworkReply object o...
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
void setHeader(KnownHeaders header, const QVariant &value)
Sets the value of the known header header to be value, overriding any previously set headers.
void setUrl(const QUrl &url)
Sets the URL this network request is referring to be url.
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8870
#define this
Definition dialogs.cpp:9
Combined button and popup list for selecting options.
#define QByteArrayLiteral(str)
Definition qbytearray.h:52
#define qWarning
Definition qlogging.h:166
QNetworkRequest request(url)
QNetworkReply * reply
QJSEngine engine
[0]