fix(ios): use window scene interface orientation for heading compensation (#4548)
This commit is contained in:
@@ -16,6 +16,7 @@ MapLibre welcomes participation and contributions from everyone. Please read [`M
|
||||
- core: rename `mbgl` directories to `mln` ([#4511]((https://github.com/maplibre/maplibre-native/pull/4511))).
|
||||
- Fix surface transform ([#4495](https://github.com/maplibre/maplibre-native/pull/4495)).
|
||||
- fix(core): Fix nullptr access during custom layer pre-render ([#4496](https://github.com/maplibre/maplibre-native/pull/4496)).
|
||||
- fix(ios): use the window scene's interface orientation for heading compensation, replacing the deprecated `-[UIApplication statusBarOrientation]`.
|
||||
|
||||
## 6.28.0
|
||||
|
||||
|
||||
@@ -6573,7 +6573,17 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
// note that right/left device and interface orientations are opposites (see UIApplication.h)
|
||||
//
|
||||
CLDeviceOrientation orientation;
|
||||
switch ([[UIApplication sharedApplication] statusBarOrientation]) {
|
||||
// -[UIApplication statusBarOrientation] is deprecated and is a no-op as of
|
||||
// iOS 27, so it can no longer be used to compensate the heading. It is also
|
||||
// called on every heading update, which makes UIKit log a deprecation notice
|
||||
// several times per second.
|
||||
UIInterfaceOrientation interfaceOrientation;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
interfaceOrientation = self.window.windowScene.interfaceOrientation;
|
||||
} else {
|
||||
interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
|
||||
}
|
||||
switch (interfaceOrientation) {
|
||||
case (UIInterfaceOrientationLandscapeLeft): {
|
||||
orientation = CLDeviceOrientationLandscapeRight;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user