mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
Merge remote-tracking branch 'origin/main' into codex/hal-646-zh-hant
This commit is contained in:
commit
d1ba0a7b8a
134 files changed
+726
-584
No files matched your search
@@ -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 = [];
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user