Phase 0+1: Scaffold, Datenmodell, Karte und Liste

Reines HTML5/CSS3/JavaScript ohne Build-Tooling, lauffaehig direkt per
Doppelklick auf index.html (file://, kein Server noetig):

- Datenmodell fuer Ausflugsziele mit allen Feldern aus der Anforderung,
  15 feste Kategorien inkl. Farbe/Icon
- Zentraler Pub/Sub-Store mit LocalStorage-Persistenz und
  Migrations-Grundgeruest
- Interaktive Karte (Leaflet + Leaflet.markercluster, lokal vendored)
  mit kategoriefarbenen Markern, Clustering, Popups, Geolocation-Button
- Kartengrundlage ueber CARTO-Basemaps statt tile.openstreetmap.org, da
  dessen Referer-Pflicht file://-Aufrufe blockiert
- Seed-Daten als eingebettetes Script (data/seed.js) statt JSON-Datei,
  da fetch() auf lokale Dateien unter file:// nicht zuverlaessig
  funktioniert
- Ergebnisliste mit 10 Beispiel-Ausflugszielen, sicher gerendert ueber
  textContent/DOM-APIs statt innerHTML (Vorbereitung fuer spaeteren
  KI-JSON-Import mit Fremddaten)
- Responsives Layout (Desktop nebeneinander, Mobile gestapelt)
This commit is contained in:
2026-07-24 11:24:47 +02:00
parent 6b0d10c4fb
commit ee55fb1cf9
32 changed files with 2557 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
// Einstiegspunkt der Anwendung: initialisiert Store, Karte und Liste.
(function () {
const { initStore } = EventMap.store;
const { initMap, centerOnCoords, requestUserLocation } = EventMap.map;
const { initList } = EventMap.ui;
function showFatalError(message) {
const status = document.getElementById('app-status');
if (!status) return;
status.textContent = message;
status.hidden = false;
}
function setupGeolocationButton() {
const button = document.getElementById('locate-btn');
if (!button) return;
const defaultLabel = button.textContent;
button.addEventListener('click', () => {
button.disabled = true;
button.textContent = 'Standort wird ermittelt…';
requestUserLocation({
onSuccess: ({ lat, lng }) => {
centerOnCoords(lat, lng, 13);
button.disabled = false;
button.textContent = defaultLabel;
},
onError: () => {
button.disabled = false;
button.textContent = defaultLabel;
showFatalError(
'Standort konnte nicht ermittelt werden. Bitte Standortfreigabe im Browser prüfen.'
);
},
});
});
}
async function bootstrap() {
await initStore();
initMap('map');
initList('place-list');
setupGeolocationButton();
}
bootstrap().catch((err) => {
console.error('EventMap: Initialisierung fehlgeschlagen.', err);
showFatalError('Die Anwendung konnte nicht geladen werden. Bitte Seite neu laden.');
});
})();