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');