Now using a strict horizontal map scale
[GPXSee.git] / src / map / wmtsmap.h
blobe177ea5544199457982470368a85466caaadc41b
1 #ifndef WMTSMAP_H
2 #define WMTSMAP_H
4 #include "transform.h"
5 #include "projection.h"
6 #include "map.h"
7 #include "wmts.h"
9 class TileLoader;
11 class WMTSMap : public Map
13 Q_OBJECT
15 public:
16 WMTSMap(const QString &name, const WMTS::Setup &setup, QObject *parent = 0);
18 const QString &name() const {return _name;}
20 QRectF bounds() const;
22 int zoom() const {return _zoom;}
23 void setZoom(int zoom);
24 int zoomFit(const QSize &size, const RectC &rect);
25 int zoomIn();
26 int zoomOut();
28 QPointF ll2xy(const Coordinates &c)
29 {return static_cast<const WMTSMap &>(*this).ll2xy(c);}
30 Coordinates xy2ll(const QPointF &p)
31 {return static_cast<const WMTSMap &>(*this).xy2ll(p);}
33 void draw(QPainter *painter, const QRectF &rect, bool block);
35 void clearCache();
37 bool isValid() const {return _valid;}
38 QString errorString() const {return _errorString;}
40 private:
41 bool loadWMTS();
42 double sd2res(double scaleDenominator) const;
43 QString tilesDir() const;
44 void updateTransform();
46 QPointF ll2xy(const Coordinates &c) const;
47 Coordinates xy2ll(const QPointF &p) const;
49 QString _name;
50 WMTS::Setup _setup;
51 TileLoader *_tileLoader;
52 RectC _bounds;
53 QList<WMTS::Zoom> _zooms;
54 Projection _projection;
55 Transform _transform;
56 CoordinateSystem _cs;
57 int _zoom;
59 bool _valid;
60 QString _errorString;
63 #endif // WMTSMAP_H