Merge pull request #1337 from mapbox/fix-ios-compass-opacity

tighten up compass alpha adjustments & remove dupe
This commit is contained in:
Justin R. Miller
2015-04-23 17:42:04 -07:00

View File

@@ -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