Files
qt5-legatus-legacy/Lts/Viewer/SituationMap/MapImpl/tms_layer.h
T
2026-08-13 18:33:10 +02:00

51 lines
1.1 KiB
C++
Executable File

/**
* @RDE_HEADER@
* Tile Map Service Layer for Esri
* $Id$
* $HeadURL$
* $Author$
* License: BSD 2-Clause
*/
#pragma once
#include <arcgis/TiledMapServiceLayer.h>
#include <QNetworkReply>
class QNetworkAccessManager;
namespace EsriExtension
{
/** A small Wrapper around EsriRuntimeQt::TiledMapServiceLayer to
* be able to access a tile map service through Qt Runtime SDK.
* Sadly Esri does not provide this layer for Qt...
* so we have to write one on our own
* It's far from perfect but works for our needs.
* It was only tested with geoserver 2.8 and EPSG:23632 projection
*/
class TMSLayer : public EsriRuntimeQt::TiledMapServiceLayer
{
Q_OBJECT
public:
explicit TMSLayer(const QString &url, QObject *parent = nullptr);
~TMSLayer();
void initialize() override;
private Q_SLOTS:
void replyBaseXmlFinished(QNetworkReply *reply);
void replyBaseXmlError(QNetworkReply::NetworkError);
void onRequestTMSTile(int level, int col, int row);
private:
void cleanupNetworkReply(QNetworkReply *reply);
private:
QMap<int, QString> m_tileUrls;
QMap<int, int> m_tilesYAxis;
QString m_extension;
QNetworkAccessManager *m_nam;
};
}