Try to preserve the viewer rotation when staying on the same sequence

This commit is contained in:
Bryan Housel
2018-06-13 15:21:47 -04:00
parent e493bb4c64
commit d859c1ca04
2 changed files with 12 additions and 3 deletions
+5 -1
View File
@@ -446,9 +446,13 @@ export default {
/**
* showViewer()
*/
showViewer: function () {
showViewer: function (yaw) {
if (!_sceneOptions) return;
if (yaw !== undefined) {
_sceneOptions.yaw = yaw;
}
if (!_pannellumViewer) {
this.initViewer();
} else {
+7 -2
View File
@@ -11,6 +11,7 @@ export function svgStreetside(projection, context, dispatch) {
var minViewfieldZoom = 18;
var layer = d3_select(null);
var _viewerYaw = 0;
var _selectedSequence = null;
var _streetside;
/**
@@ -96,11 +97,15 @@ export function svgStreetside(projection, context, dispatch) {
var service = getService();
if (!service) return;
_viewerYaw = 0;
// try to preserve the viewer rotation when staying on the same sequence
if (d.sequenceKey !== _selectedSequence) {
_viewerYaw = 0; // reset
}
_selectedSequence = d.sequenceKey;
service
.selectImage(d)
.showViewer();
.showViewer(_viewerYaw);
context.map().centerEase(d.loc);
}