fix: wrap map init in DOMContentLoaded — map.js loads at bottom via Asset Manager
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr
This commit is contained in:
@@ -253,6 +253,8 @@ var GPX_URLS = {{ gpx_urls|json_encode|raw }};
|
|||||||
var USE_GPX = {{ page.header.use_gpx ?? true ? 'true' : 'false' }};
|
var USE_GPX = {{ page.header.use_gpx ?? true ? 'true' : 'false' }};
|
||||||
var AUTOCONNECT = "{{ page.header.autoconnect ?? 'on' }}";
|
var AUTOCONNECT = "{{ page.header.autoconnect ?? 'on' }}";
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
var tripMap = new maplibregl.Map({
|
var tripMap = new maplibregl.Map({
|
||||||
container: 'trip-map',
|
container: 'trip-map',
|
||||||
style: MapUtils.MAP_STYLE,
|
style: MapUtils.MAP_STYLE,
|
||||||
@@ -376,6 +378,7 @@ var HAS_GPX = {{ has_gpx ? 'true' : 'false' }};
|
|||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
}); // DOMContentLoaded
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button class="story-totop" id="trip-totop" aria-label="Back to top">↑ Top</button>
|
<button class="story-totop" id="trip-totop" aria-label="Back to top">↑ Top</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user