keithamoss / mapa

2 stars 0 forks source link

Add a direction/heading indicator #543

Closed keithamoss closed 3 months ago

keithamoss commented 10 months ago

Have it snap back to point north when not following bearing

keithamoss commented 4 months ago

Looks like we may need to dig into this further.

It seems that GeolocationCoordinates.heading is only reported if the device is moving. (Though we haven't noticed this yet.)

Ref: https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates/heading

Other resources point us towards DeviceOrientationEvent, but that sounds like a bit of a minefield of patchy support at best.

Ref: https://developer.mozilla.org/en-US/docs/Web/API/Device_orientation_events/Detecting_device_orientation Ref: https://stackoverflow.com/questions/47720854/why-does-heading-stay-null-for-geolocation-on-android-with-chrome Ref: https://stackoverflow.com/questions/18112729/calculate-compass-heading-from-deviceorientation-event-api