#include <tilemapadapter.h>
Public Member Functions | |
virtual QPoint | coordinateToDisplay (const QPointF &) const |
translates a world coordinate to display coordinate | |
int | currentZoom () const |
returns the current zoom | |
virtual QPointF | displayToCoordinate (const QPoint &) const |
translates display coordinate to world coordinate | |
QString | host () const |
returns the host of this MapAdapter | |
int | maxZoom () const |
returns the max zoom value | |
int | minZoom () const |
returns the min zoom value | |
TileMapAdapter (const QString &host, const QString &serverPath, int tilesize, int minZoom=0, int maxZoom=17) | |
constructor | |
int | tilesize () const |
returns the size of the tiles |
Use this derived MapAdapter to display maps from OpenStreetMap
TileMapAdapter | ( | const QString & | host, | |
const QString & | serverPath, | |||
int | tilesize, | |||
int | minZoom = 0 , |
|||
int | maxZoom = 17 | |||
) |
constructor
Sample of a correct initialization of a MapAdapter:
TileMapAdapter* ta = new TileMapAdapter("192.168.8.1", "/img/img_cache.php/%1/%2/%3.png", 256, 0,17);
The placeholders 1, 2, 3 stands for x, y, z
The minZoom is 0 (means the whole world is visible). The maxZoom is 17 (means it is zoomed in to the max)
host | The servers URL | |
serverPath | The path to the tiles with placeholders | |
tilesize | the size of the tiles | |
minZoom | the minimum zoom level | |
maxZoom | the maximum zoom level |
QPoint coordinateToDisplay | ( | const QPointF & | coordinate | ) | const [virtual] |
translates a world coordinate to display coordinate
The calculations also needs the current zoom. The current zoom is managed by the MapAdapter, so this is no problem. To divide model from view the current zoom should be moved to the layers.
coordinate | the world coordinate |
Implements MapAdapter.
Reimplemented in GoogleSatMapAdapter.
int currentZoom | ( | ) | const [inherited] |
returns the current zoom
QPointF displayToCoordinate | ( | const QPoint & | point | ) | const [virtual] |
translates display coordinate to world coordinate
The calculations also needs the current zoom. The current zoom is managed by the MapAdapter, so this is no problem. To divide model from view the current zoom should be moved to the layers.
point | the display coordinate |
Implements MapAdapter.
Reimplemented in GoogleSatMapAdapter.
QString host | ( | ) | const [inherited] |
int maxZoom | ( | ) | const [inherited] |
returns the max zoom value
int minZoom | ( | ) | const [inherited] |
returns the min zoom value
int tilesize | ( | ) | const [inherited] |
returns the size of the tiles