summaryrefslogtreecommitdiff
path: root/ios/MBXViewController.mm
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-04-10 14:07:36 -0400
committerKonstantin Käfer <mail@kkaefer.com>2014-04-10 14:07:36 -0400
commit06bcab956018e0759d036de0f55145926a124382 (patch)
treeefcf5832b32caf67420a1c7ceb1f834ffcda912f /ios/MBXViewController.mm
parenteb499e77c1f6cc77452cadd2445b7d99d1b6b7fa (diff)
downloadqtlocation-mapboxgl-06bcab956018e0759d036de0f55145926a124382.tar.gz
correctly update the map dimensions on rotate
refs #37
Diffstat (limited to 'ios/MBXViewController.mm')
-rw-r--r--ios/MBXViewController.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm
index 3055eca981..140de2ebd0 100644
--- a/ios/MBXViewController.mm
+++ b/ios/MBXViewController.mm
@@ -162,6 +162,22 @@ class MBXMapView
}
}
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskAll;
+}
+
+-(void)viewWillLayoutSubviews {
+ [super viewWillLayoutSubviews];
+
+ GLKView *view = (GLKView *)self.view;
+ CGRect rect = [view bounds];
+ mapView->map.resize(rect.size.width, rect.size.height, [view drawableWidth], [view drawableHeight]);
+}
+
- (void)togglePalette
{
if (self.palette.alpha < 1)