From 5cb7c3091da0c3999c089860c941a45cce663df9 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 5 Jun 2026 09:01:58 +0200 Subject: [PATCH] =?UTF-8?q?Diagnose:=20/ui-vector-test=20=E2=80=94=20teste?= =?UTF-8?q?t=20echten=20ui.js-Vektor-Pfad=20(UI.map.create)=20ohne=20Auth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/main.py | 6 ++++++ backend/static/js/ui-vector-test.js | 23 +++++++++++++++++++++++ backend/static/ui-vector-test.html | 18 ++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 backend/static/js/ui-vector-test.js create mode 100644 backend/static/ui-vector-test.html diff --git a/backend/main.py b/backend/main.py index a077881..14622d7 100644 --- a/backend/main.py +++ b/backend/main.py @@ -435,6 +435,12 @@ async def leaflet_vector_test(): # Isolationstest: protomaps-leaflet + map-vector.js + DACH-PMTiles, ohne App-Shell/Flag. return FileResponse(os.path.join(STATIC_DIR, "leaflet-vector-test.html"), media_type="text/html") + +@app.get("/ui-vector-test") +async def ui_vector_test(): + # Testet den echten ui.js-Vektor-Pfad (UI.map.create) ohne Auth/App-Shell. + return FileResponse(os.path.join(STATIC_DIR, "ui-vector-test.html"), media_type="text/html") + # User-generierte Medien (Fotos aus Tagebuch, Giftköder-Alarm, etc.) MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media") os.makedirs(MEDIA_DIR, exist_ok=True) diff --git a/backend/static/js/ui-vector-test.js b/backend/static/js/ui-vector-test.js new file mode 100644 index 0000000..3676e1e --- /dev/null +++ b/backend/static/js/ui-vector-test.js @@ -0,0 +1,23 @@ +// Testet den ECHTEN ui.js-Vektor-Pfad: lädt die reale ui.js und baut die Karte +// via UI.map.create() — exakt wie die App. Beweist, ob UI.map.vectorEnabled()/ +// vectorLayer() im realen ui.js-Kontext funktionieren (unabhängig von Auth/SW). +(function () { + 'use strict'; + var s = document.getElementById('status'); + function set(t) { if (s) s.textContent = t; } + (async function () { + try { + if (!window.UI || !UI.map) return set('❌ UI.map nicht definiert (ui.js nicht geladen?)'); + var enabled = UI.map.vectorEnabled ? UI.map.vectorEnabled() : 'METHODE FEHLT'; + set('vectorEnabled=' + enabled + ' — erstelle Karte…'); + var m = await UI.map.create('map', { center: [48.137, 11.576], zoom: 12 }); + var layers = []; + m.eachLayer(function (l) { layers.push(l.constructor && l.constructor.name); }); + set('✅ Karte erstellt | vectorEnabled=' + enabled + ' | Layer: ' + layers.join(',') + + ' | protomapsL=' + !!window.protomapsL + ' MapVector=' + !!window.MapVector); + } catch (e) { + set('❌ Fehler: ' + (e && e.message ? e.message : e)); + console.error(e); + } + })(); +})(); diff --git a/backend/static/ui-vector-test.html b/backend/static/ui-vector-test.html new file mode 100644 index 0000000..24d1043 --- /dev/null +++ b/backend/static/ui-vector-test.html @@ -0,0 +1,18 @@ + + + + + + Ban Yaro — UI.map Vektor-Pfad-Test + + + + +
+
init…
+ + + + +