mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 07:25:15 +02:00
Try to preserve the viewer rotation when staying on the same sequence
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user