Ios 6 MapKit annotation designator

Our app has a rotating map view that aligns with the compass heading. We rotate annotations so that their leaders remain horizontal for reading. This works fine on iOS5 devices, but is corrupted on iOS6 (the problem is with the same binary code as on the iOS5 device, and with the binary code embedded in the iOS6 SDK). Annotations are first rotated to the correct horizontal position, and then after some time return to the uncorrected rotation. We cannot see any events that cause this. This is the code fragment that we use in - (MKAnnotationView *) mapView: (MKMapView *) theMapView viewForAnnotation: (id) annotation

CATransform3D transformZ = CATransform3DIdentity; transformZ = CATransform3DRotate(transformZ, _rotationZ, 0, 0, 1); annotation.myView.layer.transform = transformZ; 

Has anyone else seen this, and has anyone had suggestions for fixing it on iOS6?

0
source share
1 answer

I had an identical problem, so my workaround might work for you. I also reported an Apple bug. For me, every time a map has been tinted by a user, annotations will be โ€œunaffectedโ€.

In my code, I set the rotation using CGAffineTransformMakeRotation, and I do not set it in viewForAnnotation, but whenever users location is updated. So this is a little different from you.

My workaround was to add an extra minor rotation to the bottom of my viewForAnnotation method.

 if(is6orMore) { [annView setTransform:CGAffineTransformMakeRotation(.001)]; //iOS6 BUG WORKAROUND !!!!!!! } 

So, for you, I'm not sure if this works as you rotate differently and do it in viewForAnnotation. But try it.

I found me forever to find, and I just went through this fix.

+3
source

All Articles