feat: add support for heading#14
Conversation
OS-pedrogustavobilro
left a comment
There was a problem hiding this comment.
@ItsChaceD left some comments for you to take a look, when you can.
@27pchrisl thank you for the PR! We'll be doing a review and also making any necessary changes. I believe there's no action here on your end, but feel free to reply to any comments or ask questions if you have any. Thanks again!
|
@ItsChaceD I think some unit tests are failing, if you could take a look please. |
|
@ItsChaceD don't know if this was happening with you, but when testing, I'm getting a spam of location updates, that I don't think I every got before. Maybe it's |
|
@27pchrisl the PR ended up having some changes, feel free to share your thoughts if any of these go against your use case. Particularly
Now the location is not regenerated every time there is a new heading, but rather we locally update the heading in the library and return it only where there's a new location. Related comment: #14 (comment) |
Hi!
I was using
@capacitor/geolocationand found that for iOS it uses the "course" from CLLocation instead of the "heading" from CLHeading. This means you only get the direction of movement, and not the compass bearing.Because that library uses this library, I've added the support to this library to add these values first.
This change will make the location regenerate every time the compass moves more than 1 degree (as fast as I can tell that's how the iOS Compass app updates as well).