Android getbearing only returns 0.0. Trying to use to rotate current location icon

后端 未结 2 778
灰色年华
灰色年华 2021-01-07 13:32

This is in part an extension to a previous question: Android programming, mapview locationoverlay: how to change the default blue location dot, with another image

I

相关标签:
2条回答
  • 2021-01-07 13:42

    What is location provider? If it NETWORK_PROVIDER, then you won't get bearing, because its accuracy is to low, to detect bearing.

    Try your app outside and with GPS_PROVIDER?

    0 讨论(0)
  • 2021-01-07 14:03

    Problem solved! Thanks to Aleksejs for your efforts - turned out it was a case of PICNIC.

    I had set the GPS to update at the smallest movement, and as the location was jumping around I assumed it should be able to work out bearing and get on with it.

    When testing out the result from 'getSpeed()' I noticed bearing working - turns out you have to move a little further than around the garden to give it time to work out your bearing.

    Regards

    Nick

    0 讨论(0)
提交回复
热议问题