2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Sami Rämö - sami.ramo@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 #include "mapengine.h"
28 MapEngine::MapEngine()
32 MapEngine::MapEngine(MapView *mapView)
34 // m_mapView = mapView;
35 // m_mapScene = new MapScene();
36 // mapView->setScene(m_mapScene);
38 // /// \todo remove debug data
39 // for (int x=4261; x<=4264; x++) {
40 // for (int y=9352; y<=9353; y++) {
41 // MapTile *mapTile = new MapTile();
42 // mapTile->setZoomLevel(14);
43 // mapTile->setTileXY(x, y);
44 // mapTile->setPixmap(QPixmap("/home/ramosam-local/situare/src/map/static_test_tiles/14_9352_4261.png"));
45 // mapTile->setOffset((x-4261)*256, (y-9352)*256);
46 // m_mapScene->addMapTile(mapTile);
51 QPoint MapEngine::convertTileNumberToSceneCoordinate(int zoomLevel, QPoint tileNumber)
53 int x = tileNumber.x() * TILE_SIZE_X * pow(2, MAX_ZOOM_LEVEL - zoomLevel);
54 int y = tileNumber.y() * TILE_SIZE_Y * pow(2, MAX_ZOOM_LEVEL - zoomLevel);