diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-08-05 15:28:46 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-08-05 15:28:46 +0200 |
commit | 05b95ab05714a05901c92fc52a23ba21ec14925a (patch) | |
tree | 90c4aa777316317528c7d360e0367e252c4bf266 /common | |
parent | af4ecc62607e1b8870d2338377422e137cef6068 (diff) | |
download | qtlocation-mapboxgl-05b95ab05714a05901c92fc52a23ba21ec14925a.tar.gz |
show zom/lat/lon/bearing in window title
Diffstat (limited to 'common')
-rw-r--r-- | common/glfw_view.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp index 60d95c8b81..f6a1c1ae7a 100644 --- a/common/glfw_view.cpp +++ b/common/glfw_view.cpp @@ -1,5 +1,7 @@ #include "glfw_view.hpp" +#include <mbgl/util/string.hpp> + GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) { #ifdef NVIDIA glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)glfwGetProcAddress("glDiscardFramebufferEXT"); @@ -192,6 +194,12 @@ void GLFWView::make_active() { void GLFWView::swap() { glfwPostEmptyEvent(); + + double lon, lat, zoom; + map->getLonLatZoom(lon, lat, zoom); + const double bearing = map->getBearing(); + const std::string title = mbgl::util::sprintf<128>("Mapbox GL – %.2f/%.6f/%.6f/%.1f", zoom, lat, lon, bearing); + glfwSetWindowTitle(window, title.c_str()); } void GLFWView::notify_map_change(mbgl::MapChange change, mbgl::timestamp delay) { |