Skip to content

Commit

Permalink
refactor(#48): ♻️ Remove unecessary code, make annotations always vis…
Browse files Browse the repository at this point in the history
…ble when pressing "add a location"
  • Loading branch information
kleinc committed Oct 31, 2025
1 parent 891daef commit 73059de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/AnnotationControl/annotationPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions src/potreeViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 73059de

Please sign in to comment.