summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-07-04 20:38:09 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-08-08 15:52:41 +0300
commit9899518e63de6f12f76be8ee2fb6237af5f3285e (patch)
tree15d8f6b4896b255bdac87c5c7f6521d7e3bd9496
parent160c7b4b8e4f998b899d65ffb275654ccf55cb69 (diff)
downloadqtlocation-mapboxgl-9899518e63de6f12f76be8ee2fb6237af5f3285e.tar.gz
[core] Increase pitch to 67.5 degrees
-rw-r--r--include/mbgl/util/constants.hpp2
-rw-r--r--platform/glfw/glfw_view.cpp2
-rw-r--r--test/map/transform.test.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/include/mbgl/util/constants.hpp b/include/mbgl/util/constants.hpp
index 7110d9e26b..f3d06b52c9 100644
--- a/include/mbgl/util/constants.hpp
+++ b/include/mbgl/util/constants.hpp
@@ -33,7 +33,7 @@ constexpr double EARTH_RADIUS_M = 6378137;
constexpr double LATITUDE_MAX = 85.051128779806604;
constexpr double LONGITUDE_MAX = 180;
constexpr double DEGREES_MAX = 360;
-constexpr double PITCH_MAX = M_PI / 3;
+constexpr double PITCH_MAX = 67.5 * DEG2RAD;
constexpr double MIN_ZOOM = 0.0;
constexpr double MAX_ZOOM = 25.5;
constexpr float MIN_ZOOM_F = MIN_ZOOM;
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index f1cbdbbaeb..91327d8386 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -265,7 +265,7 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
double easing = bearing - routeMap->getBearing();
easing += easing > 180.0 ? -360.0 : easing < -180 ? 360.0 : 0;
routeMap->setBearing(routeMap->getBearing() + (easing / 20));
- routeMap->setPitch(60.0);
+ routeMap->setPitch(67.5);
routeMap->setZoom(18.0);
};
view->animateRouteCallback(view->map);
diff --git a/test/map/transform.test.cpp b/test/map/transform.test.cpp
index 11c2c1cc6b..f33d55780e 100644
--- a/test/map/transform.test.cpp
+++ b/test/map/transform.test.cpp
@@ -599,7 +599,7 @@ TEST(Transform, PitchBounds) {
ASSERT_DOUBLE_EQ(transform.getState().getPitch() * util::RAD2DEG, 0.0);
ASSERT_DOUBLE_EQ(transform.getState().getMinPitch() * util::RAD2DEG, 0.0);
- ASSERT_DOUBLE_EQ(transform.getState().getMaxPitch() * util::RAD2DEG, 60.0);
+ ASSERT_NEAR(transform.getState().getMaxPitch() * util::RAD2DEG, 67.5, 1e-5);
transform.setMinPitch(45.0 * util::DEG2RAD);
transform.setPitch(0.0 * util::DEG2RAD);