iphone 4 compass and map
-
10-10-2019 - |
Question
how to use compass based on direction on google maps using iphone 4 ,as MAPS app doing
any tutorial to refer??
Thanks
Solution
In locationManager:didUpdateHeading:
, apply a cooresponding rotation transform to your map view:
double headingInRadians = newHeading.trueHeading * M_PI / 180.0;
mapView.transform = CGAffineTransformMakeRotation(headingInRadians);
The map view's frame should be a little bigger than the visible area so that no blank corners show up when it's rotated.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow