mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

Panning during animated annotation view movement causes view to stick

Open jmkiley opened this issue 8 years ago • 1 comments

Platform: iOS Mapbox SDK version: v3.5.0

Steps to trigger behavior

  1. Add an annotation view.
  2. Animate it to move to a location that is offscreen.
    MGLPointAnnotation *annot = [[MGLPointAnnotation alloc] init];
    annot.coordinate = self.mapView.centerCoordinate;
    [self.mapView addAnnotation:annot];
    
    CGPoint point = CGPointMake(-200, CGRectGetMidY(self.view.bounds));
    
    CLLocationCoordinate2D coord = [self.mapView convertPoint:point toCoordinateFromView:self.view];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [UIView animateWithDuration:10 animations:^{
            annot.coordinate = coord;
        }];
    });
  1. Pan the map view.

Expected behavior

The MGLAnnotationView would follow its original path within the map view.

Actual behavior

animationbug

The annotation view generally continues to follow its original animation path within the view. The coordinates may update after a few seconds, and the annotation will end up at the original destination.

cc @boundsj

jmkiley avatar Mar 29 '17 01:03 jmkiley

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

stale[bot] avatar Nov 26 '18 11:11 stale[bot]