Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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{
23 QNetworkRequest request;
24 request.setHeader(QNetworkRequest::UserAgentHeader, userAgent());
25
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
41QT_END_NAMESPACE
QGeoTiledMapReply * getTileImage(const QGeoTileSpec &spec) override
QObject * parent
Definition qobject.h:73
Combined button and popup list for selecting options.