diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 9837de2..d7a0b32 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '385'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '386'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/map.js b/backend/static/js/pages/map.js index 3c5fad5..67b6e5a 100644 --- a/backend/static/js/pages/map.js +++ b/backend/static/js/pages/map.js @@ -286,33 +286,35 @@ window.Page_map = (() => { // Leaflet + MarkerCluster laden // ---------------------------------------------------------- async function _loadLeaflet() { - if (_leafletLoaded || window.L) { _leafletLoaded = true; return; } + if (_leafletLoaded) return; - // Leaflet CSS - const lCss = document.createElement('link'); - lCss.rel = 'stylesheet'; lCss.href = '/css/leaflet.css'; - document.head.appendChild(lCss); + // Leaflet-Basis: nur laden wenn noch nicht vorhanden (diary.js kann es vorgeladen haben) + if (!window.L) { + const lCss = document.createElement('link'); + lCss.rel = 'stylesheet'; lCss.href = '/css/leaflet.css'; + document.head.appendChild(lCss); - // Leaflet JS - await new Promise(resolve => { - const s = document.createElement('script'); - s.src = '/js/leaflet.js'; s.onload = resolve; - document.head.appendChild(s); - }); + await new Promise(resolve => { + const s = document.createElement('script'); + s.src = '/js/leaflet.js'; s.onload = resolve; + document.head.appendChild(s); + }); + } - // MarkerCluster CSS - ['MarkerCluster.css', 'MarkerCluster.Default.css'].forEach(f => { - const l = document.createElement('link'); - l.rel = 'stylesheet'; l.href = `/css/${f}`; - document.head.appendChild(l); - }); + // MarkerCluster: separat prüfen — diary.js lädt Leaflet ohne MarkerCluster + if (!window.L.markerClusterGroup) { + ['MarkerCluster.css', 'MarkerCluster.Default.css'].forEach(f => { + const l = document.createElement('link'); + l.rel = 'stylesheet'; l.href = `/css/${f}`; + document.head.appendChild(l); + }); - // MarkerCluster JS - await new Promise(resolve => { - const s = document.createElement('script'); - s.src = '/js/leaflet.markercluster.js'; s.onload = resolve; - document.head.appendChild(s); - }); + await new Promise(resolve => { + const s = document.createElement('script'); + s.src = '/js/leaflet.markercluster.js'; s.onload = resolve; + document.head.appendChild(s); + }); + } _leafletLoaded = true; } diff --git a/backend/static/sw.js b/backend/static/sw.js index 836ef26..ca5421c 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v405'; +const CACHE_VERSION = 'by-v406'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten