1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 19:55:53 +01:00
GPXSee/src/map/map.h
Martin Tůma 37c971a720 Added support for vector maps projection setting
Removed obsolete "Always show the map" setting
2019-05-14 23:01:24 +02:00

62 lines
1.2 KiB
C++

#ifndef MAP_H
#define MAP_H
#include <QObject>
#include <QString>
#include <QRectF>
#include <QFlags>
#include "common/coordinates.h"
class QPainter;
class RectC;
class Projection;
class Map : public QObject
{
Q_OBJECT
public:
enum Flag {
NoFlags = 0,
Block = 1,
OpenGL = 2
};
Q_DECLARE_FLAGS(Flags, Flag)
Map(QObject *parent = 0) : QObject(parent) {}
virtual ~Map() {}
virtual QString name() const = 0;
virtual QRectF bounds() = 0;
virtual qreal resolution(const QRectF &rect);
virtual int zoom() const {return 0;}
virtual void setZoom(int) {}
virtual int zoomFit(const QSize &, const RectC &) {return 0;}
virtual int zoomIn() {return 0;}
virtual int zoomOut() {return 0;}
virtual QPointF ll2xy(const Coordinates &c) = 0;
virtual Coordinates xy2ll(const QPointF &p) = 0;
virtual void draw(QPainter *painter, const QRectF &rect, Flags flags) = 0;
virtual void clearCache() {}
virtual void load() {}
virtual void unload() {}
virtual void setDevicePixelRatio(qreal, qreal) {}
virtual void setProjection(const Projection &) {}
virtual bool isValid() const {return true;}
virtual QString errorString() const {return QString();}
signals:
void loaded();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Map::Flags)
#endif // MAP_H