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

+8
View File
@@ -273,6 +273,14 @@ test('viewer caption reads "Image by" left, date right, and links to Mapillary',
assert.equal(view.viewer.open, true);
});
test('a bearing that rounds to north reads 0°, not 360°', () => {
const caption = (bearing) =>
presentStreetLevelPanel(snapshot({ street: { open: true, bearing } }))
.viewer.captionRight;
assert.equal(caption(359.4), '359°');
assert.equal(caption(359.6), '0°');
});
test('an image without a creator name leaves the left caption empty', () => {
const view = presentStreetLevelPanel(
snapshot({