diff --git a/layouts/shortcodes/world-map.html b/layouts/shortcodes/world-map.html index 8d089cf..59c7050 100644 --- a/layouts/shortcodes/world-map.html +++ b/layouts/shortcodes/world-map.html @@ -78,6 +78,15 @@ function ifkInitMap() { window._ifkMap.addControl(new maplibregl.NavigationControl({ showCompass: false }), 'top-right'); window._ifkMap.addControl(new maplibregl.FullscreenControl(), 'top-right'); + // Enable scroll zoom in fullscreen + document.addEventListener('fullscreenchange', function() { + if (document.fullscreenElement) { + window._ifkMap.scrollZoom.enable(); + } else { + window._ifkMap.scrollZoom.disable(); + } + }); + window._ifkMap.on('load', function() { fetch('{{ "data/countries-50m.json" | relURL }}') .then(function(r) { return r.json(); })