67a2d622324f2e40bfb5fc6c3092e272a1b05700
[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_VIEW_ZOOM_LEVEL = 2; ///< Minimum zoom level for MapView
34 const int MIN_MAP_SCENE_NORMAL_LEVEL = MAX_MAP_ZOOM_LEVEL + 1;
35
36 const int MAX_TILES_PER_SIDE = (1 << MAX_MAP_ZOOM_LEVEL);
37 const int WORLD_PIXELS_X = MAX_TILES_PER_SIDE * TILE_SIZE_X;
38 const int MAP_SCENE_MIN_PIXEL_X = -WORLD_PIXELS_X / 2;
39 const int MAP_SCENE_MAX_PIXEL_X = WORLD_PIXELS_X * 2;
40
41 /**
42 * @var DEFAULT_START_ZOOM_LEVEL
43 * @brief Maps Default zoom level, used when latest zoom level is not available.
44 */
45 const int DEFAULT_START_ZOOM_LEVEL = MIN_VIEW_ZOOM_LEVEL;
46
47 /**
48 * @var FRIEND_LOCATION_ICON_Z_LEVEL
49 * @brief layer of friend location icon
50 */
51 const int FRIEND_LOCATION_ICON_Z_LEVEL = MIN_MAP_SCENE_NORMAL_LEVEL + MAX_MAP_ZOOM_LEVEL + 1;
52
53 const int GROUP_ITEM_FRIENDS_COUNT_X = 13;  ///< Group item friends count x value
54 const int GROUP_ITEM_FRIENDS_COUNT_Y = 13;  ///< Group item friends count y value
55 const int GROUP_ITEM_FRIENDS_COUNT_WIDTH = 17;  ///< Group item friends count width value
56 const int GROUP_ITEM_FRIENDS_COUNT_HEIGHT = 17; ///< Group item friends count height value
57
58 const int FRIEND_ITEM_PRESS_WIDTH = 30;   ///< Friend item press area width
59 const int FRIEND_ITEM_PRESS_HEIGHT = 30;  ///< Friend item press area height
60
61 /**
62 * @var OWN_LOCATION_ICON_Z_LEVEL
63 * @brief layer of own location icon
64 */
65 const int OWN_LOCATION_ICON_Z_LEVEL = FRIEND_LOCATION_ICON_Z_LEVEL + 1;
66
67 const qreal ZOOM_TIME = 250; ///< Length of the zoom effect (ms)
68
69 const qreal MAX_LATITUDE = 85.05112877980659237802;  ///< Maximum latitude value
70 const qreal MIN_LATITUDE = -MAX_LATITUDE; ///< Minimum latitude value
71 const qreal MIN_LONGITUDE = -180.0;  ///< Minimum longitude value
72 const qreal MAX_LONGITUDE = 180.0;  ///< Maximum longitude value
73
74 const int DEFAULT_SCREEN_WIDTH = 973;    ///< Default screen width
75 const int DEFAULT_SCREEN_HEIGHT = 614;   ///< Default screen height
76 const int DEFAULT_ZOOM_LEVEL = 14;       ///< Default zoom level
77 const qreal DEFAULT_LONGITUDE = 0.0000;  ///< Default longitude value
78 const qreal DEFAULT_LATITUDE = 0.0000; ///< Default latitude value
79
80 const int GRID_PADDING = 0;  ///< Grid padding used in tile grid calculation
81
82 const QString OSM_LICENSE = QString::fromUtf8("© OpenStreetMap contributors, CC-BY-SA");
83
84 const int AUTO_CENTERING_DISABLE_DISTANCE = 200; ///< Distance in pixels
85
86 //String constants for storing map settings:
87 const QString MAP_LAST_ZOOMLEVEL = "Last_map_zoom_level"; ///< Maps last zoom level before logout
88 const QString MAP_LAST_POSITION = "Last_map_location"; ///< Maps last postion before logout
89 /**
90 * @var ERROR_VALUE_NOT_FOUND_ON_SETTINGS
91 * @brief Error string that program will get if value is not found on settings
92 */
93 const QString ERROR_VALUE_NOT_FOUND_ON_SETTINGS = "Value_not_found";
94
95 /**
96 * @var UNDEFINED
97 * @brief Value to be used when zoom level, tile numbers or position are not defined
98 */
99 const int UNDEFINED = -1;
100
101 #endif // MAPCOMMON_H