diff --git a/src/Global/SplitScreen/index.js b/src/Global/SplitScreen/index.js index f71eb14..c7e2c3a 100644 --- a/src/Global/SplitScreen/index.js +++ b/src/Global/SplitScreen/index.js @@ -146,10 +146,8 @@ async function init(sdk) { rightElm.style.position = 'absolute' rightElm.style.right = 'calc(50% - 50px)' - if (!activeIds || activeIds.length == 0) { - leftElm.style.display = 'none' - rightElm.style.display = 'none' - } + leftElm.style.display = 'none' + rightElm.style.display = 'none' sdk.viewer._element.appendChild(leftElm) sdk.viewer._element.appendChild(rightElm) @@ -158,6 +156,12 @@ async function init(sdk) { let right = 0 if (activeIds) { for (let i = 0; i < activeIds.length; i++) { + let thatP = sdk.entityMap.get(activeIds[i]) + if (!thatP || (thatP.type === 'terrain' || !thatP.show) || thatP.type === 'TextBox') { + continue + } + leftElm.style.display = 'unset' + rightElm.style.display = 'unset' let status = statusMap.get(activeIds[i]) if (status) { if (status.P) { @@ -1290,6 +1294,8 @@ function setActiveId(ids = []) { } else { if (leftElm && rightElm) { + leftElm.style.display = 'none' + rightElm.style.display = 'none' let left = 0 let right = 0 for (let i = 0; i < activeIds.length; i++) { @@ -1309,8 +1315,6 @@ function setActiveId(ids = []) { let thatP = sdkP.entityMap.get(activeIds[i]) // let thatD = sdkD.entityMap.get(activeIds[i]) if (!thatP || (thatP.type === 'terrain' || !thatP.show) || thatP.type === 'TextBox') { - leftElm.style.display = 'none' - rightElm.style.display = 'none' continue } leftElm.style.display = 'unset'