1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 19:55:53 +01:00
GPXSee/src/map/wmsmap.h

68 lines
1.3 KiB
C
Raw Normal View History

#ifndef WMSMAP_H
#define WMSMAP_H
#include "transform.h"
#include "projection.h"
#include "map.h"
#include "wms.h"
#include "rectd.h"
2018-04-28 19:08:21 +02:00
class TileLoader;
class WMSMap : public Map
{
Q_OBJECT
public:
WMSMap(const QString &name, const WMS::Setup &setup, QObject *parent = 0);
2018-07-13 09:51:41 +02:00
QString name() const {return _name;}
2018-07-13 09:51:41 +02:00
QRectF bounds();
int zoom() const {return _zoom;}
2018-04-28 22:18:11 +02:00
void setZoom(int zoom);
int zoomFit(const QSize &size, const RectC &rect);
int zoomIn();
int zoomOut();
QPointF ll2xy(const Coordinates &c);
Coordinates xy2ll(const QPointF &p);
2018-08-23 20:26:10 +02:00
void draw(QPainter *painter, const QRectF &rect, Flags flags);
void setDevicePixelRatio(qreal /*deviceRatio*/, qreal mapRatio)
{_mapRatio = mapRatio;}
void clearCache();
bool isValid() const {return _valid;}
QString errorString() const {return _errorString;}
private:
2018-03-31 11:27:01 +02:00
QString tileUrl(const QString &version) const;
double sd2res(double scaleDenominator) const;
QString tilesDir() const;
void computeZooms(const RangeF &scaleDenominator);
void updateTransform();
bool loadWMS();
2018-08-18 21:06:36 +02:00
qreal tileSize() const;
QString _name;
WMS::Setup _setup;
TileLoader *_tileLoader;
Projection _projection;
Transform _transform;
2018-04-07 18:42:25 +02:00
CoordinateSystem _cs;
QVector<double> _zooms;
RectC _bbox;
RectD _bounds;
2018-04-07 18:42:25 +02:00
int _zoom;
qreal _mapRatio;
bool _valid;
QString _errorString;
};
#endif // WMSMAP_H