diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 599d081c8..94dfb4ba1 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -222,8 +222,6 @@ function initCore() { } // for support QUIP 2.0 const data = Array.isArray(e.data) ? e.data[e.data.selected] : e.data; - console.log('data', data); - const type = data.provenance.analysis.source; let body; let attributes; @@ -261,11 +259,11 @@ function initCore() { // add center position and zoom - if (data.viewerStates != undefined) { + if (data.geometries.features[data.selected].viewerStates != null || data.geometries.features[data.selected].viewerStates != undefined) { const decimalPlaces = 3; - attributes.X = data.viewerStates.x, - attributes.Y = data.viewerStates.y, - attributes.zoom = roundTo(data.viewerStates.zoom, decimalPlaces); + attributes.X = data.geometries.features[data.selected].viewerStates.x, + attributes.Y = data.geometries.features[data.selected].viewerStates.y, + attributes.zoom = roundTo(data.geometries.features[data.selected].viewerStates.z, decimalPlaces); } // Rounds a number to the specified number of decimal places. function roundTo(num, decimalPlaces) {