开发者

Compass guide to GPS destination

开发者 https://www.devze.com 2023-01-17 10:51 出处:网络
I want to rotate an ImageView with an arrow from the current user location to some previously saved开发者_运维百科 GPS location. How do I do this?

I want to rotate an ImageView with an arrow from the current user location to some previously saved开发者_运维百科 GPS location. How do I do this?

Is the Initial Bearing got from the Location.distanceBetween method the right way to go on this? If so, how do I use it with the compass readings?


You can use the bearingTo method in Location class, then retrieve the current bearing using the SensorManager.getOrientation method.

Finally, adding both results, draw the arrow.

Hope it helps.

0

精彩评论

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