summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@users.noreply.github.com>2015-04-23 17:42:04 -0700
committerJustin R. Miller <incanus@users.noreply.github.com>2015-04-23 17:42:04 -0700
commit75980a8905b9130ef7a87eb65c66c8a98437c081 (patch)
tree2e1a55dc1e41a2f649be40251dc809c9ed5b0c4b
parentc7769d9a97d05c843ba3b5a1ca79404a125e363a (diff)
parent7e335cafdc5ad6ec05bcc41f603962c85f90002f (diff)
downloadqtlocation-mapboxgl-75980a8905b9130ef7a87eb65c66c8a98437c081.tar.gz
Merge pull request #1337 from mapbox/fix-ios-compass-opacity
tighten up compass alpha adjustments & remove dupe
-rw-r--r--platform/ios/MGLMapView.mm17
1 files changed, 11 insertions, 6 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index 5f5e99b0eb..75c06532d2 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -1151,12 +1151,6 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
if (finished)
{
[self notifyMapChange:@(animated ? mbgl::MapChangeRegionDidChangeAnimated : mbgl::MapChangeRegionDidChange)];
-
- [UIView animateWithDuration:MGLAnimationDuration
- animations:^
- {
- self.compass.alpha = 0;
- }];
}
}];
}
@@ -2255,6 +2249,17 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
}
completion:nil];
}
+ else if (mbglMap->getBearing() == 0 && self.compass.alpha > 0)
+ {
+ [UIView animateWithDuration:MGLAnimationDuration
+ delay:0
+ options:UIViewAnimationOptionBeginFromCurrentState
+ animations:^
+ {
+ self.compass.alpha = 0;
+ }
+ completion:nil];
+ }
}
+ (UIImage *)resourceImageNamed:(NSString *)imageName