仅使用卫星纬度/经度启动标题/面向方向
我从NMEA读者那里获得了自己的位置,这不会返回轴承,这是一个问题。我想始终显示该应用程序用户面临的方向,就像Google Maps位置层的小箭头指示用户面对的方向一样。 我尝试使用True North作为固定目的地,从而从我的位置到True North计算轴承。但这不如我所期望的。(当我转动时,标记不会与该轴承一起旋转),并且我尝试使用电磁传感器,但在我的Techno手机中不可用。 因此,只有一个纬度和经度,有没有办法弄清楚用户面临的位置?并可能朝那个方向绘制箭头? (从我的自定义位置提供商NMEA格式实时,LAT/LNG不断进来
)我只是得到坐标,想知道我在任何一点上面对的位置
I get my location from an NMEA reader and this does not return bearing which is an issue. I want to always show the direction the user of the app is facing, just like how google maps location layer has a small arrow indicating direction user is facing.
I have tried using true North as a fixed destination point and thus calculating bearing from my location to True North. But this does not work as i expected.(When i turn, the marker does not rotate with that bearing), and i tried using the electromagnetic sensor but it is not available in my techno phone.
So, with only a latitude and Longitude, is there a way i can figure out where the user is facing? And probably draw an arrow in that direction? (The lat/lng keep coming in, in real time from my custom location provider in nmea format)
note: I don't have a set/absolute destination point so bearingTo might not be helpful. I just get the coordinates, and want to know where I'm facing at any one point
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
,是的,如果没有任何数据,就无法计算您的方向。您需要向方向移动。如果在
rmc
消息或其他消息中没有轨道标题,那么唯一的方法是通过随着时间的推移使用几个点并从那里弄清楚一个向量来计算自己。这要求您朝着一个方向移动,而不仅仅是旋转。Well, yes, you can't calculate your orientation without any data to do so with. You need to be moving in a direction. If there is no track heading in the
RMC
message, or other messages, then the only way is to calculate one yourself by using several points over time and figuring out a vector from there. This requires that you are moving in a direction, and not simply rotating.