Merge pull request #96 from mapbox/fix-user-location-centering
refs mapbox/mapbox-ios-sdk#55: properly center user location on rotates
Showing
1 changed file
with
10 additions
and
0 deletions
@@ -2602,6 +2602,11 @@ | @@ -2602,6 +2602,11 @@ | ||
2602 | userHeadingTrackingView.center = CGPointMake(round([self bounds].size.width / 2), | 2602 | userHeadingTrackingView.center = CGPointMake(round([self bounds].size.width / 2), |
2603 | round([self bounds].size.height / 2) - (userHeadingTrackingView.bounds.size.height / 2) - 4); | 2603 | round([self bounds].size.height / 2) - (userHeadingTrackingView.bounds.size.height / 2) - 4); |
2604 | 2604 | ||
2605 | + userHeadingTrackingView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | | ||
2606 | + UIViewAutoresizingFlexibleRightMargin | | ||
2607 | + UIViewAutoresizingFlexibleTopMargin | | ||
2608 | + UIViewAutoresizingFlexibleBottomMargin; | ||
2609 | + | ||
2605 | userHeadingTrackingView.alpha = 0.0; | 2610 | userHeadingTrackingView.alpha = 0.0; |
2606 | 2611 | ||
2607 | [self addSubview:userHeadingTrackingView]; | 2612 | [self addSubview:userHeadingTrackingView]; |
@@ -2613,6 +2618,11 @@ | @@ -2613,6 +2618,11 @@ | ||
2613 | userLocationTrackingView.center = CGPointMake(round([self bounds].size.width / 2), | 2618 | userLocationTrackingView.center = CGPointMake(round([self bounds].size.width / 2), |
2614 | round([self bounds].size.height / 2)); | 2619 | round([self bounds].size.height / 2)); |
2615 | 2620 | ||
2621 | + userLocationTrackingView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | | ||
2622 | + UIViewAutoresizingFlexibleRightMargin | | ||
2623 | + UIViewAutoresizingFlexibleTopMargin | | ||
2624 | + UIViewAutoresizingFlexibleBottomMargin; | ||
2625 | + | ||
2616 | [self addSubview:userLocationTrackingView]; | 2626 | [self addSubview:userLocationTrackingView]; |
2617 | 2627 | ||
2618 | if (self.zoom < 3) | 2628 | if (self.zoom < 3) |
-
Please register or login to post a comment