Theme-Toggle als Schalter + Karten-Vollbild + Zoom-Begrenzung

- Theme-Toggle: Button durch Sun/Moon-Slider ersetzt (Dark Mode Standard)
- Karte: Fullscreen-Overlay mit Expand-Icon, Escape zum Schließen
- Karte: Zoom-Limits (minZoom:2, maxBounds, noWrap)
- Karte: Button 'Orte erkennen' -> 'Orte einlesen', rechts ausgerichtet

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
claude-dev
2026-03-08 13:18:04 +01:00
Ursprung 7734eefd35
Commit bcad3e9f3c
4 geänderte Dateien mit 234 neuen und 13 gelöschten Zeilen

Datei anzeigen

@@ -717,6 +717,9 @@ const UI = {
this._map = L.map(container, {
zoomControl: true,
attributionControl: true,
minZoom: 2,
maxBounds: [[-85, -180], [85, 180]],
maxBoundsViscosity: 1.0,
}).setView([51.1657, 10.4515], 5); // Deutschland-Zentrum
this._applyMapTiles();
@@ -839,7 +842,7 @@ const UI = {
const tileUrl = 'https://tile.openstreetmap.de/{z}/{x}/{y}.png';
const attribution = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>';
L.tileLayer(tileUrl, { attribution, maxZoom: 18 }).addTo(this._map);
L.tileLayer(tileUrl, { attribution, maxZoom: 18, noWrap: true }).addTo(this._map);
},
updateMapTheme() {
@@ -858,6 +861,60 @@ const UI = {
}
},
_mapFullscreen: false,
_mapOriginalParent: null,
toggleMapFullscreen() {
const overlay = document.getElementById('map-fullscreen-overlay');
const fsContainer = document.getElementById('map-fullscreen-container');
const mapContainer = document.getElementById('map-container');
const statsEl = document.getElementById('map-stats');
const fsStatsEl = document.getElementById('map-fullscreen-stats');
if (!this._mapFullscreen) {
// Save original parent and height
this._mapOriginalParent = mapContainer.parentElement;
this._savedMapHeight = mapContainer.style.height || mapContainer.offsetHeight + 'px';
// Move entire map-container into fullscreen overlay
fsContainer.appendChild(mapContainer);
mapContainer.style.height = '100%';
if (statsEl && fsStatsEl) {
fsStatsEl.textContent = statsEl.textContent;
}
overlay.classList.add('active');
this._mapFullscreen = true;
// Escape key to close
this._mapFsKeyHandler = (e) => { if (e.key === 'Escape') this.toggleMapFullscreen(); };
document.addEventListener('keydown', this._mapFsKeyHandler);
setTimeout(() => { if (this._map) this._map.invalidateSize(); }, 100);
} else {
// Exit fullscreen: move map-container back to original parent
overlay.classList.remove('active');
if (this._mapOriginalParent) {
this._mapOriginalParent.appendChild(mapContainer);
}
// Restore saved height
mapContainer.style.height = this._savedMapHeight || '';
this._mapFullscreen = false;
if (this._mapFsKeyHandler) {
document.removeEventListener('keydown', this._mapFsKeyHandler);
this._mapFsKeyHandler = null;
}
const self = this;
[100, 300, 600].forEach(delay => {
setTimeout(() => { if (self._map) self._map.invalidateSize(); }, delay);
});
}
},
_mapFsKeyHandler: null,
/**
* HTML escapen.
*/