1 | #pragma once |
2 | |
3 | #include <mbgl/util/chrono.hpp> |
4 | #include <mbgl/util/unitbezier.hpp> |
5 | |
6 | #include <cmath> |
7 | #include <string> |
8 | #include <vector> |
9 | |
10 | namespace mbgl { |
11 | |
12 | namespace util { |
13 | |
14 | constexpr double tileSize = 512; |
15 | |
16 | /* |
17 | * The maximum extent of a feature that can be safely stored in the buffer. |
18 | * In practice, all features are converted to this extent before being added. |
19 | * |
20 | * Positions are stored as signed 16bit integers. |
21 | * One bit is lost for signedness to support features extending past the left edge of the tile. |
22 | * One bit is lost because the line vertex buffer used to pack 1 bit of other data into the int. |
23 | * This is no longer the case but we're reserving this bit anyway. |
24 | * One bit is lost to support features extending past the extent on the right edge of the tile. |
25 | * This leaves us with 2^13 = 8192 |
26 | */ |
27 | constexpr int32_t EXTENT = 8192; |
28 | |
29 | constexpr double DEG2RAD = M_PI / 180.0; |
30 | constexpr double RAD2DEG = 180.0 / M_PI; |
31 | constexpr double M2PI = M_PI * 2; |
32 | constexpr double EARTH_RADIUS_M = 6378137; |
33 | constexpr double LATITUDE_MAX = 85.051128779806604; |
34 | constexpr double LONGITUDE_MAX = 180; |
35 | constexpr double DEGREES_MAX = 360; |
36 | constexpr double PITCH_MAX = M_PI / 3; |
37 | constexpr double MIN_ZOOM = 0.0; |
38 | constexpr double MAX_ZOOM = 25.5; |
39 | constexpr float MIN_ZOOM_F = MIN_ZOOM; |
40 | constexpr float MAX_ZOOM_F = MAX_ZOOM; |
41 | constexpr uint8_t DEFAULT_MAX_ZOOM = 22; |
42 | |
43 | constexpr uint8_t DEFAULT_PREFETCH_ZOOM_DELTA = 4; |
44 | |
45 | constexpr uint64_t DEFAULT_MAX_CACHE_SIZE = 50 * 1024 * 1024; |
46 | |
47 | constexpr Duration DEFAULT_TRANSITION_DURATION = Milliseconds(300); |
48 | constexpr Seconds CLOCK_SKEW_RETRY_TIMEOUT { 30 }; |
49 | |
50 | constexpr UnitBezier DEFAULT_TRANSITION_EASE = { 0, 0, 0.25, 1 }; |
51 | |
52 | constexpr int DEFAULT_RATE_LIMIT_TIMEOUT = 5; |
53 | |
54 | constexpr const char* API_BASE_URL = "https://api.mapbox.com" ; |
55 | |
56 | } // namespace util |
57 | |
58 | namespace debug { |
59 | |
60 | extern const bool tileParseWarnings; |
61 | extern const bool styleParseWarnings; |
62 | extern const bool spriteWarnings; |
63 | extern const bool renderWarnings; |
64 | extern const bool labelTextMissingWarning; |
65 | extern const bool missingFontStackWarning; |
66 | extern const bool missingFontFaceWarning; |
67 | extern const bool glyphWarning; |
68 | extern const bool shapingWarning; |
69 | |
70 | } // namespace debug |
71 | |
72 | } // namespace mbgl |
73 | |