summaryrefslogtreecommitdiff
path: root/include/mbgl/map/mode.hpp
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-02-10 15:15:29 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-02-10 15:15:29 -0800
commitbd59ab9a5285bf56ecc7a02e180a21f269ad68c0 (patch)
treeb1c6be1c99cd940ed08955aefcb8994ae03c1c52 /include/mbgl/map/mode.hpp
parent71611ec61247593aa6e9b568595114647363532d (diff)
downloadqtlocation-mapboxgl-bd59ab9a5285bf56ecc7a02e180a21f269ad68c0.tar.gz
[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.
Diffstat (limited to 'include/mbgl/map/mode.hpp')
-rw-r--r--include/mbgl/map/mode.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mbgl/map/mode.hpp b/include/mbgl/map/mode.hpp
index c197b28589..7fd1a7f522 100644
--- a/include/mbgl/map/mode.hpp
+++ b/include/mbgl/map/mode.hpp
@@ -24,6 +24,7 @@ enum class GLContextMode : EnumType {
// We can choose to constrain the map both horizontally or vertically, or only
// vertically e.g. while panning.
enum class ConstrainMode : EnumType {
+ None,
HeightOnly,
WidthAndHeight,
};