#include #include #include #include #include #include #include #include #include #include MSClassHook(UIView) MSClassHook(MKMapViewHeadingChange) MSClassHook(MKUserLocationLayer) MSClassHook(MKMapView) MSMetaClassHook(MKMapViewHeadingChange) MSClassMessageHook0(id, MKMapViewHeadingChange, rotationAnimation) { return nil; } volatile bool state_; MSInstanceMessageHook1(void, MKUserLocationLayer, setAffineTransform, CGAffineTransform, transform) { if (state_) MSOldCall(transform); } MSInstanceMessageHook0(BOOL, MKMapView, shouldRotateForHeading) { MSIvarHook(MKMapViewInternal *, _internal); double &heading(MSHookIvar(_internal, "heading")); MKUserLocationView *location([self userLocationView]); state_ = true; [location rotateToDegrees:heading]; state_ = false; return NO; }