diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-11-17 13:27:42 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-11-17 19:02:12 +0100 |
commit | 85ab48636c0f0cb5b1ec5c5b6b64a41dbd188e06 (patch) | |
tree | 2e3b539ae1ebb5e5ffcd18b4de6642f0601206e5 /linux | |
parent | 728847329c09daa7e6754f4a6445a73be82ed616 (diff) | |
download | qtlocation-mapboxgl-85ab48636c0f0cb5b1ec5c5b6b64a41dbd188e06.tar.gz |
[core] allow changing pitch in GLFW based apps
Diffstat (limited to 'linux')
-rw-r--r-- | linux/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/linux/main.cpp b/linux/main.cpp index 4bc45041d1..97f400dd41 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) { bool benchmark = false; std::string style; double latitude = 0, longitude = 0; - double bearing = 0, zoom = 1; + double bearing = 0, zoom = 1, pitch = 0; bool skipConfig = false; const struct option long_options[] = { @@ -46,6 +46,7 @@ int main(int argc, char *argv[]) { {"lat", required_argument, 0, 'y'}, {"zoom", required_argument, 0, 'z'}, {"bearing", required_argument, 0, 'r'}, + {"pitch", required_argument, 0, 'p'}, {0, 0, 0, 0} }; @@ -83,6 +84,10 @@ int main(int argc, char *argv[]) { bearing = atof(optarg); skipConfig = true; break; + case 'p': + pitch = atof(optarg); + skipConfig = true; + break; default: break; } @@ -121,10 +126,12 @@ int main(int argc, char *argv[]) { if (skipConfig) { map.setLatLngZoom(mbgl::LatLng(latitude, longitude), zoom); map.setBearing(bearing); + map.setPitch(pitch); mbgl::Log::Info(mbgl::Event::General, "Location: %f/%f (z%.2f, %.2f deg)", latitude, longitude, zoom, bearing); } else { map.setLatLngZoom(mbgl::LatLng(settings.latitude, settings.longitude), settings.zoom); map.setBearing(settings.bearing); + map.setPitch(settings.pitch); map.setDebug(settings.debug); } @@ -159,6 +166,7 @@ int main(int argc, char *argv[]) { settings.longitude = latLng.longitude; settings.zoom = map.getZoom(); settings.bearing = map.getBearing(); + settings.pitch = map.getPitch(); settings.debug = map.getDebug(); if (!skipConfig) { settings.save(); |