如何使用位置管理器返回的方位值找到用户移动方向?

How to find the user moving direction using the bearing value returned by location manager?

LocationObject.getBearing() returns 该设备的水平行进方向[0 到 360 度]。

如何根据这个方位值计算用户的移动方向,如北、南等?

提前致谢。

来自documentation

Returns the direction of travel in degrees East of true North. If hasBearing() is false, 0.0 is returned.

  • 所以 0 是北(度数顺时针)
  • 所以 90 是东
  • 180 南
  • 270 西