Fix: Karte-Höhe via JS, events Leaflet-Pfad, Hamburger-Menü mobile Drawer

This commit is contained in:
rene 2026-04-14 16:47:21 +02:00
parent 0438bd6bfe
commit d4c3f159d5
6 changed files with 107 additions and 3 deletions

View file

@ -129,6 +129,19 @@ window.Page_map = (() => {
const el = document.getElementById('central-map');
if (!el || !window.L || _map) return;
// Explizite Pixel-Höhe setzen, damit Leaflet Kacheln lädt.
// height:100% auf einem flex:1-Child ohne feste Parent-Höhe = 0px.
const layout = el.closest('.map-full-layout');
if (layout) {
const top = layout.getBoundingClientRect().top;
layout.style.height = (window.innerHeight - top) + 'px';
window.addEventListener('resize', () => {
const t = layout.getBoundingClientRect().top;
layout.style.height = (window.innerHeight - t) + 'px';
_map?.invalidateSize();
});
}
const center = _userPos ? [_userPos.lat, _userPos.lon] : [51.1657, 10.4515];
const zoom = _userPos ? 13 : 6;
@ -137,6 +150,8 @@ window.Page_map = (() => {
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19 })
.addTo(_map);
setTimeout(() => _map.invalidateSize(), 100);
}
// ----------------------------------------------------------