summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2020-02-25 17:07:36 +0200
committerJuha Alanen <juha.alanen@mapbox.com>2020-02-26 11:21:04 +0200
commit9aefd2f2faf0e66afc263e96e3cff4cc03295e64 (patch)
tree15a6b1aa73cbee01a1fe66ca4ef988fa8e58af27
parent096570e7372dec2fe26fd107ed7ae522d1adf672 (diff)
downloadqtlocation-mapboxgl-9aefd2f2faf0e66afc263e96e3cff4cc03295e64.tar.gz
[glfw] Add option to test pitch bounds
-rw-r--r--platform/glfw/glfw_view.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 3d10f2c654..1511e07bfc 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -132,6 +132,8 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_)
printf("- Press `B` to cycle through the color, stencil, and depth buffer\n");
printf("- Press `D` to cycle through camera bounds: inside, crossing IDL at left, crossing IDL at right, and disabled\n");
printf("- Press `T` to add custom geometry source\n");
+ printf("- Press `F` to enable feature-state demo\n");
+ printf("- Press `U` to toggle pitch bounds\n");
printf("\n");
printf("- Press `1` through `6` to add increasing numbers of point annotations for testing\n");
printf("- Press `7` through `0` to add increasing numbers of shape annotations for testing\n");
@@ -388,6 +390,17 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
"Fail to create render test! Base directory does not exist or permission denied.");
}
} break;
+ case GLFW_KEY_U: {
+ auto bounds = view->map->getBounds();
+ if (bounds.minPitch == mbgl::util::PITCH_MIN * mbgl::util::RAD2DEG &&
+ bounds.maxPitch == mbgl::util::PITCH_MAX * mbgl::util::RAD2DEG) {
+ mbgl::Log::Info(mbgl::Event::General, "Limiting pitch bounds to [30, 40] degrees");
+ view->map->setBounds(mbgl::BoundOptions().withMinPitch(30).withMaxPitch(40));
+ } else {
+ mbgl::Log::Info(mbgl::Event::General, "Resetting pitch bounds to [0, 60] degrees");
+ view->map->setBounds(mbgl::BoundOptions().withMinPitch(0).withMaxPitch(60));
+ }
+ } break;
}
}