You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PayloadAPP/Src/RescueLoad/map/tianditu/include/timapurlengine.h

55 lines
2.1 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**************************************************************************
* 文件名 timapurlengine.h
* =======================================================================
* 创 建 者 :田小帆
* 创建日期 2021-6-17
* 邮 箱 499131808@qq.com
* Q Q 499131808
* 公 司
* 功能描述
*
* ======================================================================
* 修改者
* 修改日期
* 修改内容
* ======================================================================
*
***************************************************************************/
#pragma once
#include <QHash>
#include <QNetworkAccessManager>
#include <QObject>
class TiMapProvider;
/**
* @brief The TiMapUrlEngine class 管理所有服务
* 存放所有地图服务的 字符串及服务类的hash map
*/
class TiMapUrlEngine : public QObject
{
Q_OBJECT
public:
TiMapUrlEngine(QObject* parent = nullptr);
typedef QPair<QString, TiMapProvider*> ProviderPair;
QMap<QString, QString> getProviderNameList() const;
QString getTypeFromId(const int id) const;
int getIdFromType(const QString& type) const;
TiMapProvider* getMapProviderFromId(int id) const;
TiMapProvider* getMapProviderFromType(const QString& type) const;
QNetworkRequest getTileUrl(int id, int x, int y, int zoom,
QNetworkAccessManager* networkManager) const;
QNetworkRequest getTileUrl(const QString& type, int x, int y, int zoom,
QNetworkAccessManager* networkManager) const;
QString getImageFormat(QString type, const QByteArray& image);
QString getImageFormat(int id, const QByteArray& image);
bool isElevation(int mapId);
private:
QList<ProviderPair> m_providerList;
QMap<QString, QString> m_providerNameList;
};