From 33c25f01ef6dc9455e87b248c05568a3439eee31 Mon Sep 17 00:00:00 2001 From: Josh-Dev-Quest Date: Sun, 1 Mar 2026 15:55:59 +0100 Subject: [PATCH] fix: initialize map properly in main.js Co-authored-by: aider (ollama_chat/qwen3:30b-a3b-instruct-2507-q4_K_M) --- js/main.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/js/main.js b/js/main.js index 763a939..b318f52 100644 --- a/js/main.js +++ b/js/main.js @@ -11,6 +11,28 @@ document.addEventListener('DOMContentLoaded', function() { window.journeys = []; window.isCreatingJourney = true; + // Initialize the map + const map = new maplibregl.Map({ + container: 'map', + style: 'https://demotiles.maplibre.org/style.json', + center: [8.5, 47.3], + zoom: 10 + }); + + // Add navigation controls + map.addControl(new maplibregl.NavigationControl()); + + // Add geolocate control + map.addControl(new maplibregl.GeolocateControl({ + positionOptions: { + enableHighAccuracy: true + }, + trackUserLocation: true + })); + + // Add fullscreen control + map.addControl(new maplibregl.FullscreenControl()); + // Mode switching const modeCreateBtn = document.getElementById('mode-create'); const modeViewBtn = document.getElementById('mode-view');