1

In my app design I want to show tilted map (just like Apple 3D map but in pre-iOS 7 too). I am using transforms to achieve this but the results aren't satisfactory.

My annotations look skewed (I want them straight & facing user - not aligning with my map). Also after applying transform my map stops scrolling.

- (void) animateMap
{
    [UIView animateWithDuration:0.8 animations:
     ^{
         CATransform3D transform = CATransform3DIdentity;
         transform.m34 = 1.0 / -1200.0;
         transform = CATransform3DRotate(transform, M_PI_4, 1.0, 0.0, 0.0);
         CATransform3D transform1 = CATransform3DScale(transform, 1.33, 1.66, 0);
         map.layer.transform = transform1;
    }
    completion:^(BOOL finished)
    {
        for (id ann in map.annotations)
        {
           [UIView animateWithDuration:0.8 animations:
            ^{
                MKAnnotationView * annView = [map viewForAnnotation:ann];
                CATransform3D transform = CATransform3DIdentity;
                transform.m34 = 1.0 / -1200.0;
                transform = CATransform3DRotate(transform, -M_PI_4, 1.0, 0.0, 0.0);
                annView.layer.transform = transform;
           }];
        }
    }];
}
Nirav Bhatt
  • 6,940
  • 5
  • 45
  • 89

0 Answers0