forked from organicmaps/organicmaps
[ios] Fixed compass angle when device changes orientation to landscape
@TODO fix ShapeRenderer::approximateArc() to draw sector using north ("up" in screen coordinates)
This commit is contained in:
parent
0aa7a5ea25
commit
2b95d407d0
4 changed files with 14 additions and 0 deletions
|
@ -312,6 +312,7 @@ NSInteger compareAddress(id l, id r, void * context)
|
|||
|
||||
- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation
|
||||
{
|
||||
[[MapsAppDelegate theApp].m_locationManager setOrientation:self.interfaceOrientation];
|
||||
[self Invalidate];
|
||||
}
|
||||
|
||||
|
|
|
@ -212,6 +212,11 @@ static void OnSearchResultCallback(search::Result const & res, int queryId)
|
|||
[super viewWillDisappear:animated];
|
||||
}
|
||||
|
||||
- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation
|
||||
{
|
||||
[m_locationManager setOrientation:self.interfaceOrientation];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
return YES; // All orientations are supported.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
#import <UIKit/UIApplication.h>
|
||||
|
||||
#include "../../platform/location.hpp"
|
||||
|
||||
|
@ -21,4 +22,6 @@
|
|||
- (void)start:(id <LocationObserver>)observer;
|
||||
- (void)stop:(id <LocationObserver>)observer;
|
||||
- (CLLocation *)lastLocation;
|
||||
// Fixes compass angle orientation when rotating screen to landscape
|
||||
- (void)setOrientation:(UIInterfaceOrientation)orientation;
|
||||
@end
|
||||
|
|
|
@ -137,4 +137,9 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)setOrientation:(UIInterfaceOrientation)orientation
|
||||
{
|
||||
m_locationManager.headingOrientation = (CLDeviceOrientation)orientation;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Reference in a new issue