banyaro/backend/static/js/leaflet-vector-test.js

24 lines
1.1 KiB
JavaScript

// 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);
}
})();