[cherry] [MAPSME-5080] [ios] Fixed next turn arrow rotation.

This commit is contained in:
Ilya Grechuhin 2017-07-18 17:52:03 +03:00 committed by Roman Kuznetsov
parent 76fef1259a
commit 57178639b4

View file

@ -359,15 +359,17 @@ BOOL defaultOrientation(CGSize const & size)
- (void)onHeadingUpdate:(location::CompassInfo const &)info
{
CLLocation * lastLocation = [MWMLocationManager lastLocation];
if (!lastLocation)
return;
CGFloat const angle =
ang::AngleTo(lastLocation.mercator,
location_helpers::ToMercator(self.navigationInfo.pedestrianDirectionPosition)) +
info.m_bearing;
self.nextTurnImageView.layer.transform = CATransform3DMakeRotation(M_PI_2 - angle, 0, 0, 1);
auto transform = CATransform3DIdentity;
auto lastLocation = [MWMLocationManager lastLocation];
if (lastLocation && self.state == MWMNavigationInfoViewStateNavigation &&
[MWMRouter type] == MWMRouterTypePedestrian)
{
auto const mercator =
location_helpers::ToMercator(self.navigationInfo.pedestrianDirectionPosition);
auto const angle = ang::AngleTo(lastLocation.mercator, mercator) + info.m_bearing;
transform = CATransform3DMakeRotation(M_PI_2 - angle, 0, 0, 1);
}
self.nextTurnImageView.layer.transform = transform;
}
#pragma mark - SolidTouchView