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