71f38192a4d93feccc67dbe7303cde105b9af120
[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 #include "osm.h"
29
30 const int MAP_TILE_MIN_INDEX = 0; ///< First index number of map tiles
31
32 const int MAP_VIEW_MIN_ZOOM_LEVEL = 2; ///< Minimum zoom level for MapView
33
34 /**
35 * @var MAP_SCENE_MIN_NORMAL_LEVEL
36 * @brief Used for shifting zValues of MapTiles
37 */
38 const int MAP_SCENE_MIN_NORMAL_LEVEL = OSM_MAX_ZOOM_LEVEL + 1;
39
40 const double MAP_SCENE_VERTICAL_OVERSIZE_FACTOR = 0.5; ///< MapScene vertical oversize ( * map size)
41
42 /**
43 * @var MAP_SCENE_MIN_PIXEL_X
44 * @brief First scene horizontal pixel
45 */
46 const int MAP_SCENE_MIN_PIXEL_X = -OMS_MAP_PIXELS_X * MAP_SCENE_VERTICAL_OVERSIZE_FACTOR;
47
48 /**
49 * @var MAP_SCENE_MAX_PIXEL_X
50 * @brief Last scene horizontal pixel
51 */
52 const int MAP_SCENE_MAX_PIXEL_X = OMS_MAP_PIXELS_X * (1 + MAP_SCENE_VERTICAL_OVERSIZE_FACTOR) - 1;
53
54 ////////////////////////////////////////////////////////////////////////////////
55 // DEFAULT VALUES
56 ////////////////////////////////////////////////////////////////////////////////
57 /**
58 * @var MAP_DEFAULT_ZOOM_LEVEL
59 * @brief Maps Default zoom level, used when latest zoom level is not available.
60 */
61 const int MAP_DEFAULT_ZOOM_LEVEL = MAP_VIEW_MIN_ZOOM_LEVEL;
62
63 const qreal MAP_DEFAULT_LONGITUDE = 0.0000;  ///< Default longitude value
64 const qreal MAP_DEFAULT_LATITUDE = 0.0000; ///< Default latitude value
65
66 /**
67 * @var FRIEND_LOCATION_ICON_Z_LEVEL
68 * @brief layer of friend location icon
69 */
70 const int FRIEND_LOCATION_ICON_Z_LEVEL = MAP_SCENE_MIN_NORMAL_LEVEL + OSM_MAX_ZOOM_LEVEL + 1;
71
72 const int GROUP_ITEM_FRIENDS_COUNT_X = 13;  ///< Group item friends count x value
73 const int GROUP_ITEM_FRIENDS_COUNT_Y = 13;  ///< Group item friends count y value
74 const int GROUP_ITEM_FRIENDS_COUNT_WIDTH = 17;  ///< Group item friends count width value
75 const int GROUP_ITEM_FRIENDS_COUNT_HEIGHT = 17; ///< Group item friends count height value
76
77 const int PRESS_MANHATTAN_LENGTH = 30;   ///< Friend/group item press manhattan length
78
79 /**
80 * @var OWN_LOCATION_ICON_Z_LEVEL
81 * @brief layer of own location icon
82 */
83 const int OWN_LOCATION_ICON_Z_LEVEL = FRIEND_LOCATION_ICON_Z_LEVEL + 1;
84
85 const double MIN_LONGITUDE = -180.0;  ///< Minimum longitude value
86 const double MAX_LONGITUDE = 180.0;  ///< Maximum longitude value
87
88 const qreal EARTH_RADIUS = 6371.01;         ///< Earth radius in km
89
90 const int MAP_GRID_PADDING = 0;  ///< Grid padding used in tile grid calculation
91
92 const QString OSM_LICENSE = QString::fromUtf8("© OpenStreetMap contributors, CC-BY-SA");
93
94 const int AUTO_CENTERING_DISABLE_DISTANCE = 100; ///< Distance in pixels
95
96 //String constants for storing map settings:
97 const QString MAP_LAST_ZOOMLEVEL = "LAST_MAP_ZOOM_LEVEL";   ///< Maps last zoom level before logout
98 const QString MAP_LAST_POSITION = "LAST_MAP_LOCATION";      ///< Maps last postion before logout
99 /**
100 * @var ERROR_VALUE_NOT_FOUND_ON_SETTINGS
101 * @brief Error string that program will get if value is not found on settings
102 */
103 const QString ERROR_VALUE_NOT_FOUND_ON_SETTINGS = "Value_not_found";
104
105 /**
106 * @var UNDEFINED
107 * @brief Value to be used when zoom level, tile numbers or position are not defined
108 */
109 const int UNDEFINED = INT_MIN;
110
111 #endif // MAPCOMMON_H