Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
801 - 1
/*
2
*
3
* This file is part of QMapControl,
4
* an open-source cross-platform map widget
5
*
6
* Copyright (C) 2007 - 2008 Kai Winter
7
*
8
* This program is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
* GNU Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
20
*
21
* Contact e-mail: kaiwinter@gmx.de
22
* Program URL   : http://qmapcontrol.sourceforge.net/
23
*
24
*/
25
 
26
#ifndef EMPTYMAPADAPTER_H
27
#define EMPTYMAPADAPTER_H
28
 
29
#include "mapadapter.h"
30
 
31
namespace qmapcontrol
32
{
33
    //! MapAdapter which do not load map tiles.
34
    /*!
35
     * The EmptyMapAdapter can be used if QMapControl should not load any map tiles. This is useful if you
36
     * only want to display an image through a FixedImageOverlay e.g.
37
     *  @author Kai Winter <kaiwinter@gmx.de>
38
     */
39
    class EmptyMapAdapter : public MapAdapter
40
    {
41
        Q_OBJECT
42
    public:
43
        //! Constructor.
44
        /*!
45
         * @param tileSize This parameter seems unnecessary for this type of MapAdaper on first sight. But since
46
         * this parameter defines the size of the offscreen image it could be used for a little performance
47
         * tuning (larger offscreen-images have to be redrawed less times).
48
         * @param minZoom the minimum zoom level
49
         * @param maxZoom the maximum zoom level
50
         */
51
        EmptyMapAdapter(int tileSize = 256, int minZoom = 0, int maxZoom = 17);
52
 
53
        virtual ~EmptyMapAdapter();
54
 
55
        virtual QPoint coordinateToDisplay(const QPointF&) const;
56
        virtual QPointF displayToCoordinate(const QPoint&) const;
57
 
58
        qreal PI;
59
 
60
    protected:
61
        qreal rad_deg(qreal) const;
62
        qreal deg_rad(qreal) const;
63
 
64
        virtual bool isValid(int x, int y, int z) const;
65
        virtual void zoom_in();
66
        virtual void zoom_out();
67
        virtual QString query(int x, int y, int z) const;
68
        virtual int tilesonzoomlevel(int zoomlevel) const;
69
        virtual int xoffset(int x) const;
70
        virtual int yoffset(int y) const;
71
    };
72
}
73
#endif