You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Occasionally I'm only able to zoom in/out between two zoom levels, when we are supposed to be able to zoom between three. The UI will show that you can continue to zoom, but clicking on the buttons won't actually zoom.
Potential solution(s)
The issue seems to be that we'll be set to a non-integer zoom, and we aren't rounding to the nearest integer. I'm running into this issue now, for example, and svv.panorama.getPov().zoom is returning 1.9999999999999996. The valid zoom levels are 1, 2, and 3, so we should be able to zoom out one more time, but I'm not able to. I took a look at ZoomConrol.js, and noticed that we are just adding/subtracting 1 to the zoom level and setting it, so we never deal with the non-integer zoom.
function zoomOut () {
let zoomLevel = svv.panorama.getPov().zoom;
if (zoomLevel >= 2) {
zoomLevel -= 1;
svv.panorama.setZoom(zoomLevel);
}
updateZoomAvailability();
}
Here, zoomLevel is not greater than or equal to 2, so we won't zoom out again.
In both zoomIn() and zoomOut(), we should change
let zoomLevel = svv.panorama.getPov().zoom;
to
let zoomLevel = Math.round(svv.panorama.getPov().zoom);
The text was updated successfully, but these errors were encountered:
I've also noticed that on the Explore page, we're using parseInt() instead of Math.round(). At first glance this seems less than ideal. My guess is that in this situation, it would make it so that the first time you try to zoom in we say that the current zoom level is parseInt(1.9999999999999996) which would be 1, then we increase the zoom to 2. So it would look like nothing happened. Then if you try to zoom in a second time it works correctly, setting the zoom to 3. I haven't tested this and seen it happen, but that's my guess. I would want to go back in the git history and old PRs to see if there was a reason for implementing it this way.
Brief description of problem/feature
Occasionally I'm only able to zoom in/out between two zoom levels, when we are supposed to be able to zoom between three. The UI will show that you can continue to zoom, but clicking on the buttons won't actually zoom.
Potential solution(s)
The issue seems to be that we'll be set to a non-integer zoom, and we aren't rounding to the nearest integer. I'm running into this issue now, for example, and
svv.panorama.getPov().zoom
is returning1.9999999999999996
. The valid zoom levels are 1, 2, and 3, so we should be able to zoom out one more time, but I'm not able to. I took a look atZoomConrol.js
, and noticed that we are just adding/subtracting 1 to the zoom level and setting it, so we never deal with the non-integer zoom.Here,
zoomLevel
is not greater than or equal to 2, so we won't zoom out again.In both
zoomIn()
andzoomOut()
, we should changeto
The text was updated successfully, but these errors were encountered: