MKMapview transform rotate only the map content
I need to transform-rotate a MKMapview based on the course of the CLLocations I get from CoreLocation. I basically have this already:
mapview.transform = CGAffineTransformMakeRotation(degreesToRadians(course));
However, this is not good since this rotates the entire map, with annotations. Now I can fix the annotations, but the problem is it also rotates the Google logo!
After searching all other posts here on this problem the main answer was this is not possible with the google logo but the thing is, I have seen some Apps (Trapster for example) that actually do this, they rotate the map but the google logo is always in the same place. So my question is, is there a new function I don't know about that purely rotates the content of the map, or do all these apps rotate the mapview, fix rotations of the annotations and perhaps add their own google im开发者_高级运维age to the view containing the mapview? Thanks!
Probably you could do by finding the right view with mapView.subviews.
If I do:
for (UIView *aView in mapView.subviews){
NSLog(@"view class: %@", aView.class);
}
I get back:
view class: UILabel
view class: UIView
view class: UIImageView
view class: UILabel
I would guess one of these is the google logo and the map itself...
精彩评论