It is already fixed in the modern app:
https://github.com/traccar/traccar-web/blob/master/modern/src/common/util/formatter.js#L25-L32
I believe it should be
let normalizedValue = (value + 45 / 4) % 360;
instead of
let normalizedValue = (value + 45 / 2) % 360;
What makes you think that? We have a step of 45 degrees. We need to increase by half a step, if I understand it correctly.
Do you have an example that doesn't work?
Ok my bad, I confused 90° and 45° angles.
But still, when I feed the modern web app a course of 192°, it shows as S, instead of SW.
I will double check now.
It sounds like you're using an outdated version of the app.
It's fine. Apologies for the false alarm.
I'm still getting incorrect course rounding on the demo3 server with the modern web app.
Can you please provide a screenshot and course value?
After posting a course of 44.9°
http://demo3.traccar.org:5055/?id=6660&valid=1&lat=4&lon=5&bearing=44.9
Traccar shows a N course:
https://drive.google.com/file/d/1d7ZqSHkjdrK36F6Jl4hyNk_vIVIsJ7zb/view?usp=sharing
Looks like you haven't clear your browser cache. That's an old version of the app.
Indeed it was!
I tested courses 22.4°, 22.6°, 337.4°, 337,6° and got arrows in the right direction (N, NE, NW, N).
Thx a lot.
If you feed Traccar a course of 192° it will show it as S (South) in the web app, whereas SE (South-East) would be more accurate.
Therefor, in
web/app/AttributeFormatter.js
I suggest to replace
with