diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-02-27 19:01:29 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-03-04 14:45:32 +0200 |
commit | f5f10ec11989ccb403c2cd4261db74c44b263558 (patch) | |
tree | 8c88ee24819281609206e36c719eef617acb52b6 /platform/glfw | |
parent | 491fce68790e05cd0a876815751dc5cb72a2761e (diff) | |
download | qtlocation-mapboxgl-f5f10ec11989ccb403c2cd4261db74c44b263558.tar.gz |
[core] Remove map zoom setters/getters
Diffstat (limited to 'platform/glfw')
-rw-r--r-- | platform/glfw/main.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp index 1bb2e13614..9963ca6884 100644 --- a/platform/glfw/main.cpp +++ b/platform/glfw/main.cpp @@ -117,9 +117,11 @@ int main(int argc, char *argv[]) { style = std::string("file://") + style; } - map.setLatLngZoom(mbgl::LatLng(settings.latitude, settings.longitude), settings.zoom); - map.setBearing(settings.bearing); - map.setPitch(settings.pitch); + map.jumpTo(mbgl::CameraOptions() + .withCenter(mbgl::LatLng {settings.latitude, settings.longitude}) + .withZoom(settings.zoom) + .withAngle(settings.bearing) + .withPitch(settings.pitch)); map.setDebug(mbgl::MapDebugOptions(settings.debug)); view->setOnlineStatusCallback([&settings, &fileSource]() { @@ -172,12 +174,12 @@ int main(int argc, char *argv[]) { view->run(); // Save settings - mbgl::LatLng latLng = map.getLatLng(); - settings.latitude = latLng.latitude(); - settings.longitude = latLng.longitude(); - settings.zoom = map.getZoom(); - settings.bearing = map.getBearing(); - settings.pitch = map.getPitch(); + mbgl::CameraOptions camera = map.getCameraOptions(); + settings.latitude = camera.center->latitude(); + settings.longitude = camera.center->longitude(); + settings.zoom = *camera.zoom; + settings.bearing = *camera.angle; + settings.pitch = *camera.pitch; settings.debug = mbgl::EnumType(map.getDebug()); settings.save(); mbgl::Log::Info(mbgl::Event::General, |