Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a much simpler alternative #5

Open
malhal opened this issue Apr 26, 2014 · 2 comments
Open

There is a much simpler alternative #5

malhal opened this issue Apr 26, 2014 · 2 comments

Comments

@malhal
Copy link

malhal commented Apr 26, 2014

Seems like you did a ton of work trying to solve this problem however you'll find this simple trick of setting the annotation again will cause it to update to the new coordinate:

MKAnnotationView* annotationView = [self.mapView viewForAnnotation:a];
a.coordinate = newCoordinate;
annotationView.annotation = a;

Furthermore if you want to animate the move just do:

[UIView animateWithDuration:0.5 animations:^{
a.coordinate = coordinate;
annotationView.annotation = a;
}];

FYI I saw you setting a mapView on your HGMovingAnnotationView causing a circular reference, tut tut you should be ashamed ;-)

@malhal malhal changed the title Erm sorry for the shock There is a much simpler alternative Apr 26, 2014
@primedev-iOS
Copy link

Hey malcolmhall your logic seems alright there.
Can you please help me for my same problem?
I am working on app which will animate a annotation from one position to another live.Means I will receive coordinates from server in particular time manner.Please help me I in real trouble.:(

@ekimia
Copy link

ekimia commented Jan 26, 2015

@MalcolmHall the annotationView.annotation = a; part isn't needed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants