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:
parent
b4ad401287
commit
33c25f01ef
22
js/main.js
22
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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user