1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-12-11 11:39:10 +01:00
GPXSee/src/map/wmsmap.h

66 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:
2020-03-01 13:59:15 +01:00
WMSMap(const QString &name, const WMS::Setup &setup, int tileSize,
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 isReady() const {return _wms->isReady();}
bool isValid() const {return _wms->isValid();}
QString errorString() const {return _wms->errorString();}
private slots:
void wmsReady();
private:
QString tileUrl() const;
double sd2res(double scaleDenominator) const;
void computeZooms();
void updateTransform();
2018-08-18 21:06:36 +02:00
qreal tileSize() const;
void init();
QString _name;
WMS *_wms;
TileLoader *_tileLoader;
RectD _bounds;
Transform _transform;
QVector<double> _zooms;
2018-04-07 18:42:25 +02:00
int _zoom;
2020-03-01 13:59:15 +01:00
int _tileSize;
qreal _mapRatio;
};
#endif // WMSMAP_H