title: Car (Annotation) animation (like uber app) not working
body: <p>I made one demo project (from Moving-MKAnnotationView demo on github) for moving car on map following is its link</p>
  
  <p><a href="https://github.com/pratikbhiyani/Moving-MKAnnotationView" rel="noreferrer">https://github.com/pratikbhiyani/Moving-MKAnnotationView</a></p>
  
  <p>I edit my code on the basis of given answer by vinaut but still <strong>problem is that when we zoom or scroll the map animation get distract in ios 7 and in ios 6 when we zoom or scroll the map annotation set to its original angle for a while.</strong></p>
  
  <p><strong>Below is a screen shot of my Demo Project</strong></p>
  
  <p><img src="https://i.stack.imgur.com/Zmxh2.png" alt="enter image description here"></p>
  
  <p>Here is some code i change </p>
  
  <pre><code>- (void) setPosition : (id) posValue;
  {
      NSLog(@"set position");
  
      //extract the mapPoint from this dummy (wrapper) CGPoint struct
      MKMapPoint mapPoint = *(MKMapPoint*)[(NSValue*)posValue pointerValue];
  
      CLLocationCoordinate2D coord = MKCoordinateForMapPoint(mapPoint);
      CGPoint toPos;
      if ([[[UIDevice currentDevice] systemVersion] floatValue] &gt;= 7) {
  
          toPos = [self.mapView convertCoordinate:coord toPointToView:self.mapView];
      }
      else
      {
          CGFloat zoomFactor =  self.mapView.visibleMapRect.size.width / self.mapView.bounds.size.width;
          toPos.x = mapPoint.x/zoomFactor;
          toPos.y = mapPoint.y/zoomFactor;
      }
  
  
  
      [self setTransform:CGAffineTransformMakeRotation([self getHeadingForDirectionFromCoordinate:MKCoordinateForMapPoint(previousPoint) toCoordinate: MKCoordinateForMapPoint(mapPoint)])];
  
      if (MKMapRectContainsPoint(self.mapView.visibleMapRect, mapPoint)) {
  
          CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
  
          animation.fromValue = [NSValue valueWithCGPoint:self.center];
          animation.toValue = [NSValue valueWithCGPoint:toPos];
          animation.duration = 1.0;
          animation.delegate = self;
          animation.fillMode = kCAFillModeForwards;
          //[self.layer removeAllAnimations];
          [self.layer addAnimation:animation forKey:POSITIONKEY];
  
          //NSLog(@"setPosition ANIMATED %x from (%f, %f) to (%f, %f)", self, self.center.x, self.center.y, toPos.x, toPos.y);
      }
  
      self.center = toPos;
  
      previousPoint = mapPoint;
  }
  </code></pre>
  
  <p><strong>My goal is to move car same like in uber app.</strong></p>