From 73059dec1e990f47b7bcca065896be2df875b0f1 Mon Sep 17 00:00:00 2001 From: Kleinc Date: Fri, 31 Oct 2025 14:21:04 +0100 Subject: [PATCH] refactor(#48): :recycle: Remove unecessary code, make annotations always visble when pressing "add a location" --- src/AnnotationControl/annotationPanel.js | 12 ++++++++++++ src/potreeViewer.js | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/AnnotationControl/annotationPanel.js b/src/AnnotationControl/annotationPanel.js index 170bd58..684094d 100644 --- a/src/AnnotationControl/annotationPanel.js +++ b/src/AnnotationControl/annotationPanel.js @@ -988,6 +988,18 @@ export function initAnnotationsPanel(viewer) { annotationHeader.nextElementSibling.style.display = '' } } + // Ensure annotation labels are shown when starting to add a location. + // The "Show" button will be shown as active and reveals Potree's annotation container. + try { + const showBtn = document.getElementById('showLabelsBtn') + const hideBtn = document.getElementById('hideLabelsBtn') + if (showBtn) showBtn.classList.add('active') + if (hideBtn) hideBtn.classList.remove('active') + const cont = document.getElementById('potree_annotation_container') + if (cont) cont.style.display = '' + } catch (e) { + console.warn('Could not enable annotation labels on add', e) + } // Capture current camera view (position) at the moment the user clicks Add let camPos = null try { diff --git a/src/potreeViewer.js b/src/potreeViewer.js index 0b13435..5479902 100644 --- a/src/potreeViewer.js +++ b/src/potreeViewer.js @@ -55,9 +55,6 @@ export async function createPotreeViewer( viewer.loadGUI(() => { viewer.setLanguage('en') - $('#menu_appearance').next().hide() - $('#menu_tools').next().hide() - $('#menu_scene').next().hide() $('#menu_filters').remove() viewer.toggleSidebar()