Android:根据设备方向和用户位置将箭头指向目标(LatLng) [英] Android: Make an arrow point to a destination (LatLng) based on device orientation and user location

查看:198
本文介绍了Android:根据设备方向和用户位置将箭头指向目标(LatLng)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发基于地理定位的Android应用程序,实际上这是一个指南。我真的需要这方面的帮助:

I am developing an Android app based on geolocation, It's a Guide actually. And I really need help in this part :

假设我们有:

Let's assume we have :


  1. 经度&地图中点(L)的纬度。

  2. 经度&用户所在点(I)的纬度。

  3. 显示箭头的活动。

如何让箭头指向L点? (当然,根据我的观点和设备的方向)

How can I make that arrow point to the point L ? (Based of course on the point I, and on the device's orientation)

我不是要求代码。这将是太多问。我只需要推理。或者一个简单的方法来做到这一点?图书馆?一个框架?数学公式?我真的无法在任何地方找到答案。

I am not asking for code. It would be too much asked. I Just need the reasoning . Or maybe a simple method to do this ? a library? a framework? mathematical formula ? I really can't find an answer anywhere.

对不起,如果已经有人问过。

Sorry if it has already been asked.

推荐答案

bearing 部分

仅供参考,我的谷歌查询是

FYI, my google query was


两点之间的指南针方向

compass direction between two points

这篇关于Android:根据设备方向和用户位置将箭头指向目标(LatLng)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆