SamSig SamSig - 3 months ago 18
Javascript Question

Mapbox GL JS disable scroll zoom

Unable to disable the default zooming on scroll functionality on Mapbox GL JS. Nothing in the API documentation sheds light on this. Even missing the scroll event in their docs.

var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v8',
zoom: 15
});

Answer

Inspected the map object, saw the scrollZoom and tried to call the disable. Great success!

map.scrollZoom.disable();