fix: initialize map properly in main.js

Co-authored-by: aider (ollama_chat/qwen3:30b-a3b-instruct-2507-q4_K_M) <aider@aider.chat>
This commit is contained in:
Josh-Dev-Quest 2026-03-01 15:55:59 +01:00
parent b4ad401287
commit 33c25f01ef
No known key found for this signature in database

View File

@ -11,6 +11,28 @@ document.addEventListener('DOMContentLoaded', function() {
window.journeys = []; window.journeys = [];
window.isCreatingJourney = true; 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 // Mode switching
const modeCreateBtn = document.getElementById('mode-create'); const modeCreateBtn = document.getElementById('mode-create');
const modeViewBtn = document.getElementById('mode-view'); const modeViewBtn = document.getElementById('mode-view');