diff --git a/INSPIRE_HILUCS_Workshop.pptx b/INSPIRE_HILUCS_Workshop.pptx new file mode 100644 index 0000000..581de48 Binary files /dev/null and b/INSPIRE_HILUCS_Workshop.pptx differ diff --git a/index.html b/index.html index 59ee981..b022efb 100644 --- a/index.html +++ b/index.html @@ -1689,7 +1689,7 @@
- diff --git a/main.js b/main.js index 386a209..2a03d02 100644 --- a/main.js +++ b/main.js @@ -140,10 +140,14 @@ let embedBridge = null; const EMBED_CONFIG = (typeof window !== 'undefined' && window.LUPMIS_EMBED) || null; const IS_EMBED_PERMIT = !!(EMBED_CONFIG && EMBED_CONFIG.mode === 'permit'); -// Current interaction mode: 'addLocation' | 'measureCircle' | 'measureLine' | 'measureArea' -// In embed permit mode we don't want the default Add-Location click to fire, -// so start the mode in a neutral state. -let currentMode = IS_EMBED_PERMIT ? 'embed-permit' : 'addLocation'; +// Current interaction mode: 'none' | 'addLocation' | 'measureCircle' | +// 'measureLine' | 'measureArea' | 'draw' | 'embed-permit'. +// Default is 'none' — a neutral state where map clicks do not trigger +// the Add-Location popup. Users explicitly opt into Add-Location by +// pressing the Add button in the bottom dock; pressing it again toggles +// the mode back off. Measurement / Draw tools also return to 'none' +// when toggled off, rather than implicitly re-entering Add-Location. +let currentMode = IS_EMBED_PERMIT ? 'embed-permit' : 'none'; // ============================================================================ // Application Initialization @@ -705,11 +709,18 @@ function initUI() { } }; - // Add Location mode button + // Add Location mode button — toggles. Clicking it once activates the + // mode (subsequent map-clicks open the Add-Location popup); clicking it + // again returns to the neutral 'none' mode so accidental map taps don't + // trigger the popup. if (addLocationBtn) { addLocationBtn.addEventListener('click', () => { - console.log('[Button] Add Location clicked'); - setMode('addLocation', addLocationBtn); + console.log('[Button] Add Location clicked, currentMode is:', currentMode); + if (currentMode === 'addLocation') { + setMode('none', null); // toggle off + } else { + setMode('addLocation', addLocationBtn); // activate + } }); } @@ -718,8 +729,9 @@ function initUI() { measureCircleBtn.addEventListener('click', () => { console.log('[Button] Circle clicked, currentMode is:', currentMode); if (currentMode === 'measureCircle') { - // Toggle off - return to addLocation mode - setMode('addLocation', addLocationBtn); + // Toggle off — return to the neutral 'none' mode (no implicit + // Add-Location re-activation). + setMode('none', null); } else { setMode('measureCircle', measureCircleBtn); } @@ -731,7 +743,7 @@ function initUI() { measureLineBtn.addEventListener('click', () => { console.log('[Button] Line clicked, currentMode is:', currentMode); if (currentMode === 'measureLine') { - setMode('addLocation', addLocationBtn); + setMode('none', null); } else { setMode('measureLine', measureLineBtn); } @@ -743,7 +755,7 @@ function initUI() { measureAreaBtn.addEventListener('click', () => { console.log('[Button] Area clicked, currentMode is:', currentMode); if (currentMode === 'measureArea') { - setMode('addLocation', addLocationBtn); + setMode('none', null); } else { setMode('measureArea', measureAreaBtn); } @@ -755,7 +767,7 @@ function initUI() { drawBtn.addEventListener('click', () => { console.log('[Button] Draw clicked, currentMode is:', currentMode); if (currentMode === 'draw') { - setMode('addLocation', addLocationBtn); + setMode('none', null); } else { setMode('draw', drawBtn); }