mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix(alpr): show a 359.6° camera bearing as 0°, not 360°
The selected ALPR card rounded a mapped camera:direction without wrapping, so a camera facing 359.5° or more read "DIRECTION 360°". The rounded bearing now wraps to 0°.
This commit is contained in:
1 parent
a4d3701c3c
commit
065d7f4f8b
3 files changed
+23
-2
No files matched your search
@@ -49,8 +49,9 @@ export function alprLabelDetails(record, source) {
|
||||
const details = [
|
||||
sourceName === 'OpenStreetMap' ? 'OSM MAPPED' : `Source: ${sourceName}`,
|
||||
];
|
||||
// Wrap after rounding: 359.6° rounds to 360°, which is north.
|
||||
if (Number.isFinite(record.directionDeg))
|
||||
details.push(`DIRECTION ${Math.round(record.directionDeg)}°`);
|
||||
details.push(`DIRECTION ${Math.round(record.directionDeg) % 360}°`);
|
||||
const equipment = [
|
||||
...new Set(
|
||||
[record.manufacturer, record.operator, record.cameraType]
|
||||
|
||||
Reference in new issue
Block a user