diff options
author | Jason Wray <jason@mapbox.com> | 2016-08-03 17:39:50 -0700 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2016-08-03 17:40:22 -0700 |
commit | d305fbebeee1b40a405db635e6bb03535296396e (patch) | |
tree | 7bb0bbae0af42fc5685ab2a907691c72c8589d89 /platform/ios/src/MGLMapView.mm | |
parent | 52cb6122f87a6769fad4c4d826b49cd95a37c83b (diff) | |
parent | b928ac5bd407efb8e4fad1e47d843eb203014841 (diff) | |
download | qtlocation-mapboxgl-d305fbebeee1b40a405db635e6bb03535296396e.tar.gz |
Merge branch 'release-ios-v3.3.0'
Merge release branch after v3.3.2 and v3.3.3.
Diffstat (limited to 'platform/ios/src/MGLMapView.mm')
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 60ba726e4f..b0c213ebfb 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -586,9 +586,18 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, [UIScreen mainScreen].scale); [scaleImage drawInRect:{ CGPointZero, scaleImage.size }]; - CGFloat weight = &UIFontWeightUltraLight ? UIFontWeightUltraLight : -0.8; + CGFloat northSize = 9; + UIFont *northFont; + if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) + { + northFont = [UIFont systemFontOfSize:northSize weight:UIFontWeightUltraLight]; + } + else + { + northFont = [UIFont systemFontOfSize:northSize]; + } NSAttributedString *north = [[NSAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COMPASS_NORTH", nil, nil, @"N", @"Compass abbreviation for north") attributes:@{ - NSFontAttributeName: [UIFont systemFontOfSize:9 weight:weight], + NSFontAttributeName: northFont, NSForegroundColorAttributeName: [UIColor whiteColor], }]; CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2, @@ -1385,8 +1394,8 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) CGPoint tapPoint = [singleTap locationInView:self]; - if (self.userLocationVisible - && [self.userLocationAnnotationView.layer.presentationLayer hitTest:tapPoint]) + CALayer *hitLayer = self.userLocationVisible ? [self.userLocationAnnotationView.layer.presentationLayer hitTest:tapPoint] : nil; + if (hitLayer && hitLayer != self.userLocationAnnotationView.haloLayer.presentationLayer) { if ( ! _userLocationAnnotationIsSelected) { |