summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-04-23 16:19:45 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-04-23 16:19:45 -0700
commit7e335cafdc5ad6ec05bcc41f603962c85f90002f (patch)
tree2e1a55dc1e41a2f649be40251dc809c9ed5b0c4b
parentc7769d9a97d05c843ba3b5a1ca79404a125e363a (diff)
downloadqtlocation-mapboxgl-7e335cafdc5ad6ec05bcc41f603962c85f90002f.tar.gz
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