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:
Aditya committed 2026-10-28 15:15:16 +05:30
1 parent a4d3701c3c
commit 065d7f4f8b
3 files changed
+23 -2

No files matched your search

+2 -1
View File
@@ -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]