Disable scroll wheel zoom on Leaflet?

Appreciate the reply — I revisited my customised mapleaflet.html.twig file (in theme/templates/partials).

I changed

var map = L.map('{{mapname}}').setView([{{ lat }}, {{ lng }}],{{ zoom }});

to

var map = L.map('{{mapname}}', { scrollWheelZoom: false }).setView([{{ lat }}, {{ lng }}],{{ zoom }});

which has disabled to zoom on scroll. I must have had a typo or similar in there before.

Note: for anyone looking to do similar, this will disable zoom on scroll for all maps you add to a site.

1 Like