From bd59ab9a5285bf56ecc7a02e180a21f269ad68c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Wed, 10 Feb 2016 15:15:29 -0800 Subject: [core, ios, osx] Only constrain after adding to a window Introduced a setter/getter for constrain mode. On iOS and OS X, the zoom level inspectable causes the zoom level to be set independently from the longitude and latitude. Thus, the latitude inspectable had no effect because the latitude was constrained to 0 at z0. Temporarily removing the heightwise constraint allows the map to center on the intended location before zooming, which is the usual case for storyboards and XIBs. On iOS, the only guarantee we have timing-wise is that all the inspectables are applied after initialization but before the view is added to a window. So we reimpose the heightwise constraint as soon as the view is added to a window, that is, before the user has a chance to pan the map out of bounds. Fixes #3868. --- src/mbgl/map/transform.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mbgl/map/transform.hpp') diff --git a/src/mbgl/map/transform.hpp b/src/mbgl/map/transform.hpp index 806413058d..48615421fe 100644 --- a/src/mbgl/map/transform.hpp +++ b/src/mbgl/map/transform.hpp @@ -119,6 +119,10 @@ public: // North Orientation void setNorthOrientation(NorthOrientation); NorthOrientation getNorthOrientation() const; + + // Constrain mode + void setConstrainMode(ConstrainMode); + ConstrainMode getConstrainMode() const; // Transitions bool inTransition() const; -- cgit v1.2.1