So I'm using the MapBox SDK which is a fork of the RouteMe's map SDK for iOS. From what I can tell, the annotation stuff might be in here.
I've modified some CAAnimation code I found here to try achieve this. My code is below. Since I'm reasonably new to CAAnimation, the issue could be in that, or with the RouteMe code itself. It's just animating the layer which the annotation wraps.
RMPointAnnotation *point = [[RMPointAnnotation alloc] initWithMapView:self.mapView coordinate:CLLocationCoordinate2DMake([location[@"lat"] floatValue], [location[@"lon"] floatValue]) andTitle:@"App open"];
point.image = [UIImage imageNamed:@"mapPin.png"];
[self.mapView addAnnotation:point];
CGRect endFrame = point.layer.frame;
// Move annotation out of view
point.layer.frame = CGRectMake(point.layer.frame.origin.x, point.layer.frame.origin.y - self.mapView.frame.size.height, point.layer.frame.size.width, point.layer.frame.size.height);
// Animate drop
[UIView animateWithDuration:2.0 delay:0.04 options:UIViewAnimationOptionCurveLinear animations:^{
point.layer.frame = endFrame;
// Animate squash
}completion:^(BOOL finished){
if (finished) {
[UIView animateWithDuration:0.05 animations:^{
point.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformMake(1.0, 0, 0, 0.8, 0, + point.layer.frame.size.height*0.1));
}completion:^(BOOL finished){
[UIView animateWithDuration:0.1 animations:^{
point.layer.transform = CATransform3DMakeAffineTransform(CGAffineTransformIdentity);
}];
}];
}
}];
Any ideas?