diff --git a/themes/intotheeast/templates/home.html.twig b/themes/intotheeast/templates/home.html.twig index 88eb04a..7498ece 100644 --- a/themes/intotheeast/templates/home.html.twig +++ b/themes/intotheeast/templates/home.html.twig @@ -90,6 +90,7 @@ var HOME_GPX_URLS = {{ home_gpx_urls|json_encode|raw }}; var USE_GPX = {{ trip and trip.header.use_gpx is not null ? (trip.header.use_gpx ? 'true' : 'false') : 'true' }}; var AUTOCONNECT = "{{ trip ? (trip.header.autoconnect ?? 'on') : 'on' }}"; +document.addEventListener('DOMContentLoaded', function() { var homeMap = new maplibregl.Map({ container: 'home-map', style: MapUtils.MAP_STYLE, @@ -133,6 +134,7 @@ homeMap.on('load', function () { MapUtils.renderGpxJourney(homeMap, USE_GPX ? HOME_GPX_URLS : [], HOME_ENTRIES, 'home-gpx', 'home-journey', { connectMode: AUTOCONNECT }); }); +}); // DOMContentLoaded {% endif %} @@ -244,6 +246,7 @@ homeMap.on('load', function () { {% endif %}