From 8ff4f5618f806ecf1fe7906cbc4a7f826dbd61cb Mon Sep 17 00:00:00 2001 From: claude-dev Date: Wed, 4 Mar 2026 22:48:43 +0100 Subject: [PATCH] Fix: Karte nicht sichtbar - Container-Hoehe in gridstack korrigiert - map-card: position absolute + inset 0 (zuverlaessig in gridstack) - map-container: min-height 0 statt 200px (flex-Item braucht das) - map-empty: position absolute statt flex-basiert - invalidateSize mit mehreren Retries (100/300/800ms) - Bounds werden nach invalidateSize erneut gesetzt Co-Authored-By: Claude Opus 4.6 --- src/static/css/style.css | 10 ++++++---- src/static/dashboard.html | 12 ++++++------ src/static/js/components.js | 15 +++++++++++++-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/static/css/style.css b/src/static/css/style.css index 715cccc..9148535 100644 --- a/src/static/css/style.css +++ b/src/static/css/style.css @@ -4145,9 +4145,11 @@ a:hover { /* === Karten-Kachel (Leaflet) === */ .map-card { + position: absolute; + inset: 0; display: flex; flex-direction: column; - height: 100%; + overflow: hidden; } .map-card .card-header { flex-shrink: 0; @@ -4159,16 +4161,16 @@ a:hover { } .map-container { flex: 1; - min-height: 200px; position: relative; z-index: 1; + min-height: 0; } .map-empty { display: flex; align-items: center; justify-content: center; - height: 100%; - min-height: 200px; + position: absolute; + inset: 0; color: var(--text-tertiary); font-size: 13px; font-family: var(--font-body); diff --git a/src/static/dashboard.html b/src/static/dashboard.html index 07b8100..3b34af4 100644 --- a/src/static/dashboard.html +++ b/src/static/dashboard.html @@ -16,7 +16,7 @@ - + @@ -560,10 +560,10 @@ - - - - - + + + + + diff --git a/src/static/js/components.js b/src/static/js/components.js index 8127516..6445fff 100644 --- a/src/static/js/components.js +++ b/src/static/js/components.js @@ -707,8 +707,19 @@ const UI = { } } - // Resize-Fix fuer gridstack - setTimeout(() => { if (this._map) this._map.invalidateSize(); }, 200); + // Resize-Fix fuer gridstack (mehrere Versuche, da Container-Hoehe erst spaeter steht) + const self = this; + [100, 300, 800].forEach(delay => { + setTimeout(() => { + if (!self._map) return; + self._map.invalidateSize(); + if (bounds.length === 1) { + self._map.setView(bounds[0], 8); + } else if (bounds.length > 1) { + self._map.fitBounds(bounds, { padding: [30, 30], maxZoom: 12 }); + } + }, delay); + }); }, _applyMapTiles() {