Using Compass to point to actual coordinate location instead of just North

泪湿孤枕 提交于 2019-12-04 16:53:02
Jenn

I would find the bearing from coordinate A to coordinate B and then use that bearing as an offset for the compass bearing from coordinate A to coordinate B.

Here are two links for finding a bearing to a coordinate

Calculating bearing between two CLLocationCoordinate2Ds

http://shawnsbits.com/blog/2011/07/07/calculating-heading-with-corelocation/

If you want the compass bearing to update as you move so it always points to coordinate B, then you probably want to recalculate whenever you get a new bearing or location.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!