added base class for own and friend locations. added new class for
[situare] / src / map / mapcommon.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Sami Rämö - sami.ramo@ixonos.com
6        Jussi Laitinen - jussi.laitinen@ixonos.com
7
8    Situare is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License
10    version 2 as published by the Free Software Foundation.
11
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.
16
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,
20    USA.
21 */
22
23 #ifndef MAPCOMMON_H
24 #define MAPCOMMON_H
25
26 #include <QtCore>
27
28 const int TILE_SIZE_X = 256; ///< Tile image size in x direction
29 const int TILE_SIZE_Y = 256; ///< Tile image size in y direction
30
31 const int MIN_MAP_ZOOM_LEVEL = 0; ///< Minimum zoom level
32 const int MAX_MAP_ZOOM_LEVEL = 18; ///< Maximum zoom level
33 const int MIN_MAP_SCENE_NORMAL_LEVEL = MAX_MAP_ZOOM_LEVEL + 1;
34
35 const int ZOOM_FPS = 30; ///< FPS for the zoom effect
36 const qreal ZOOM_TIME = 250; ///< Length of the zoom effect (ms)
37
38 static const int MAP_ZOOM_PANEL_POSITION_X = 10; ///< Horizontal position of zoom panel
39 static const int MAP_ZOOM_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
40 static const int MAP_ZOOM_PANEL_LEVEL = MIN_MAP_SCENE_NORMAL_LEVEL
41                                         + MAX_MAP_ZOOM_LEVEL + 2; ///< Zepth of zoom panel (Z-axis)
42 static const int MAP_ZOOM_PANEL_BUTTON_SIZE = 74; ///< Size of a zoom panel button
43
44 static const int MAP_OWN_LOCATION_ICON_SIZE = 24; ///< Size of own location item icon
45 static const int OWN_LOCATION_ICON_Z_LEVEL = MAP_ZOOM_PANEL_LEVEL - 1; ///< Z-Level of own location icon
46 const int FRIEND_LOCATION_ICON_Z_LEVEL = OWN_LOCATION_ICON_Z_LEVEL -1; ///< Z-Level of friend location icon
47
48 const qreal MAX_LATITUDE = 85.05112877980659237802;  ///< Maximum latitude value
49 const qreal MIN_LATITUDE = -MAX_LATITUDE; ///< Minimum latitude value
50 const qreal MIN_LONGITUDE = -180.0;  ///< Minimum longitude value
51 const qreal MAX_LONGITUDE = 180.0;  ///< Maximum longitude value
52
53 const int DEFAULT_SCREEN_WIDTH = 973;    ///< Default screen width
54 const int DEFAULT_SCREEN_HEIGHT = 614;   ///< Default screen height
55 const int DEFAULT_ZOOM_LEVEL = 14;       ///< Default zoom level
56 const qreal DEFAULT_LONGITUDE = 25.5000; ///< Default longitude value
57 const qreal DEFAULT_LATITUDE = 65.0000;  ///< Default latitude value
58
59 const int GRID_PADDING = 1;  ///< Grid padding used in tile grid calculation
60
61 /**
62 * \var UNDEFINED
63 * \brief Value to be used when zoom level, tile numbers or position are not defined
64 */
65 const int UNDEFINED = -1;
66
67 #endif // MAPCOMMON_H