2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Sami Rämö - sami.ramo@ixonos.com
6 Jussi Laitinen - jussi.laitinen@ixonos.com
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.
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,
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 const int MAP_TILE_MIN_INDEX = 0; ///< First index number of map tiles
32 const int MIN_MAP_ZOOM_LEVEL = 0; ///< Minimum zoom level
33 const int MAX_MAP_ZOOM_LEVEL = 18; ///< Maximum zoom level
34 const int MIN_VIEW_ZOOM_LEVEL = 2; ///< Minimum zoom level for MapView
37 * @var MIN_MAP_SCENE_NORMAL_LEVEL
38 * @brief Used for shifting zValues of MapTiles
40 const int MIN_MAP_SCENE_NORMAL_LEVEL = MAX_MAP_ZOOM_LEVEL + 1;
42 const int MAX_TILES_PER_SIDE = (1 << MAX_MAP_ZOOM_LEVEL); ///< Amount of tiles per side
43 const int MAP_PIXELS_X = MAX_TILES_PER_SIDE * TILE_SIZE_X; ///< Amount of horizontal pixels in map
45 const int MAP_MIN_PIXEL_X = 0; ///< First map horizontal pixel index
46 const int MAP_MAX_PIXEL_X = MAP_PIXELS_X - 1; ///< Last map horizontal pixel index
48 const int MAP_MIN_PIXEL_Y = 0; ///< First map vertical pixel index
49 const int MAP_MAX_PIXEL_Y = MAX_TILES_PER_SIDE * TILE_SIZE_Y - 1; ///< Last map vertical pixel index
51 const double MAP_SCENE_VERTICAL_OVERSIZE_FACTOR = 0.5; ///< MapScene vertical oversize ( * map size)
54 * @var MAP_SCENE_MIN_PIXEL_X
55 * @brief First scene horizontal pixel
57 const int MAP_SCENE_MIN_PIXEL_X = -MAP_PIXELS_X * MAP_SCENE_VERTICAL_OVERSIZE_FACTOR;
60 * @var MAP_SCENE_MAX_PIXEL_X
61 * @brief Last scene horizontal pixel
63 const int MAP_SCENE_MAX_PIXEL_X = MAP_PIXELS_X * (1 + MAP_SCENE_VERTICAL_OVERSIZE_FACTOR) - 1;
66 * @var DEFAULT_START_ZOOM_LEVEL
67 * @brief Maps Default zoom level, used when latest zoom level is not available.
69 const int DEFAULT_START_ZOOM_LEVEL = MIN_VIEW_ZOOM_LEVEL;
72 * @var FRIEND_LOCATION_ICON_Z_LEVEL
73 * @brief layer of friend location icon
75 const int FRIEND_LOCATION_ICON_Z_LEVEL = MIN_MAP_SCENE_NORMAL_LEVEL + MAX_MAP_ZOOM_LEVEL + 1;
77 const int GROUP_ITEM_FRIENDS_COUNT_X = 13; ///< Group item friends count x value
78 const int GROUP_ITEM_FRIENDS_COUNT_Y = 13; ///< Group item friends count y value
79 const int GROUP_ITEM_FRIENDS_COUNT_WIDTH = 17; ///< Group item friends count width value
80 const int GROUP_ITEM_FRIENDS_COUNT_HEIGHT = 17; ///< Group item friends count height value
82 const int PRESS_MANHATTAN_LENGTH = 30; ///< Friend/group item press manhattan length
85 * @var OWN_LOCATION_ICON_Z_LEVEL
86 * @brief layer of own location icon
88 const int OWN_LOCATION_ICON_Z_LEVEL = FRIEND_LOCATION_ICON_Z_LEVEL + 1;
90 const qreal ZOOM_TIME = 250; ///< Length of the zoom effect (ms)
92 const qreal MAX_LATITUDE = 85.05112877980659237802; ///< Maximum latitude value
93 const qreal MIN_LATITUDE = -MAX_LATITUDE; ///< Minimum latitude value
94 const qreal MIN_LONGITUDE = -180.0; ///< Minimum longitude value
95 const qreal MAX_LONGITUDE = 180.0; ///< Maximum longitude value
97 const int DEFAULT_SCREEN_WIDTH = 973; ///< Default screen width
98 const int DEFAULT_SCREEN_HEIGHT = 614; ///< Default screen height
99 const int DEFAULT_ZOOM_LEVEL = 14; ///< Default zoom level
100 const qreal DEFAULT_LONGITUDE = 0.0000; ///< Default longitude value
101 const qreal DEFAULT_LATITUDE = 0.0000; ///< Default latitude value
103 const qreal EARTH_RADIUS = 6371.01; ///< Earth radius in km
105 const int GRID_PADDING = 0; ///< Grid padding used in tile grid calculation
107 const QString OSM_LICENSE = QString::fromUtf8("© OpenStreetMap contributors, CC-BY-SA");
109 const int AUTO_CENTERING_DISABLE_DISTANCE = 200; ///< Distance in pixels
111 //String constants for storing map settings:
112 const QString MAP_LAST_ZOOMLEVEL = "LAST_MAP_ZOOM_LEVEL"; ///< Maps last zoom level before logout
113 const QString MAP_LAST_POSITION = "LAST_MAP_LOCATION"; ///< Maps last postion before logout
115 * @var ERROR_VALUE_NOT_FOUND_ON_SETTINGS
116 * @brief Error string that program will get if value is not found on settings
118 const QString ERROR_VALUE_NOT_FOUND_ON_SETTINGS = "Value_not_found";
122 * @brief Value to be used when zoom level, tile numbers or position are not defined
124 const int UNDEFINED = INT_MIN;
126 #endif // MAPCOMMON_H