How to animate the movement of annotations on MKMapView

How to animate annotation movement on MKMapView? When the position of the annotation changes, does the annotation move to another position with animation?

+4
source share
2 answers

You need to use these delegate methods for setRegion:animated: and regionThatFits:

 [mapView setRegion:region animated:YES]; [mapView regionThatFits:region]; 

Also note that map updates do not work with animations when using SIMULATOR. When you try to use setCenterCoordinate:animated: on a device, it works with animation.

-3
source

This question answers.

A simple coordinate conversion in UIView animateWithDuration works fine:

 [UIView animateWithDuration:0.3f animations:^{ myAnnotation.coordinate = newCoordinate; }] 
+13
source

Source: https://habr.com/ru/post/1383319/


All Articles