show zom/lat/lon/bearing in window title

This commit is contained in:
Konstantin Käfer
2014-08-05 15:28:46 +02:00
parent af4ecc6260
commit 05b95ab057

View File

@@ -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) {