show zom/lat/lon/bearing in window title
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user