diff options
author | Brent Whitman <brent@arteku.com> | 2015-09-11 13:56:41 -0700 |
---|---|---|
committer | Brent Whitman <brent@arteku.com> | 2015-09-11 13:56:41 -0700 |
commit | 7318dfaaec400eeb24fb27ead6f55e3fd3fc1d9f (patch) | |
tree | 78dcf88acbfa85c871dda4337eb9f22f5a1422f8 | |
parent | 60d0db0d2d0eb046df26c5a76c3144ff01e2e0b6 (diff) | |
download | qtlocation-mapboxgl-7318dfaaec400eeb24fb27ead6f55e3fd3fc1d9f.tar.gz |
Leave GLview rendering on when app is inactive, to get nice smooth transitions between sizes when using multitasking on iPad (iOS 9).
-rw-r--r-- | platform/ios/MGLMapView.mm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 7056276637..b637f899f2 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -365,10 +365,8 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) // observe app activity // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willTerminate) name:UIApplicationWillTerminateNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sleepGL:) name:UIApplicationWillResignActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sleepGL:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wakeGL:) name:UIApplicationWillEnterForegroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wakeGL:) name:UIApplicationDidBecomeActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; // set initial position @@ -441,8 +439,8 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) MGLReachability *reachability = [notification object]; if ( ! _isWaitingForRedundantReachableNotification && [reachability isReachable]) { - mbgl::NetworkStatus::Reachable(); - } + mbgl::NetworkStatus::Reachable(); + } _isWaitingForRedundantReachableNotification = NO; } @@ -786,6 +784,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) { self.glSnapshotView = [[UIImageView alloc] initWithFrame:self.glView.frame]; self.glSnapshotView.autoresizingMask = self.glView.autoresizingMask; + self.glSnapshotView.contentMode = UIViewContentModeCenter; [self insertSubview:self.glSnapshotView aboveSubview:self.glView]; } |