Tile-Server: Isolations-Testseite /leaflet-vector-test (protomaps-leaflet + DACH, ohne App-Shell)
This commit is contained in:
parent
647aa684db
commit
736c326635
3 changed files with 53 additions and 0 deletions
|
|
@ -429,6 +429,12 @@ async def maplibre_test():
|
|||
# Spike-Testseite: MapLibre rendert /tiles/*.pmtiles (Geometrie-Style, kein Glyph).
|
||||
return FileResponse(os.path.join(STATIC_DIR, "maplibre-test.html"), media_type="text/html")
|
||||
|
||||
|
||||
@app.get("/leaflet-vector-test")
|
||||
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")
|
||||
|
||||
# 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)
|
||||
|
|
|
|||
24
backend/static/js/leaflet-vector-test.js
Normal file
24
backend/static/js/leaflet-vector-test.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Isolationstest: rendert die DACH-PMTiles direkt via protomaps-leaflet + map-vector.js,
|
||||
// OHNE App-Shell, ohne Feature-Flag, ohne SW-Komplikationen. Beweist, ob die
|
||||
// Vektor-Basemap-Kette an sich funktioniert.
|
||||
(function () {
|
||||
'use strict';
|
||||
var st = document.getElementById('status');
|
||||
function set(t) { if (st) st.textContent = t; }
|
||||
try {
|
||||
if (!window.L) return set('❌ Leaflet nicht geladen');
|
||||
if (!window.protomapsL) return set('❌ protomaps-leaflet nicht geladen');
|
||||
if (!window.MapVector) return set('❌ MapVector nicht geladen');
|
||||
|
||||
var map = L.map('map', { attributionControl: false }).setView([48.137, 11.576], 12); // München
|
||||
L.control.attribution({ prefix: false }).addTo(map)
|
||||
.addAttribution('© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors');
|
||||
|
||||
var layer = MapVector.basemapLayer({ dark: false });
|
||||
layer.addTo(map);
|
||||
set('✅ Vektor-Layer hinzugefügt — Tiles: ' + MapVector.tilesUrl());
|
||||
} catch (e) {
|
||||
set('❌ Fehler: ' + (e && e.message ? e.message : e));
|
||||
console.error('Isolationstest-Fehler:', e);
|
||||
}
|
||||
})();
|
||||
23
backend/static/leaflet-vector-test.html
Normal file
23
backend/static/leaflet-vector-test.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title>Ban Yaro — Leaflet-Vektor-Isolationstest</title>
|
||||
<link rel="stylesheet" href="/css/leaflet.css">
|
||||
<style>
|
||||
html,body{margin:0;height:100%}
|
||||
#map{position:absolute;inset:0}
|
||||
#hud{position:absolute;top:10px;left:10px;z-index:1000;background:rgba(255,255,255,.92);
|
||||
padding:8px 12px;border-radius:8px;font:13px system-ui,sans-serif;box-shadow:0 1px 6px rgba(0,0,0,.2);max-width:260px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<div id="hud"><b>Isolationstest</b><br>protomaps-leaflet + DACH-PMTiles<br><span id="status">init…</span></div>
|
||||
<script src="/js/leaflet.js"></script>
|
||||
<script src="/js/vendor/protomaps-leaflet.js"></script>
|
||||
<script src="/js/map-vector.js"></script>
|
||||
<script src="/js/leaflet-vector-test.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue