fix(street-level): show a 359.6° bearing as 0°, not 360°

The Street Level viewer caption rounded the photo's bearing without
wrapping, so a view facing 359.5° or more read "360°". The rounded
bearing now wraps to 0°.
This commit is contained in:
Aditya committed 2026-10-27 15:52:27 +05:30
1 parent 15de9d738c
commit 6d6b2e8fe9
3 files changed
+12 -1

No files matched your search

+2 -1
View File
@@ -168,8 +168,9 @@ function presentViewer(state) {
const { street } = state;
const right = [];
if (street.isPano) right.push('360°');
// 359.5° and above rounds to north; modulo keeps it from printing 360°.
if (Number.isFinite(street.bearing))
right.push(`${Math.round(street.bearing)}°`);
right.push(`${Math.round(street.bearing) % 360}°`);
if (street.capturedAt)
right.push(formatDate(street.capturedAt, street.capturedAtPrecision));
const left = [];