Diagnose: /ui-vector-test — testet echten ui.js-Vektor-Pfad (UI.map.create) ohne Auth
This commit is contained in:
parent
b0fece16c8
commit
5cb7c3091d
3 changed files with 47 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
23
backend/static/js/ui-vector-test.js
Normal file
23
backend/static/js/ui-vector-test.js
Normal file
|
|
@ -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);
|
||||
}
|
||||
})();
|
||||
})();
|
||||
18
backend/static/ui-vector-test.html
Normal file
18
backend/static/ui-vector-test.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Ban Yaro — UI.map Vektor-Pfad-Test</title>
|
||||
<link rel="stylesheet" href="/css/leaflet.css">
|
||||
<style>html,body{margin:0;height:100%}#map{position:absolute;inset:0}
|
||||
#status{position:absolute;top:8px;left:8px;z-index:1000;background:#fff;padding:6px 10px;border-radius:6px;font:12px system-ui;max-width:88vw;box-shadow:0 1px 6px rgba(0,0,0,.2)}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<div id="status">init…</div>
|
||||
<script src="/js/leaflet.js"></script>
|
||||
<script src="/js/ui.js"></script>
|
||||
<script src="/js/ui-vector-test.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue