Currently I am implementing a feature, where the user can correct manually a pin on the map. I have set the annotationView to annotationView.draggable = YES;
and I have also implemented the delegate method to receive the new coordinates. But how can I now tell the mapView that the dragging action should stop now and the pin gets its fixed position on the map, even if the map is then moved.
The current behaviour is that after the dragging of the pin to a new position, if I then move the map, the pin has its fixed position just on the device screen but not on the map.
Help is appreciated :).
Delegate:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annotationView didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState
{
if (newState == MKAnnotationViewDragStateEnding)
{
CLLocationCoordinate2D droppedAt = annotationView.annotation.coordinate;
NSLog(@"Pin dropped at %f,%f", droppedAt.latitude, droppedAt.longitude);
}
}