From 5da1c9c0d7c30ad63ddec46b48b5150c669a8224 Mon Sep 17 00:00:00 2001 From: David Tsay <3614296+davetsay@users.noreply.github.com> Date: Mon, 13 Feb 2023 11:28:00 -0800 Subject: [PATCH] Compass rose fix (#6318) * won't mount if cameraAngleOfView undefined * fix non-gimbling camera azimuth correct pan to azimuth * reorganize shared props passing * enable hud for non-gimbling cameras * fix unit tests * rotate function needs to work with numbers * avoid -0 * fix: don't delete imagery size, update related telemetry on focusedImage change * refactor: remove unused prop * fix: ensure thumbnail key is unique * fix: watch `focusedImage`, not `focusedImageIndex` - Corrects a false assumption that if the `focusedImageIndex` changes, the `focusedImage` has changed. This was causing us to mistakenly reset a lot of display props that control whether or not the Compass shows. - For example, if an image falls out of bounds, the `focusedImageIndex` will change as the old image is removed from the array. --------- Co-authored-by: Jesse Mazzella Co-authored-by: Jesse Mazzella Co-authored-by: Andrew Henry --- example/imagery/plugin.js | 2 +- .../imagery/components/Compass/Compass.vue | 38 ++++++----- .../imagery/components/Compass/CompassHUD.vue | 39 +++++++++--- .../components/Compass/CompassRose.vue | 63 ++++++++++--------- .../imagery/components/Compass/pluginSpec.js | 17 +++-- .../imagery/components/ImageryView.vue | 47 +++++++++++--- src/plugins/imagery/mixins/imageryData.js | 3 - 7 files changed, 133 insertions(+), 76 deletions(-) diff --git a/example/imagery/plugin.js b/example/imagery/plugin.js index 2eabb32361..044feb233a 100644 --- a/example/imagery/plugin.js +++ b/example/imagery/plugin.js @@ -275,7 +275,7 @@ function pointForTimestamp(timestamp, name, imageSamples, delay) { local: Math.floor(timestamp / delay) * delay, url, sunOrientation: getCompassValues(0, 360), - cameraPan: getCompassValues(0, 360), + cameraAzimuth: getCompassValues(0, 360), heading: getCompassValues(0, 360), transformations: navCamTransformations, imageDownloadName diff --git a/src/plugins/imagery/components/Compass/Compass.vue b/src/plugins/imagery/components/Compass/Compass.vue index 15d2f65090..ca96c77814 100644 --- a/src/plugins/imagery/components/Compass/Compass.vue +++ b/src/plugins/imagery/components/Compass/Compass.vue @@ -26,18 +26,23 @@ :style="`width: 100%; height: 100%`" > @@ -45,6 +50,7 @@