开发者

iphone 4 compass and map

开发者 https://www.devze.com 2023-01-29 21:37 出处:网络
how to use compass based on direction on g开发者_运维知识库oogle maps using iphone 4 ,as MAPS app doing

how to use compass based on direction on g开发者_运维知识库oogle maps using iphone 4 ,as MAPS app doing

any tutorial to refer??

Thanks


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号