1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 23:03:22 +02:00
GPXSee/src/map/wmtsmap.h

64 lines
1.3 KiB
C
Raw Normal View History

2018-02-20 23:37:19 +01:00
#ifndef WMTSMAP_H
#define WMTSMAP_H
2018-03-22 20:00:30 +01:00
#include "transform.h"
2018-02-20 23:37:19 +01:00
#include "projection.h"
#include "map.h"
#include "wmts.h"
#include "tileloader.h"
class WMTSMap : public Map
{
Q_OBJECT
public:
WMTSMap(const QString &name, const WMTS::Setup &setup, QObject *parent = 0);
2018-02-20 23:37:19 +01:00
const QString &name() const {return _name;}
QRectF bounds() const;
qreal resolution(const QRectF &rect) const;
2018-02-20 23:37:19 +01:00
int zoom() const {return _zoom;}
int zoomFit(const QSize &size, const RectC &rect);
int zoomIn();
int zoomOut();
2018-02-20 23:37:19 +01:00
QPointF ll2xy(const Coordinates &c)
{return static_cast<const WMTSMap &>(*this).ll2xy(c);}
Coordinates xy2ll(const QPointF &p)
{return static_cast<const WMTSMap &>(*this).xy2ll(p);}
2018-04-28 16:07:32 +02:00
void draw(QPainter *painter, const QRectF &rect, bool block);
2018-02-20 23:37:19 +01:00
void clearCache();
bool isValid() const {return _valid;}
QString errorString() const {return _errorString;}
private:
bool loadWMTS();
double sd2res(double scaleDenominator) const;
QString tilesDir() const;
2018-02-20 23:37:19 +01:00
void updateTransform();
QPointF ll2xy(const Coordinates &c) const;
Coordinates xy2ll(const QPointF &p) const;
2018-02-25 02:31:01 +01:00
QString _name;
WMTS::Setup _setup;
TileLoader *_tileLoader;
RectC _bounds;
2018-02-20 23:37:19 +01:00
QList<WMTS::Zoom> _zooms;
Projection _projection;
2018-03-22 20:00:30 +01:00
Transform _transform;
2018-04-07 18:42:25 +02:00
CoordinateSystem _cs;
2018-02-20 23:37:19 +01:00
int _zoom;
bool _valid;
QString _errorString;
};
#endif // WMTSMAP_H